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

Commit 20a4eeea authored by Eric Biggers's avatar Eric Biggers Committed by Android (Google) Code Review
Browse files

Merge "locksettings: reduce visibility where unnecessarily broad"

parents 1e30fbc0 594d5abc
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -375,7 +375,7 @@ public class LockSettingsService extends ILockSettings.Stub {
     * @param profileUserId  profile user Id
     * @param profileUserPassword  profile original password (when it has separated lock).
     */
    public void tieProfileLockIfNecessary(int profileUserId,
    private void tieProfileLockIfNecessary(int profileUserId,
            LockscreenCredential profileUserPassword) {
        if (DEBUG) Slog.v(TAG, "Check child profile lock for user: " + profileUserId);
        // Only for profiles that shares credential with parent
@@ -713,7 +713,8 @@ public class LockSettingsService extends ILockSettings.Stub {
            userHandle);
    }

    public void onCleanupUser(int userId) {
    @VisibleForTesting
    void onCleanupUser(int userId) {
        hideEncryptionNotification(new UserHandle(userId));
        // User is stopped with its CE key evicted. Restore strong auth requirement to the default
        // flags after boot since stopping and restarting a user later is equivalent to rebooting
@@ -725,7 +726,7 @@ public class LockSettingsService extends ILockSettings.Stub {
        }
    }

    public void onStartUser(final int userId) {
    private void onStartUser(final int userId) {
        maybeShowEncryptionNotificationForUser(userId, "user started");
    }

@@ -779,7 +780,7 @@ public class LockSettingsService extends ILockSettings.Stub {
        }
    }

    public void onUnlockUser(final int userId) {
    private void onUnlockUser(final int userId) {
        // Perform tasks which require locks in LSS on a handler, as we are callbacks from
        // ActivityManager.unlockUser()
        mHandler.post(new Runnable() {
@@ -1222,7 +1223,7 @@ public class LockSettingsService extends ILockSettings.Stub {
     * {@link #CREDENTIAL_TYPE_PATTERN}, {@link #CREDENTIAL_TYPE_PIN} and
     * {@link #CREDENTIAL_TYPE_PASSWORD}
     */
    public int getCredentialTypeInternal(int userId) {
    private int getCredentialTypeInternal(int userId) {
        if (userId == USER_FRP) {
            return getFrpCredentialType();
        }
@@ -1802,6 +1803,7 @@ public class LockSettingsService extends ILockSettings.Stub {
        }
    }

    @VisibleForTesting /** Note: this method is overridden in unit tests */
    protected boolean isCredentialSharableWithParent(int userId) {
        return getUserManagerFromCache(userId).isCredentialSharableWithParent();
    }
@@ -2560,7 +2562,7 @@ public class LockSettingsService extends ILockSettings.Stub {
        }
    }

    protected synchronized IGateKeeperService getGateKeeperService() {
    private synchronized IGateKeeperService getGateKeeperService() {
        if (mGateKeeperService != null) {
            return mGateKeeperService;
        }
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import com.android.internal.widget.LockPatternUtils.StrongAuthTracker;
/**
 * Keeps track of requests for strong authentication.
 */
@VisibleForTesting // public visibility is needed for Mockito
public class LockSettingsStrongAuth {

    private static final String TAG = "LockSettings";
+2 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.security.keystore.UserNotAuthenticatedException;
import android.util.Slog;
import android.util.SparseArray;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
import com.android.internal.widget.LockscreenCredential;

@@ -60,6 +61,7 @@ import javax.crypto.spec.GCMParameterSpec;
 * <p> The encrypted credential is stored in-memory only so the cache does not persist across
 * reboots.
 */
@VisibleForTesting // public visibility is needed for Mockito
public class ManagedProfilePasswordCache {

    private static final String TAG = "ManagedProfilePasswordCache";
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ import java.util.Set;
 * If a /metadata partition does not exist, GSIs are not supported, and PasswordSlotManager will
 * simply not persist the slot mapping.
 */
public class PasswordSlotManager {
class PasswordSlotManager {
    private static final String TAG = "PasswordSlotManager";

    private static final String GSI_RUNNING_PROP = "ro.gsid.image_running";
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ import javax.crypto.SecretKey;
import javax.crypto.spec.GCMParameterSpec;
import javax.crypto.spec.SecretKeySpec;

public class SyntheticPasswordCrypto {
class SyntheticPasswordCrypto {
    private static final String TAG = "SyntheticPasswordCrypto";
    private static final int AES_GCM_KEY_SIZE = 32; // AES-256-GCM
    private static final int AES_GCM_IV_SIZE = 12;
Loading