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

Commit 2a7376d3 authored by Yan Zhu's avatar Yan Zhu Committed by Android (Google) Code Review
Browse files

Merge "Add getProfileOwnerNameUnchecked private method and use in manageUserUnchecked"

parents 98d30051 63f7e288
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -8421,7 +8421,10 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
            return null;
        }
        Preconditions.checkCallAuthorization(canManageUsers(getCallerIdentity()));
        return getProfileOwnerNameUnchecked(userHandle);
    }
    private String getProfileOwnerNameUnchecked(int userHandle) {
        ComponentName profileOwner = getProfileOwnerAsUser(userHandle);
        if (profileOwner == null) {
            return null;
@@ -9731,7 +9734,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        // Set admin.
        setActiveAdmin(profileOwner, /* refreshing= */ true, userId);
        final String ownerName = getProfileOwnerName(Process.myUserHandle().getIdentifier());
        final String ownerName = getProfileOwnerNameUnchecked(
                Process.myUserHandle().getIdentifier());
        setProfileOwner(profileOwner, ownerName, userId);
        synchronized (getLockObject()) {