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

Commit c1205269 authored by arangelov's avatar arangelov
Browse files

Add admin info to LOCK_NOW event logging.

Fixes: 122471608
Test: atest MixedManagedProfileOwnerTest#testLockNowLogged
Test: MixedDeviceOwnerTest#testLockNowLogged
Test: MixedProfileOwnerTest#testLockNowLogged
Change-Id: I9f056cc636a5d489c2b70d3c1243a886e2334994
parent 2b9930d0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -5326,6 +5326,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        }
        final int callingUserId = mInjector.userHandleGetCallingUserId();
        ComponentName adminComponent = null;
        synchronized (getLockObject()) {
            // Make sure the caller has any active admin with the right policy or
            // the required permission.
@@ -5336,8 +5337,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
                    android.Manifest.permission.LOCK_DEVICE);
            final long ident = mInjector.binderClearCallingIdentity();
            try {
                final ComponentName adminComponent = admin == null ?
                        null : admin.info.getComponent();
                adminComponent = admin == null ? null : admin.info.getComponent();
                if (adminComponent != null) {
                    // For Profile Owners only, callers with only permission not allowed.
                    if ((flags & DevicePolicyManager.FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY) != 0) {
@@ -5389,6 +5389,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        }
        DevicePolicyEventLogger
                .createEvent(DevicePolicyEnums.LOCK_NOW)
                .setAdmin(adminComponent)
                .setInt(flags)
                .write();
    }