Merge cherrypicks of [20122571, 20130738] into tm-qpr1-release.
Change-Id: I4708b83cd24fe2d12749af66a31bdf8777d753d3
This commit is contained in:
@@ -1522,8 +1522,7 @@ public class LockPatternUtils {
|
||||
STRONG_AUTH_REQUIRED_AFTER_LOCKOUT,
|
||||
STRONG_AUTH_REQUIRED_AFTER_TIMEOUT,
|
||||
STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN,
|
||||
STRONG_AUTH_REQUIRED_AFTER_NON_STRONG_BIOMETRICS_TIMEOUT,
|
||||
SOME_AUTH_REQUIRED_AFTER_TRUSTAGENT_EXPIRED})
|
||||
STRONG_AUTH_REQUIRED_AFTER_NON_STRONG_BIOMETRICS_TIMEOUT})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface StrongAuthFlags {}
|
||||
|
||||
@@ -1575,12 +1574,6 @@ public class LockPatternUtils {
|
||||
*/
|
||||
public static final int STRONG_AUTH_REQUIRED_AFTER_NON_STRONG_BIOMETRICS_TIMEOUT = 0x80;
|
||||
|
||||
/**
|
||||
* Some authentication is required because the trustagent either timed out or was disabled
|
||||
* manually.
|
||||
*/
|
||||
public static final int SOME_AUTH_REQUIRED_AFTER_TRUSTAGENT_EXPIRED = 0x100;
|
||||
|
||||
/**
|
||||
* Strong auth flags that do not prevent biometric methods from being accepted as auth.
|
||||
* If any other flags are set, biometric authentication is disabled.
|
||||
|
||||
@@ -24,7 +24,6 @@ import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_NON_STRONG
|
||||
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_PREPARE_FOR_UPDATE;
|
||||
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_RESTART;
|
||||
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TIMEOUT;
|
||||
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TRUSTAGENT_EXPIRED;
|
||||
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_USER_REQUEST;
|
||||
|
||||
import android.animation.Animator;
|
||||
@@ -107,8 +106,6 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView {
|
||||
return R.string.kg_prompt_reason_timeout_password;
|
||||
case PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT:
|
||||
return R.string.kg_prompt_reason_timeout_password;
|
||||
case PROMPT_REASON_TRUSTAGENT_EXPIRED:
|
||||
return R.string.kg_prompt_reason_timeout_password;
|
||||
case PROMPT_REASON_NONE:
|
||||
return 0;
|
||||
default:
|
||||
|
||||
@@ -330,9 +330,6 @@ public class KeyguardPatternViewController
|
||||
case PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT:
|
||||
mMessageAreaController.setMessage(R.string.kg_prompt_reason_timeout_pattern);
|
||||
break;
|
||||
case PROMPT_REASON_TRUSTAGENT_EXPIRED:
|
||||
mMessageAreaController.setMessage(R.string.kg_prompt_reason_timeout_pattern);
|
||||
break;
|
||||
case PROMPT_REASON_NONE:
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -22,7 +22,6 @@ import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_NON_STRONG
|
||||
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_PREPARE_FOR_UPDATE;
|
||||
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_RESTART;
|
||||
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TIMEOUT;
|
||||
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TRUSTAGENT_EXPIRED;
|
||||
import static com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_USER_REQUEST;
|
||||
|
||||
import android.animation.Animator;
|
||||
@@ -124,8 +123,6 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView
|
||||
return R.string.kg_prompt_reason_timeout_pin;
|
||||
case PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT:
|
||||
return R.string.kg_prompt_reason_timeout_pin;
|
||||
case PROMPT_REASON_TRUSTAGENT_EXPIRED:
|
||||
return R.string.kg_prompt_reason_timeout_pin;
|
||||
case PROMPT_REASON_NONE:
|
||||
return 0;
|
||||
default:
|
||||
|
||||
@@ -60,12 +60,6 @@ public interface KeyguardSecurityView {
|
||||
*/
|
||||
int PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT = 7;
|
||||
|
||||
/**
|
||||
* Some auth is required because the trustagent expired either from timeout or manually by
|
||||
* the user
|
||||
*/
|
||||
int PROMPT_REASON_TRUSTAGENT_EXPIRED = 8;
|
||||
|
||||
/**
|
||||
* Reset the view and prepare to take input. This should do things like clearing the
|
||||
* password or pattern and clear error messages.
|
||||
|
||||
@@ -25,7 +25,6 @@ import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.NAV_BA
|
||||
import static com.android.internal.jank.InteractionJankMonitor.CUJ_LOCKSCREEN_OCCLUSION;
|
||||
import static com.android.internal.jank.InteractionJankMonitor.CUJ_LOCKSCREEN_TRANSITION_FROM_AOD;
|
||||
import static com.android.internal.jank.InteractionJankMonitor.CUJ_LOCKSCREEN_UNLOCK_ANIMATION;
|
||||
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.SOME_AUTH_REQUIRED_AFTER_TRUSTAGENT_EXPIRED;
|
||||
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.SOME_AUTH_REQUIRED_AFTER_USER_REQUEST;
|
||||
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW;
|
||||
import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT;
|
||||
@@ -804,9 +803,6 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
|
||||
} else if (trustAgentsEnabled
|
||||
&& (strongAuth & SOME_AUTH_REQUIRED_AFTER_USER_REQUEST) != 0) {
|
||||
return KeyguardSecurityView.PROMPT_REASON_USER_REQUEST;
|
||||
} else if (trustAgentsEnabled
|
||||
&& (strongAuth & SOME_AUTH_REQUIRED_AFTER_TRUSTAGENT_EXPIRED) != 0) {
|
||||
return KeyguardSecurityView.PROMPT_REASON_TRUSTAGENT_EXPIRED;
|
||||
} else if (any && ((strongAuth & STRONG_AUTH_REQUIRED_AFTER_LOCKOUT) != 0
|
||||
|| mUpdateMonitor.isFingerprintLockedOut())) {
|
||||
return KeyguardSecurityView.PROMPT_REASON_AFTER_LOCKOUT;
|
||||
|
||||
@@ -733,11 +733,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
if (dozing || mBouncer.needsFullscreenBouncer() || mOccluded) {
|
||||
reset(dozing /* hideBouncerWhenShowing */);
|
||||
}
|
||||
|
||||
if (bouncerIsOrWillBeShowing()) {
|
||||
// Ensure bouncer is not shown when dozing state changes.
|
||||
hideBouncer(false);
|
||||
}
|
||||
updateStates();
|
||||
|
||||
if (!dozing) {
|
||||
|
||||
@@ -23,11 +23,9 @@ import static org.mockito.ArgumentMatchers.anyFloat;
|
||||
import static org.mockito.ArgumentMatchers.anyInt;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.clearInvocations;
|
||||
import static org.mockito.Mockito.doAnswer;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.reset;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@@ -527,26 +525,4 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
|
||||
mBouncerExpansionCallback.onVisibilityChanged(false);
|
||||
verify(mCentralSurfaces).setBouncerShowingOverDream(false);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testSetDozing_bouncerShowing_Dozing() {
|
||||
clearInvocations(mBouncer);
|
||||
when(mBouncer.isShowing()).thenReturn(true);
|
||||
doAnswer(invocation -> {
|
||||
when(mBouncer.isShowing()).thenReturn(false);
|
||||
return null;
|
||||
}).when(mBouncer).hide(false);
|
||||
mStatusBarKeyguardViewManager.onDozingChanged(true);
|
||||
verify(mBouncer, times(1)).hide(false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetDozing_bouncerShowing_notDozing() {
|
||||
mStatusBarKeyguardViewManager.onDozingChanged(true);
|
||||
when(mBouncer.isShowing()).thenReturn(true);
|
||||
clearInvocations(mBouncer);
|
||||
mStatusBarKeyguardViewManager.onDozingChanged(false);
|
||||
verify(mBouncer, times(1)).hide(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -687,7 +687,7 @@ public class TrustManagerService extends SystemService {
|
||||
*/
|
||||
public void lockUser(int userId) {
|
||||
mLockPatternUtils.requireStrongAuth(
|
||||
StrongAuthTracker.SOME_AUTH_REQUIRED_AFTER_TRUSTAGENT_EXPIRED, userId);
|
||||
StrongAuthTracker.SOME_AUTH_REQUIRED_AFTER_USER_REQUEST, userId);
|
||||
try {
|
||||
WindowManagerGlobal.getWindowManagerService().lockNow(null);
|
||||
} catch (RemoteException e) {
|
||||
@@ -2084,7 +2084,7 @@ public class TrustManagerService extends SystemService {
|
||||
if (mStrongAuthTracker.isTrustAllowedForUser(mUserId)) {
|
||||
if (DEBUG) Slog.d(TAG, "Revoking all trust because of trust timeout");
|
||||
mLockPatternUtils.requireStrongAuth(
|
||||
mStrongAuthTracker.SOME_AUTH_REQUIRED_AFTER_TRUSTAGENT_EXPIRED, mUserId);
|
||||
mStrongAuthTracker.SOME_AUTH_REQUIRED_AFTER_USER_REQUEST, mUserId);
|
||||
}
|
||||
maybeLockScreen(mUserId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user