Merge "Fixed enforceMeteredApnPolicy when Data Saver is on." into nyc-dev am: efd3a1749f

am: bf53edcadb

* commit 'bf53edcadb236c407abf1ec5fd501419261f5e77':
  Fixed enforceMeteredApnPolicy when Data Saver is on.

Change-Id: I62eb108dfad2ac1ffd2b541470f01a7923d92731
This commit is contained in:
Felipe Leme
2016-05-24 18:23:58 +00:00
committed by android-build-merger

View File

@@ -4066,7 +4066,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
synchronized(mRulesLock) {
uidRules = mUidRules.get(uid, RULE_ALLOW_ALL);
}
if ((uidRules & RULE_ALLOW_ALL) == 0) {
if (mRestrictBackground && (uidRules & RULE_ALLOW_METERED) == 0
&& (uidRules & RULE_TEMPORARY_ALLOW_METERED) == 0) {
// we could silently fail or we can filter the available nets to only give
// them those they have access to. Chose the more useful option.
networkCapabilities.addCapability(NET_CAPABILITY_NOT_METERED);