- Switch from USER_STARTING to USER_STARTED which is the foreground
version of the broadcast
- Set the new VPN network as CONNECTING initially to avoid spamming
apps with useless notifications ahead of the network being fully
available
Bug: 26694104
Fix: 28335277
Change-Id: I31d5260dda62ff440c31c44eb0aa5c891e2717e5
Network creation setup sometimes involves extra steps after actually
calling into netd to create the underlying network, rules & routes &
to begin allowing sockets bound to it.
For example, VPN networks can set a UID whitelist or blacklist. This
should happen:
- AFTER there is a netID & network created in netd as
network-specific rules will need to be tied to / point at it. Those
rules are tied to the lifecycle of netd's network which is tracked
by `NetworkAgentInfo.created` on the frameworks side.
- BEFORE the CONNECTED broadcast and network callbacks have been sent
out so that we don't create a race condition between clients that
want to use the network and the server actually having the network
ready
The race condition existed prior to this change and required any client
making use of network callbacks to sleep for a short amount of time after
receiving to actually be able to use the network.
Among other things, that race condition is now fixed.
Bug: 26694104
Change-Id: Ied92f5588a98c3e97f456bc98b676bf201ab5472
When a job will eventually run in the foreground, the internal
scheduling needs to ignore any background network restrictions when
satisfying constraints. This also means the job should ignore the
current device doze state, since the requesting app could get the
same behavior by starting their own foreground service.
Always dispatch network policy changes to ConnectivityService first
to ensure that it has up-to-date information. Fix bugs around data
saver that were causing networks to not be marked as BLOCKED for
background apps; before this fix apps would have been spinning in
internal connectivity loops, thinking that the network was actually
connected when the kernel was actually blocking their traffic.
Offer new ConnectivityService method overloads to ignore the blocked
state for a specific UID.
Print unsatisfied job constraints to aid debugging.
Bug: 26571724
Change-Id: Iaaa17933e6dc1bf6d3dff26d0bfc12222e51e241
Moved several USER_STOPPING registered receivers to listen
to USER_STOPPED, since they don't need to be blocking the
shutdown of the user.
Clear all stale broadcasts when stopping a user, so that we
don't unnecessarily start up processes and deliver stale
broadcasts. This was causing code to run when the user was
already stopped and resulted in crashes when other providers
and services couldn't be started anymore. Hopefully this fixes
many of those races.
Bug: 28371487
Change-Id: Ic35a7a23fa8fe009a53f8bf7545d4dad5fa34134
If tethering is on when Data Saver mode is turned on, tethering should
be disabled, and vice-versa.
BUG: 28313291
Change-Id: I7f3dadbd97ea1492ab76b41043dea7487c1db02d
Place helper map for callback field names into a holder. This avoids
the reflective calls in static initialization of ConnectivityManager
in the common (non-debug) case, which means the class can be
compile-time initialized. Also saves the storage necessary (both
the storage array as well as the reflection metadata).
Follow-up to b027e6e92b.
Bug: 27265238
Change-Id: Ib4bfaf27acd234a035a5d198458340099a156a4c
To support moving DownloadManager, add new JobScheduler network type
constraint that matches "any network except roaming." Also add an
API to get a specific JobInfo by ID.
Since the default network can be different on a per-app basis, and
individual apps may be blocked due to app standby, evaluate job
connectivity constraints on a per-UID basis. To implement this
cleanly, add NetworkInfo.isMetered() to match the isRoaming() API.
Add new DownloadManager APIs to support charging and device idle
constraints, which are plumbed through to JobScheduler under the
hood when scheduled.
Add filtering to JobScheduler dumpsys to omit noisy details for
packages the caller isn't interested in.
Bug: 28098882, 26571724, 19821935
Change-Id: I09ca7184ef7ce6adba399f579d415a5fb2ea6110
This patches changes how captive portal tests and network lifecycle
events are logged as connectivity events:
- it splits NetworkMonitorEvent into two event classes:
- ValidationProbeEvent for logging individual probe events.
- NetworkEvent for logging network connection, validation,
lingering, and disconnection.
- it removes the redundant CaptivePortalCheckResultEvent class.
The information logged in CaptivePortalCheckResultEvent was already
logged by NetworkMonitorEvent, but missing the evaluation durations.
It is now logged by ValidationProbeEvent.
- it removes the CaptivePortalStateChangeEvent class, which is now
redundant with NetworkEvent, but missing evaluation durations.
In addition, it adds event logging when ConnectivityService puts a
network into lingering or removes a network from lingering.
Bug: 28204408
Change-Id: I8f9752e4d36175ecfcbd1545a01a41bad6e06ea4
When users add or remove an app to the Data Saver Mode whitelist, the
app is notified through a
ConnectivityManager.ACTION_RESTRICT_BACKGROUND_CHANGED. But besides this
broadcast, it's also necessary to notify internal apps such Settings,
hence a new method is being added to INetworkPolicyListener.
BUG: 27481520
Change-Id: I1537a77becf6b7da1535ed5faabdc894fd9f7084
The JavaDoc for many of the requestNetwork and
[un]registerNetworkCallback APIs incorrectly mentions the
PendingIntent version of the APIs instead of the NetworkCallback
version.
Also fix a minor issue in the registerDefaultNetworkCallback
JavaDoc: the default network request is an implementation detail,
so don't mention it. Instead, talk about the "system default
network".
Change-Id: Id94d98261daa2bd768c10e033cb8092729b21c91
am: 3e5055b -s ours
* commit '3e5055bec9570280638d5da0ef209765bba9dfaf': (546 commits)
Update studio landing page and add all-new install flow docs. bug: 27850063 (update system reqs for 2.0) bug: 27725026 (update download page for 2.0) bug: 23908299 (clean up download and get started)
docs: April 2016 Dashboard update
docs: Added new partner logos to the car brands section of auto index page.
Revert "Updates for Play" April Fool's joke.
Updates for Play.
docs: "Result is:" paragraph now in correct position on page.
docs: Fixed namespace shown in a line of style XML
docs: Add note about missing recording functionality in Live Channels
docs: NDK r11c - release notes and downloads
docs: Removed dead link in "create project" TOC.
docs: Corrected reference link for NotificationManager.notify().
docs: Added link to "preparing for multiwindow" blog post
docs: Clarified how multi-window applies to activities in task stack
[RenderScript] Update documentation about API level and RS Support Lib.
cherrypick from mnc-docs docs: Updated API changes for Dinar wearable support.
simplification and clarification to the Studio Overview
Substitute for placeholder text.
docs: Added missing semicolon within code sample.
docs: Fixed Marshmallow links in API level table.
docs: Update Nexus 9, 9G OTA images for N Preview
...
Change-Id: I2a64872d24ff2780503766f94e6d693edbdd47b8
Transport may use the redirect to make additional determination about network
state.
Bug: 25203607
Change-Id: I07d8918f13fdcbe0b6fd757536bfc1850a2a244f
Added not_metered capability to a mobile network if none
of its associated APN types are metered. Also used not_metered
capability to determine if a network should be accounted for
data usage or not instead of using network type, which is
always MOBILE after refactoring. Will add VT usage support
in next phase.
bug: 20888836
Change-Id: Id692cb856be9a47d0e918371112630128965b1bb
Callers with CONNECTIVITY_INTERNAL permission can read off the netId
that an application is assigned to by default.
Necessary for making connections as the default network for a client
app eg. when downloading stuff on its behalf.
Bug: 27074270
Change-Id: I8d35e8e99126875f55f3c545090326f3e9be43fb
Since Lollipop, routes are isolated within Networks. Flushing a
Network's DNS cache whenever that same Network's routes are updated
doesn't provide any benefit. Any system components depending on this
behaviour need to uncovered and fixed.
Additionally, clean up no-longer-used flushNetworkDnsCache(). This
should be replaced, when needed, by a proper binder interface to netd.
Change-Id: I34bf79e4839da014d466058a876d754209d0c007
There's a few advantages to having ApfFilter in IpManager:
1. If things go wrong, crashing a particular transport is less bad then
crashing ConnectivityService. We also don't want to use
ConnectivityService as a dumping ground for transport-specific logic.
2. This makes implementing WifiManager.MulticastLock a lot simpler and
safer because enabling/disabling it doesn't have to go through the
NetworkAgent, which could risk various races (e.g. installing a filter
into the wrong WiFi network).
3. IpManager is the ultimate source for LinkProperties for a particular
transport and since ApfFilter uses the LinkProperties it's better to
have it closely paired with the IpManager. Likewise, ApfFilter needs
to know the APF capabilities of the transport, so having it in
the transport avoids having to parcel this information through the
NetworkAgent.
Bug: 26238573
Change-Id: I99b85f2b64972f0e7572170ec5d1926081aa3429
Adds initial support for IP connectivity metrics collection (DHCP
client, IP reachability monitor, network monitor, connectivity
service).
Change-Id: If9a0455f2a34aa9abea90f9c1b38e4d895dc1a72
The "default network tracking" request is somewhere between a listen
and a request, in previous semantics. It is more like a listen in that
it doesn't cause any network to be brought up, but also like a request
in that will only get callbacks about a single network at a time (not
all networks that might match).
This change minimally splits the NetworkRequest types into 3: LISTEN,
REQUEST, and TRACK_DEFAULT.
Change-Id: I2d113b2f6eed526a7808592bce0118260a56f77c