Merge "Clear calling identity before getting the current user." into mnc-dev

This commit is contained in:
Julia Reynolds
2015-08-14 19:17:31 +00:00
committed by Android (Google) Code Review

View File

@@ -3615,6 +3615,9 @@ public class NotificationManagerService extends SystemService {
public ArraySet<String> getGrantedPackages() { public ArraySet<String> getGrantedPackages() {
final ArraySet<String> pkgs = new ArraySet<>(); final ArraySet<String> pkgs = new ArraySet<>();
long identity = Binder.clearCallingIdentity();
try {
final String setting = Settings.Secure.getStringForUser( final String setting = Settings.Secure.getStringForUser(
getContext().getContentResolver(), getContext().getContentResolver(),
Settings.Secure.ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES, Settings.Secure.ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES,
@@ -3632,6 +3635,9 @@ public class NotificationManagerService extends SystemService {
pkgs.add(token); pkgs.add(token);
} }
} }
} finally {
Binder.restoreCallingIdentity(identity);
}
return pkgs; return pkgs;
} }