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

Commit 06573a02 authored by Jason Parks's avatar Jason Parks
Browse files

Fix NPE when checking for user restriction sources.

The DevicePolicyManagerInternal only gets added as a local service
if the DPM feature is set.

Test: manual
Bug: 285521477

Change-Id: I38f68ffd789078b99b294e7eb6ad90960c5b799e
parent 7f5bf41e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2938,8 +2938,10 @@ public class UserManagerService extends IUserManager.Stub {
                    UserHandle.USER_NULL, UserManager.RESTRICTION_SOURCE_SYSTEM));
        }

        result.addAll(getDevicePolicyManagerInternal()
                .getUserRestrictionSources(restrictionKey, userId));
        final DevicePolicyManagerInternal dpmi = getDevicePolicyManagerInternal();
        if (dpmi != null) {
            result.addAll(dpmi.getUserRestrictionSources(restrictionKey, userId));
        }
        return result;
    }