Clear identity when asking for other users.
Bug: 76394640
Test: nope
Change-Id: I8d1530ed01669947e91725e905240729e31c7234
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index 3a2ec06..a6d6250 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -2754,12 +2754,17 @@
mGenerationRegistry.incrementGeneration(key);
if (isGlobalSettingsKey(key)) {
- if (Global.LOCATION_GLOBAL_KILL_SWITCH.equals(name)) {
- // When the global kill switch is updated, send the
- // change notification for the location setting.
- notifyLocationChangeForRunningUsers();
+ final long token = Binder.clearCallingIdentity();
+ try {
+ if (Global.LOCATION_GLOBAL_KILL_SWITCH.equals(name)) {
+ // When the global kill switch is updated, send the
+ // change notification for the location setting.
+ notifyLocationChangeForRunningUsers();
+ }
+ notifyGlobalSettingChangeForRunningUsers(key, name);
+ } finally {
+ Binder.restoreCallingIdentity(token);
}
- notifyGlobalSettingChangeForRunningUsers(key, name);
} else {
final int userId = getUserIdFromKey(key);
final Uri uri = getNotificationUriFor(key, name);