Skip to content

Commit b7a6859

Browse files
author
Amith Yamasani
committed
Fix DevicePolicyManager crash when settings password quality (and possibly others).
Bug: 7130570 Clear the calling identity before broadcasting to all users. Change-Id: Ibe84af1ee00aecfe4b2d5bb7731a952f617b4885
1 parent 25c925e commit b7a6859

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

services/java/com/android/server/DevicePolicyManagerService.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,13 @@ private void saveSettingsLocked() {
721721
private void sendChangedNotification() {
722722
Intent intent = new Intent(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED);
723723
intent.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
724-
mContext.sendBroadcastAsUser(intent, UserHandle.ALL);
724+
long ident = Binder.clearCallingIdentity();
725+
try {
726+
// TODO: This shouldn't be sent to all users, if DPM is per user.
727+
mContext.sendBroadcastAsUser(intent, UserHandle.ALL);
728+
} finally {
729+
Binder.restoreCallingIdentity(ident);
730+
}
725731
}
726732

727733
private void loadSettingsLocked() {

0 commit comments

Comments
 (0)