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

Commit 32e4e11e authored by Pavel Grafov's avatar Pavel Grafov Committed by Android (Google) Code Review
Browse files

Merge "Clear calling identity for operation safety bcast" into main

parents dcf293d0 14261270
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -15993,8 +15993,6 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        @Override
        public void notifyUnsafeOperationStateChanged(DevicePolicySafetyChecker checker, int reason,
                boolean isSafe) {
            // TODO(b/178494483): use EventLog instead
            // TODO(b/178494483): log metrics?
            if (VERBOSE_LOG) {
                Slogf.v(LOG_TAG, "notifyUnsafeOperationStateChanged(): %s=%b",
                        DevicePolicyManager.operationSafetyReasonToString(reason), isSafe);
@@ -16006,16 +16004,20 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            extras.putInt(DeviceAdminReceiver.EXTRA_OPERATION_SAFETY_REASON, reason);
            extras.putBoolean(DeviceAdminReceiver.EXTRA_OPERATION_SAFETY_STATE, isSafe);
            mInjector.binderWithCleanCallingIdentity(() -> {
                if (mOwners.hasDeviceOwner()) {
                    if (VERBOSE_LOG) Slogf.v(LOG_TAG, "Notifying DO");
                sendDeviceOwnerCommand(DeviceAdminReceiver.ACTION_OPERATION_SAFETY_STATE_CHANGED,
                    sendDeviceOwnerCommand(
                            DeviceAdminReceiver.ACTION_OPERATION_SAFETY_STATE_CHANGED,
                            extras);
                }
                for (int profileOwnerId : mOwners.getProfileOwnerKeys()) {
                    if (VERBOSE_LOG) Slogf.v(LOG_TAG, "Notifying PO for user " + profileOwnerId);
                sendProfileOwnerCommand(DeviceAdminReceiver.ACTION_OPERATION_SAFETY_STATE_CHANGED,
                    sendProfileOwnerCommand(
                            DeviceAdminReceiver.ACTION_OPERATION_SAFETY_STATE_CHANGED,
                            extras, profileOwnerId);
                }
            });
        }
        private @Mode int findInteractAcrossProfilesResetMode(String packageName) {