Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthBiometricView.java +9 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.hardware.biometrics.BiometricPrompt; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.UserManager; import android.text.TextUtils; import android.util.AttributeSet; import android.util.Log; Loading Loading @@ -162,6 +163,7 @@ public abstract class AuthBiometricView extends LinearLayout { private Bundle mBiometricPromptBundle; private boolean mRequireConfirmation; private int mUserId; private int mEffectiveUserId; @AuthDialog.DialogSize int mSize = AuthDialog.SIZE_UNKNOWN; private TextView mTitleView; Loading Loading @@ -280,6 +282,10 @@ public abstract class AuthBiometricView extends LinearLayout { mUserId = userId; } public void setEffectiveUserId(int effectiveUserId) { mEffectiveUserId = effectiveUserId; } public void setRequireConfirmation(boolean requireConfirmation) { mRequireConfirmation = requireConfirmation; } Loading Loading @@ -650,7 +656,8 @@ public abstract class AuthBiometricView extends LinearLayout { if (isDeviceCredentialAllowed()) { final @Utils.CredentialType int credentialType = Utils.getCredentialType(mContext, mUserId); Utils.getCredentialType(mContext, mEffectiveUserId); switch (credentialType) { case Utils.CREDENTIAL_PIN: negativeText = getResources().getString(R.string.biometric_dialog_use_pin); Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +20 −3 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.UserManager; import android.util.Log; import android.view.KeyEvent; import android.view.LayoutInflater; Loading Loading @@ -75,6 +76,7 @@ public class AuthContainerView extends LinearLayout @interface ContainerState {} final Config mConfig; final int mEffectiveUserId; private final Handler mHandler; private final Injector mInjector; private final IBinder mWindowToken = new Binder(); Loading Loading @@ -182,6 +184,14 @@ public class AuthContainerView extends LinearLayout int getAnimateCredentialStartDelayMs() { return AuthDialog.ANIMATE_CREDENTIAL_START_DELAY_MS; } UserManager getUserManager(Context context) { return UserManager.get(context); } int getCredentialType(Context context, int effectiveUserId) { return Utils.getCredentialType(context, effectiveUserId); } } @VisibleForTesting Loading Loading @@ -230,6 +240,9 @@ public class AuthContainerView extends LinearLayout mConfig = config; mInjector = injector; mEffectiveUserId = mInjector.getUserManager(mContext) .getCredentialOwnerProfile(mConfig.mUserId); mHandler = new Handler(Looper.getMainLooper()); mWindowManager = mContext.getSystemService(WindowManager.class); mWakefulnessLifecycle = Dependency.get(WakefulnessLifecycle.class); Loading Loading @@ -268,7 +281,6 @@ public class AuthContainerView extends LinearLayout mBiometricScrollView = mInjector.getBiometricScrollView(mFrameLayout); mBackgroundView = mInjector.getBackgroundView(mFrameLayout); if (isManagedProfile) { final Drawable image = getResources().getDrawable(R.drawable.work_challenge_background, mContext.getTheme()); Loading Loading @@ -307,6 +319,7 @@ public class AuthContainerView extends LinearLayout mBiometricView.setCallback(mBiometricCallback); mBiometricView.setBackgroundView(mBackgroundView); mBiometricView.setUserId(mConfig.mUserId); mBiometricView.setEffectiveUserId(mEffectiveUserId); mBiometricScrollView.addView(mBiometricView); } Loading @@ -318,7 +331,10 @@ public class AuthContainerView extends LinearLayout */ private void addCredentialView(boolean animatePanel, boolean animateContents) { final LayoutInflater factory = LayoutInflater.from(mContext); final int credentialType = Utils.getCredentialType(mContext, mConfig.mUserId); final @Utils.CredentialType int credentialType = mInjector.getCredentialType( mContext, mEffectiveUserId); switch (credentialType) { case Utils.CREDENTIAL_PATTERN: mCredentialView = (AuthCredentialView) factory.inflate( Loading @@ -334,7 +350,8 @@ public class AuthContainerView extends LinearLayout } mCredentialView.setContainerView(this); mCredentialView.setUser(mConfig.mUserId); mCredentialView.setEffectiveUserId(mEffectiveUserId); mCredentialView.setCredentialType(credentialType); mCredentialView.setCallback(mCredentialCallback); mCredentialView.setBiometricPromptBundle(mConfig.mBiometricPromptBundle); mCredentialView.setPanelController(mPanelController, animatePanel); Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthCredentialPasswordView.java +2 −2 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ public class AuthCredentialPasswordView extends AuthCredentialView } mPendingLockCheck = LockPatternChecker.checkCredential(mLockPatternUtils, password, mUserId, this::onCredentialChecked); password, mEffectiveUserId, this::onCredentialChecked); } } Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthCredentialPatternView.java +3 −2 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ public class AuthCredentialPatternView extends AuthCredentialView { mPendingLockCheck = LockPatternChecker.checkCredential( mLockPatternUtils, credential, mUserId, mEffectiveUserId, this::onPatternChecked); } } Loading Loading @@ -99,7 +99,8 @@ public class AuthCredentialPatternView extends AuthCredentialView { super.onFinishInflate(); mLockPatternView = findViewById(R.id.lockPattern); mLockPatternView.setOnPatternListener(new UnlockPatternListener()); mLockPatternView.setInStealthMode(!mLockPatternUtils.isVisiblePatternEnabled(mUserId)); mLockPatternView.setInStealthMode( !mLockPatternUtils.isVisiblePatternEnabled(mEffectiveUserId)); mLockPatternView.setTactileFeedbackEnabled(mLockPatternUtils.isTactileFeedbackEnabled()); } } packages/SystemUI/src/com/android/systemui/biometrics/AuthCredentialView.java +9 −6 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ public abstract class AuthCredentialView extends LinearLayout { protected AuthContainerView mContainerView; protected Callback mCallback; protected AsyncTask<?, ?, ?> mPendingLockCheck; protected int mUserId; protected int mEffectiveUserId; protected ErrorTimer mErrorTimer; interface Callback { Loading Loading @@ -137,8 +137,12 @@ public abstract class AuthCredentialView extends LinearLayout { view.setText(string); } void setUser(int user) { mUserId = user; void setEffectiveUserId(int effectiveUserId) { mEffectiveUserId = effectiveUserId; } void setCredentialType(@Utils.CredentialType int credentialType) { mCredentialType = credentialType; } void setCallback(Callback callback) { Loading Loading @@ -166,8 +170,6 @@ public abstract class AuthCredentialView extends LinearLayout { protected void onAttachedToWindow() { super.onAttachedToWindow(); mCredentialType = Utils.getCredentialType(mContext, mUserId); setText(mTitleView, mBiometricPromptBundle.getString(BiometricPrompt.KEY_TITLE)); setTextOrHide(mSubtitleView, mBiometricPromptBundle.getString(BiometricPrompt.KEY_SUBTITLE)); Loading Loading @@ -230,7 +232,8 @@ public abstract class AuthCredentialView extends LinearLayout { } else { if (timeoutMs > 0) { mHandler.removeCallbacks(mClearErrorRunnable); long deadline = mLockPatternUtils.setLockoutAttemptDeadline(mUserId, timeoutMs); long deadline = mLockPatternUtils.setLockoutAttemptDeadline( mEffectiveUserId, timeoutMs); mErrorTimer = new ErrorTimer(mContext, deadline - SystemClock.elapsedRealtime(), LockPatternUtils.FAILED_ATTEMPT_COUNTDOWN_INTERVAL_MS, Loading Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthBiometricView.java +9 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.hardware.biometrics.BiometricPrompt; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.UserManager; import android.text.TextUtils; import android.util.AttributeSet; import android.util.Log; Loading Loading @@ -162,6 +163,7 @@ public abstract class AuthBiometricView extends LinearLayout { private Bundle mBiometricPromptBundle; private boolean mRequireConfirmation; private int mUserId; private int mEffectiveUserId; @AuthDialog.DialogSize int mSize = AuthDialog.SIZE_UNKNOWN; private TextView mTitleView; Loading Loading @@ -280,6 +282,10 @@ public abstract class AuthBiometricView extends LinearLayout { mUserId = userId; } public void setEffectiveUserId(int effectiveUserId) { mEffectiveUserId = effectiveUserId; } public void setRequireConfirmation(boolean requireConfirmation) { mRequireConfirmation = requireConfirmation; } Loading Loading @@ -650,7 +656,8 @@ public abstract class AuthBiometricView extends LinearLayout { if (isDeviceCredentialAllowed()) { final @Utils.CredentialType int credentialType = Utils.getCredentialType(mContext, mUserId); Utils.getCredentialType(mContext, mEffectiveUserId); switch (credentialType) { case Utils.CREDENTIAL_PIN: negativeText = getResources().getString(R.string.biometric_dialog_use_pin); Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +20 −3 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.UserManager; import android.util.Log; import android.view.KeyEvent; import android.view.LayoutInflater; Loading Loading @@ -75,6 +76,7 @@ public class AuthContainerView extends LinearLayout @interface ContainerState {} final Config mConfig; final int mEffectiveUserId; private final Handler mHandler; private final Injector mInjector; private final IBinder mWindowToken = new Binder(); Loading Loading @@ -182,6 +184,14 @@ public class AuthContainerView extends LinearLayout int getAnimateCredentialStartDelayMs() { return AuthDialog.ANIMATE_CREDENTIAL_START_DELAY_MS; } UserManager getUserManager(Context context) { return UserManager.get(context); } int getCredentialType(Context context, int effectiveUserId) { return Utils.getCredentialType(context, effectiveUserId); } } @VisibleForTesting Loading Loading @@ -230,6 +240,9 @@ public class AuthContainerView extends LinearLayout mConfig = config; mInjector = injector; mEffectiveUserId = mInjector.getUserManager(mContext) .getCredentialOwnerProfile(mConfig.mUserId); mHandler = new Handler(Looper.getMainLooper()); mWindowManager = mContext.getSystemService(WindowManager.class); mWakefulnessLifecycle = Dependency.get(WakefulnessLifecycle.class); Loading Loading @@ -268,7 +281,6 @@ public class AuthContainerView extends LinearLayout mBiometricScrollView = mInjector.getBiometricScrollView(mFrameLayout); mBackgroundView = mInjector.getBackgroundView(mFrameLayout); if (isManagedProfile) { final Drawable image = getResources().getDrawable(R.drawable.work_challenge_background, mContext.getTheme()); Loading Loading @@ -307,6 +319,7 @@ public class AuthContainerView extends LinearLayout mBiometricView.setCallback(mBiometricCallback); mBiometricView.setBackgroundView(mBackgroundView); mBiometricView.setUserId(mConfig.mUserId); mBiometricView.setEffectiveUserId(mEffectiveUserId); mBiometricScrollView.addView(mBiometricView); } Loading @@ -318,7 +331,10 @@ public class AuthContainerView extends LinearLayout */ private void addCredentialView(boolean animatePanel, boolean animateContents) { final LayoutInflater factory = LayoutInflater.from(mContext); final int credentialType = Utils.getCredentialType(mContext, mConfig.mUserId); final @Utils.CredentialType int credentialType = mInjector.getCredentialType( mContext, mEffectiveUserId); switch (credentialType) { case Utils.CREDENTIAL_PATTERN: mCredentialView = (AuthCredentialView) factory.inflate( Loading @@ -334,7 +350,8 @@ public class AuthContainerView extends LinearLayout } mCredentialView.setContainerView(this); mCredentialView.setUser(mConfig.mUserId); mCredentialView.setEffectiveUserId(mEffectiveUserId); mCredentialView.setCredentialType(credentialType); mCredentialView.setCallback(mCredentialCallback); mCredentialView.setBiometricPromptBundle(mConfig.mBiometricPromptBundle); mCredentialView.setPanelController(mPanelController, animatePanel); Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthCredentialPasswordView.java +2 −2 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ public class AuthCredentialPasswordView extends AuthCredentialView } mPendingLockCheck = LockPatternChecker.checkCredential(mLockPatternUtils, password, mUserId, this::onCredentialChecked); password, mEffectiveUserId, this::onCredentialChecked); } } Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthCredentialPatternView.java +3 −2 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ public class AuthCredentialPatternView extends AuthCredentialView { mPendingLockCheck = LockPatternChecker.checkCredential( mLockPatternUtils, credential, mUserId, mEffectiveUserId, this::onPatternChecked); } } Loading Loading @@ -99,7 +99,8 @@ public class AuthCredentialPatternView extends AuthCredentialView { super.onFinishInflate(); mLockPatternView = findViewById(R.id.lockPattern); mLockPatternView.setOnPatternListener(new UnlockPatternListener()); mLockPatternView.setInStealthMode(!mLockPatternUtils.isVisiblePatternEnabled(mUserId)); mLockPatternView.setInStealthMode( !mLockPatternUtils.isVisiblePatternEnabled(mEffectiveUserId)); mLockPatternView.setTactileFeedbackEnabled(mLockPatternUtils.isTactileFeedbackEnabled()); } }
packages/SystemUI/src/com/android/systemui/biometrics/AuthCredentialView.java +9 −6 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ public abstract class AuthCredentialView extends LinearLayout { protected AuthContainerView mContainerView; protected Callback mCallback; protected AsyncTask<?, ?, ?> mPendingLockCheck; protected int mUserId; protected int mEffectiveUserId; protected ErrorTimer mErrorTimer; interface Callback { Loading Loading @@ -137,8 +137,12 @@ public abstract class AuthCredentialView extends LinearLayout { view.setText(string); } void setUser(int user) { mUserId = user; void setEffectiveUserId(int effectiveUserId) { mEffectiveUserId = effectiveUserId; } void setCredentialType(@Utils.CredentialType int credentialType) { mCredentialType = credentialType; } void setCallback(Callback callback) { Loading Loading @@ -166,8 +170,6 @@ public abstract class AuthCredentialView extends LinearLayout { protected void onAttachedToWindow() { super.onAttachedToWindow(); mCredentialType = Utils.getCredentialType(mContext, mUserId); setText(mTitleView, mBiometricPromptBundle.getString(BiometricPrompt.KEY_TITLE)); setTextOrHide(mSubtitleView, mBiometricPromptBundle.getString(BiometricPrompt.KEY_SUBTITLE)); Loading Loading @@ -230,7 +232,8 @@ public abstract class AuthCredentialView extends LinearLayout { } else { if (timeoutMs > 0) { mHandler.removeCallbacks(mClearErrorRunnable); long deadline = mLockPatternUtils.setLockoutAttemptDeadline(mUserId, timeoutMs); long deadline = mLockPatternUtils.setLockoutAttemptDeadline( mEffectiveUserId, timeoutMs); mErrorTimer = new ErrorTimer(mContext, deadline - SystemClock.elapsedRealtime(), LockPatternUtils.FAILED_ATTEMPT_COUNTDOWN_INTERVAL_MS, Loading