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

Commit 1e2adecd authored by bkchoi's avatar bkchoi
Browse files

Fix NPE due to a null package name of system enforcing admin.

mPackageName is assumed to be non-null. Set it to an empty string to
avoid a null pointer exception during saveToXml().

Bug: 358733540
Flag: EXEMPT bugfix
Test: - start MD emulator
      - Start New Profile
      - $ adb shell dumpsys user
      - $ adb shell dumpsys device_policy

Change-Id: I962e2bb89c573fdaaa29b41f5b6c81df881cb56c
parent d42c8a52
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -203,7 +203,8 @@ final class EnforcingAdmin {
        // Only system authorities use this constructor.
        mIsSystemAuthority = true;
        mIsRoleAuthority = false;
        mPackageName = null;
        // Package name is not used for a system enforcing admin, so an empty string is fine.
        mPackageName = "";
        mSystemEntity = systemEntity;
        mUserId = UserHandle.USER_SYSTEM;
        mComponentName = null;