diff options
author | Amith Yamasani <yamasani@google.com> | 2012-09-10 10:24:36 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2012-09-10 10:24:36 -0700 |
commit | b7a685978f3ea8a1514166c6986c1f1bacedab4a (patch) | |
tree | 3d36bef639199f03e228434802be16cb5740350d /services/java/com/android/server/DevicePolicyManagerService.java | |
parent | 25c925e6659e57f1cc8fef83be07f3917a108e3c (diff) |
Fix DevicePolicyManager crash when settings password quality (and possibly others).
Bug: 7130570
Clear the calling identity before broadcasting to all users.
Change-Id: Ibe84af1ee00aecfe4b2d5bb7731a952f617b4885
Diffstat (limited to 'services/java/com/android/server/DevicePolicyManagerService.java')
-rw-r--r-- | services/java/com/android/server/DevicePolicyManagerService.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/services/java/com/android/server/DevicePolicyManagerService.java b/services/java/com/android/server/DevicePolicyManagerService.java index fd6060a7b8e8..28a4310734c5 100644 --- a/services/java/com/android/server/DevicePolicyManagerService.java +++ b/services/java/com/android/server/DevicePolicyManagerService.java @@ -721,7 +721,13 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { private void sendChangedNotification() { Intent intent = new Intent(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED); intent.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); - mContext.sendBroadcastAsUser(intent, UserHandle.ALL); + long ident = Binder.clearCallingIdentity(); + try { + // TODO: This shouldn't be sent to all users, if DPM is per user. + mContext.sendBroadcastAsUser(intent, UserHandle.ALL); + } finally { + Binder.restoreCallingIdentity(ident); + } } private void loadSettingsLocked() { |