Add onBlockedStatusChanged(Network, int) to NetworkCallback.
This is similar to onBlockedStatusChanged(Network, boolean) but it allows the callback holder to know the exact reason why networking was blocked. It is useful to privileged system components such as JobScheduler that are able to ignore some blocked reasons but not others. Also add a new BLOCKED_REASON_LOCKDOWN_VPN that is used when networking is blocked because an always-on VPN is in lockdown mode. Also move BLOCKED_METERED_REASON_MASK to ConnectivityManager. This is necessary because ConnectivityService must ensure that the blocked status callbacks are correctly sent when meteredness changes (e.g., a UID that is blocked on metered networks will become unblocked on a network that becomes unmetered). In order to do this it needs to know which reasons apply only on metered networks. Bug: 165835257 Test: unit tests in subsequent CLs in the stack Change-Id: I647db4f5a01280be220288e73ffa85c15bec9370
Loading
Please register or sign in to comment