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

Unverified Commit 70470b8e authored by Steve Kondik's avatar Steve Kondik Committed by Michael Bestas
Browse files

dpm: Fix crash when invoked by system

 * ApplicationInfo will be null in this case, skip the legacyApp
   check to avoid crashing of system_server.

Change-Id: Ifcbc2528a6d0e9e6bd5df1ad4fcd8d65341ce052
parent 1b374f19
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -5243,9 +5243,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        }

        boolean legacyApp = false;
        if (ai != null) {
            if (ai.targetSdkVersion <= Build.VERSION_CODES.M) {
                legacyApp = true;
            }
        }

        final int rawStatus = getEncryptionStatus();
        if ((rawStatus == DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE_PER_USER) && legacyApp) {