From 72f83d6a05ddecd516787cedb3b49839bb287c6d Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Mon, 27 Jul 2015 15:10:42 -0400 Subject: Allow Settings to set background data restrict on secondary users. Bug: 22721091 Change-Id: Iadfbd25f75f233f2c3c080e0de05b0244572b6cd --- .../com/android/server/net/NetworkPolicyManagerService.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'services') diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java index 395aa27..cd982d3 100644 --- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java +++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java @@ -1520,9 +1520,14 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { } synchronized (mRulesLock) { - final int oldPolicy = mUidPolicy.get(uid, POLICY_NONE); - if (oldPolicy != policy) { - setUidPolicyUncheckedLocked(uid, policy, true); + final long token = Binder.clearCallingIdentity(); + try { + final int oldPolicy = mUidPolicy.get(uid, POLICY_NONE); + if (oldPolicy != policy) { + setUidPolicyUncheckedLocked(uid, policy, true); + } + } finally { + Binder.restoreCallingIdentity(token); } } } -- cgit v1.1