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

Commit ece66c41 authored by Sarup Dalwani's avatar Sarup Dalwani
Browse files

Renaming isCredentialSharedWithParent to isCredentialSharableWithParent

Renaming isCredentialSharedWithParent to isCredentialSharableWithParent,
as for work profile there is possibility to enroll its own credential.

Bug: 222108271
Test: atest android.multiuser.cts.UserManagerTest
atest LockSettingsServiceTests

Change-Id: If343342d0a5e996cbd430a4063b25fbc4874c5c0
parent a83af165
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9808,7 +9808,7 @@ package android.os {
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public boolean hasUserRestrictionForUser(@NonNull String, @NonNull android.os.UserHandle);
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS, android.Manifest.permission.QUERY_USERS}) public boolean isAdminUser();
    method public boolean isCloneProfile();
    method public boolean isCredentialSharedWithParent();
    method public boolean isCredentialSharableWithParent();
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS, android.Manifest.permission.QUERY_USERS}) public boolean isGuestUser();
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.QUERY_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public boolean isManagedProfile(int);
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public boolean isMediaSharedWithParent();
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ interface IUserManager {
    boolean someUserHasAccount(in String accountName, in String accountType);
    String getProfileType(int userId);
    boolean isMediaSharedWithParent(int userId);
    boolean isCredentialSharedWithParent(int userId);
    boolean isCredentialSharableWithParent(int userId);
    boolean isDemoUser(int userId);
    boolean isPreCreated(int userId);
    UserInfo createProfileForUserEvenWhenDisallowedWithThrow(in String name, in String userType, int flags,
+3 −3
Original line number Diff line number Diff line
@@ -4759,7 +4759,7 @@ public class UserManager {
    }

    /**
     * Returns {@code true} if the user shares lock settings credential with its parent user
     * Returns whether the user can have shared lockscreen credential with its parent user.
     *
     * This API only works for {@link UserManager#isProfile() profiles}
     * and will always return false for any other user type.
@@ -4772,9 +4772,9 @@ public class UserManager {
                    Manifest.permission.MANAGE_USERS,
                    Manifest.permission.INTERACT_ACROSS_USERS})
    @SuppressAutoDoc
    public boolean isCredentialSharedWithParent() {
    public boolean isCredentialSharableWithParent() {
        try {
            return mService.isCredentialSharedWithParent(mUserId);
            return mService.isCredentialSharableWithParent(mUserId);
        } catch (RemoteException re) {
            throw re.rethrowFromSystemServer();
        }
+4 −6
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ import android.content.pm.PackageManager;
import android.content.pm.UserInfo;
import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
@@ -47,7 +46,6 @@ import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.storage.IStorageManager;
import android.os.storage.StorageManager;
import android.provider.Settings;
import android.text.TextUtils;
@@ -794,7 +792,7 @@ public class LockPatternUtils {
     */
    public void setSeparateProfileChallengeEnabled(int userHandle, boolean enabled,
            LockscreenCredential profilePassword) {
        if (!isCredentialSharedWithParent(userHandle)) {
        if (!isCredentialSharableWithParent(userHandle)) {
            return;
        }
        try {
@@ -810,7 +808,7 @@ public class LockPatternUtils {
     * Returns true if {@code userHandle} is a managed profile with separate challenge.
     */
    public boolean isSeparateProfileChallengeEnabled(int userHandle) {
        return isCredentialSharedWithParent(userHandle) && hasSeparateChallenge(userHandle);
        return isCredentialSharableWithParent(userHandle) && hasSeparateChallenge(userHandle);
    }

    /**
@@ -835,8 +833,8 @@ public class LockPatternUtils {
        return info != null && info.isManagedProfile();
    }

    private boolean isCredentialSharedWithParent(int userHandle) {
        return getUserManager(userHandle).isCredentialSharedWithParent();
    private boolean isCredentialSharableWithParent(int userHandle) {
        return getUserManager(userHandle).isCredentialSharableWithParent();
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -2613,7 +2613,7 @@ class UserController implements Handler.Callback {
        if (getStartedUserState(userId) == null) {
            return false;
        }
        if (!mInjector.getUserManager().isCredentialSharedWithParent(userId)) {
        if (!mInjector.getUserManager().isCredentialSharableWithParent(userId)) {
            return false;
        }
        if (mLockPatternUtils.isSeparateProfileChallengeEnabled(userId)) {
Loading