Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee3a4374 authored by Robin Lee's avatar Robin Lee
Browse files

Send pwchange broadcast to caller only in FBE case

When per-user encryption is set up and we change the password of a
profile, the parent and other profiles shouldn't receive an
ACTION_PASSWORD_CHANGED as they have their own distinct passwords.

Change-Id: I70d4ec81277a9bdc3ac6cd952b84cd769a2800b4
parent e85cf98a
Loading
Loading
Loading
Loading
+11 −3
Original line number Original line Diff line number Diff line
@@ -3897,10 +3897,18 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                saveSettingsLocked(userHandle);
                saveSettingsLocked(userHandle);
                updatePasswordExpirationsLocked(userHandle);
                updatePasswordExpirationsLocked(userHandle);
                setExpirationAlarmCheckLocked(mContext, policy);
                setExpirationAlarmCheckLocked(mContext, policy);

                // Send a broadcast to each profile using this password as its primary unlock.
                if (LockPatternUtils.isSeparateWorkChallengeEnabled()) {
                    sendAdminCommandLocked(
                            DeviceAdminReceiver.ACTION_PASSWORD_CHANGED,
                            DeviceAdminInfo.USES_POLICY_LIMIT_PASSWORD, userHandle);
                } else {
                    sendAdminCommandToSelfAndProfilesLocked(
                    sendAdminCommandToSelfAndProfilesLocked(
                            DeviceAdminReceiver.ACTION_PASSWORD_CHANGED,
                            DeviceAdminReceiver.ACTION_PASSWORD_CHANGED,
                            DeviceAdminInfo.USES_POLICY_LIMIT_PASSWORD, userHandle);
                            DeviceAdminInfo.USES_POLICY_LIMIT_PASSWORD, userHandle);
                }
                }
            }
        } finally {
        } finally {
            mInjector.binderRestoreCallingIdentity(ident);
            mInjector.binderRestoreCallingIdentity(ident);
        }
        }