Skip to content

Commit 6c0b4f3

Browse files
committed
Clear identity when snoozing limit.
Continues to check MANAGE_NETWORK_POLICY permission. This allows SystemUI to invoke snoozeLimit() without CONNECTIVITY_INTERNAL. Bug: 6653091 Change-Id: I464bf62b79f2647c6b6db151251a0036897d0cc0
1 parent f6f7f1d commit 6c0b4f3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

services/java/com/android/server/net/NetworkPolicyManagerService.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,13 @@ public NetworkPolicy[] getNetworkPolicies() {
14071407
@Override
14081408
public void snoozeLimit(NetworkTemplate template) {
14091409
mContext.enforceCallingOrSelfPermission(MANAGE_NETWORK_POLICY, TAG);
1410-
performSnooze(template, TYPE_LIMIT);
1410+
1411+
final long token = Binder.clearCallingIdentity();
1412+
try {
1413+
performSnooze(template, TYPE_LIMIT);
1414+
} finally {
1415+
Binder.restoreCallingIdentity(token);
1416+
}
14111417
}
14121418

14131419
private void performSnooze(NetworkTemplate template, int type) {

0 commit comments

Comments
 (0)