Without this fix if a listening NetworkRequest with NET_CAPABILITY_VALIDATED
is submitted after a network has been validated but failed the most recent
validation attempt, the NetworkRequest will never receive callbacks.
Bug: 21343774
Change-Id: I6fa6d563c9a6f278b20e645776b707559033b249
Before falling back to cellular we used to first delete all the
network routing tables and rules for WiFi. This isn't necessary
and can take significant time as it requires a lot of netd
shelling out to ip and ip[6]tables to flush routes and remove
the incoming packet mark rule. Instead have netd delete all the
network routing tables and rules after we've either fallen back
to cellular or at least kicked off a cellular connection attempt.
Bug: 21932815
Change-Id: Iabac4a8b962492682df3073cc41a12e35bc9f1bb
Without this API we're more or less encouraging apps to have long running
processes (battery draining) to receive NetworkCallbacks for the stateful
NetworkCapabilities NET_CAPABILITIES_VALIDATED and
NET_CAPABILITIES_CAPTIVE_PORTAL. With this API they can instead using
PendingIntents which outlive their apps.
Bug: 21343774
Change-Id: I168d0ac3757729acf7ca5546079846f575a0eedd
Select only DNS servers that:
- are reachable, according to routes in the LinkProperties, AND
- have a "suitable" source address in the LinkProperites, meaning:
- IPv4 DNS server:
- only if LinkProperties has any IPv4 address
- IPv6 link-local DNS server:
- only if the server has a scopeId set
- assume for now that LinkProperties has a suitable
link-local address
- IPv6 non-link-local DNS server:
- only if LinkProperties has a global, preferred IPv6 address
Bug: 19470192
Bug: 20733156
Change-Id: Ibd95f3f7b33a4fb6c36d1cea4adb63c99068f657
- There are no callers of
NetworkInfo.setIsConnectedToProvisioningNetwork(), so remove all the
code that deals with mIsConnectedToProvisioningNetwork being true,
including the two ConnectiviyManager APIs.
- There are no callers of
ConnectivityManager.getMobileRedirectedProvisioningUrl(), so remove
the code that reads this URL.
- There are no callers of
ConnectivityManager.captivePortalCheckCompleted(), so remove this
API which is currently a no-op.
Change-Id: Ifa44c7553c7c45ebe261a2a124d9bf8d6f96c690
Additionally:
- make zero more obvious for debugging, rather than emitting
some inscrutable magic value.
Bug: 19537384
Change-Id: Iac9a3297a0dda1ba3d69fd01cf6de81f01fd837e
The API review comments in http://b/21343774 point out that the
suggested use case for onPreCheck (captive portal login apps) is
not a good use case as it requires that the app always be
running.
Also, unhide NET_CAPABILITY_VALIDATED, which is useful to apps
that want to detect captive portals and network connectivity
failures.
Bug: 21343774
Change-Id: Iad7c839bcc136b0fa9581dccc5fd97a28efed4ab
We used to only remove requests that we'd acted on but that's
just wrong.
Also adds test case which exposed the problem but passes with the fix.
bug:20731384
Change-Id: I581a005560cc71167b857abf2452769399a9e1b7
Overlapping the NetIDs can cause the ConnectivityService instance under test
to inadvertently use real networks, for example when NetworkMonitor attempts
to validate a network. This fixes test hangs when run on devices with
active internet connections.
Change-Id: I5e1898953f0117b9f75beccac4a52ae2db173567
Previously, we displayed a dialog on top of whatever the user was
doing. Instead, display a notification that can take the user to
the dialog.
Because the notification is less intrusive, also enable it even
if the network without Internet access is already the system
default network. Previously we did not do this because in that
case the user might not have other useful options, and thus a
dialog would have been too intrusive.
Bug: 20081183
Bug: 20538448
Change-Id: I677be238d675c13a13dc0bae2dbb37cbe4f52cb6
These are more consistent and have placeholders for the description of
whatever VPN apps are actually active.
Bug: 20516964
Bug: 17474682
Change-Id: I37ff287b795f10bbbb192540f09f8100bb27b1a0
Code that uses android.system.Os to create sockets as FileDescriptors
should be able to bind them to networks. Note that FileDescriptors
could already be marked as "protected from VPNs" via
NetworkUtils#protectFromVpn(), but heretofore were not easily bound
to any particular network.
Bug: 21449922
Change-Id: I4bb86db5d95d5a55bb2d7e245848d11eaa351e65
- Print NetworkFactories on one line.
- Only print LegacyTypeTracker networks if they are connected,
and record supported network types on a separate summary line.
- Print all tethering upstreams on one line.
- Summarize the state of the transition wakelock on one line.
- Don't print Inet condition reports if there are none.
(Currently there can never be any.)
Bug: 21449922
Change-Id: Ib4b29a7fd882e6c105839a255fffecf4f346cf7e
Adds:
- enum ProvisioningChange
- LinkProperties#compareProvisioning()
return a ProvisioningChange value describing the delta in
provisioning between two LinkProperties objects
- LinkProperties#removeDnsServer()
- make "@hide public" isIPv4Provisioned() and isIPv6Provisioned()
Bug: 18581716
Change-Id: I3df90b2b89617f693346f2dbe72e77c88ce91ffd
- space pollLceData calls every 500ms
- cluster multiple pending pollLceData calls into one
- cherry pick from mwd to mnc-dev
Bug: 21307957
Change-Id: I04513011db3ae29af02bd54fe91cb8e0d4ab9f12
It was deprecated as part of the Apache deprecation, however it is used
by ConnectivityManager.getLinkProperties() and .getDefaultProxy().
The alternatives (e.g. java.net.Proxy) do not offer a complete
replacement as they lack certain fields (e.g. PAC URL).
Bug:21274137
Change-Id: I99163a2611a738f337fb9907349ef6255dbed6d6