Merge "[Bouncer] Do not send message if face auth..." into tm-qpr-dev
This commit is contained in:
@@ -103,6 +103,7 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset() {
|
public void reset() {
|
||||||
|
super.reset();
|
||||||
// start fresh
|
// start fresh
|
||||||
mDismissing = false;
|
mDismissing = false;
|
||||||
mView.resetPasswordText(false /* animate */, false /* announce */);
|
mView.resetPasswordText(false /* animate */, false /* announce */);
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ public abstract class KeyguardInputViewController<T extends KeyguardInputView>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset() {
|
public void reset() {
|
||||||
|
mMessageAreaController.setMessage("", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -104,14 +104,6 @@ object KeyguardBouncerViewBinder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
launch {
|
|
||||||
viewModel.showWithFullExpansion.collect { model ->
|
|
||||||
hostViewController.resetSecurityContainer()
|
|
||||||
hostViewController.showPromptReason(model.promptReason)
|
|
||||||
hostViewController.onResume()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
launch {
|
launch {
|
||||||
viewModel.hide.collect {
|
viewModel.hide.collect {
|
||||||
hostViewController.cancelDismissAction()
|
hostViewController.cancelDismissAction()
|
||||||
|
|||||||
@@ -22,10 +22,8 @@ import com.android.systemui.keyguard.data.BouncerViewDelegate
|
|||||||
import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor
|
import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor
|
||||||
import com.android.systemui.keyguard.shared.model.BouncerShowMessageModel
|
import com.android.systemui.keyguard.shared.model.BouncerShowMessageModel
|
||||||
import com.android.systemui.keyguard.shared.model.KeyguardBouncerModel
|
import com.android.systemui.keyguard.shared.model.KeyguardBouncerModel
|
||||||
import com.android.systemui.statusbar.phone.KeyguardBouncer.EXPANSION_VISIBLE
|
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.filter
|
|
||||||
import kotlinx.coroutines.flow.map
|
import kotlinx.coroutines.flow.map
|
||||||
|
|
||||||
/** Models UI state for the lock screen bouncer; handles user input. */
|
/** Models UI state for the lock screen bouncer; handles user input. */
|
||||||
@@ -44,10 +42,6 @@ constructor(
|
|||||||
/** Observe whether bouncer is showing. */
|
/** Observe whether bouncer is showing. */
|
||||||
val show: Flow<KeyguardBouncerModel> = interactor.show
|
val show: Flow<KeyguardBouncerModel> = interactor.show
|
||||||
|
|
||||||
/** Observe visible expansion when bouncer is showing. */
|
|
||||||
val showWithFullExpansion: Flow<KeyguardBouncerModel> =
|
|
||||||
interactor.show.filter { it.expansionAmount == EXPANSION_VISIBLE }
|
|
||||||
|
|
||||||
/** Observe whether bouncer is hiding. */
|
/** Observe whether bouncer is hiding. */
|
||||||
val hide: Flow<Unit> = interactor.hide
|
val hide: Flow<Unit> = interactor.hide
|
||||||
|
|
||||||
|
|||||||
@@ -930,7 +930,8 @@ public class KeyguardIndicationController {
|
|||||||
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
|
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
|
||||||
if (mStatusBarKeyguardViewManager.isShowingAlternateBouncer()) {
|
if (mStatusBarKeyguardViewManager.isShowingAlternateBouncer()) {
|
||||||
return; // udfps affordance is highlighted, no need to show action to unlock
|
return; // udfps affordance is highlighted, no need to show action to unlock
|
||||||
} else if (mKeyguardUpdateMonitor.isFaceEnrolled()) {
|
} else if (!mKeyguardUpdateMonitor.getIsFaceAuthenticated()
|
||||||
|
&& mKeyguardUpdateMonitor.isFaceEnrolled()) {
|
||||||
String message = mContext.getString(R.string.keyguard_retry);
|
String message = mContext.getString(R.string.keyguard_retry);
|
||||||
mStatusBarKeyguardViewManager.setKeyguardMessage(message, mInitialTextColorState);
|
mStatusBarKeyguardViewManager.setKeyguardMessage(message, mInitialTextColorState);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,4 +150,10 @@ public class KeyguardAbsKeyInputViewControllerTest extends SysuiTestCase {
|
|||||||
getContext().getResources().getString(R.string.kg_prompt_reason_restart_password),
|
getContext().getResources().getString(R.string.kg_prompt_reason_restart_password),
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testReset() {
|
||||||
|
mKeyguardAbsKeyInputViewController.reset();
|
||||||
|
verify(mKeyguardMessageAreaController).setMessage("", false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -660,6 +660,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
createController();
|
createController();
|
||||||
String message = mContext.getString(R.string.keyguard_retry);
|
String message = mContext.getString(R.string.keyguard_retry);
|
||||||
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(true);
|
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(true);
|
||||||
|
when(mKeyguardUpdateMonitor.getIsFaceAuthenticated()).thenReturn(false);
|
||||||
when(mKeyguardUpdateMonitor.isFaceEnrolled()).thenReturn(true);
|
when(mKeyguardUpdateMonitor.isFaceEnrolled()).thenReturn(true);
|
||||||
|
|
||||||
mController.setVisible(true);
|
mController.setVisible(true);
|
||||||
@@ -669,6 +670,21 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
verify(mStatusBarKeyguardViewManager).setKeyguardMessage(eq(message), any());
|
verify(mStatusBarKeyguardViewManager).setKeyguardMessage(eq(message), any());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void transientIndication_swipeUpToRetry_faceAuthenticated() {
|
||||||
|
createController();
|
||||||
|
String message = mContext.getString(R.string.keyguard_retry);
|
||||||
|
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(true);
|
||||||
|
when(mKeyguardUpdateMonitor.getIsFaceAuthenticated()).thenReturn(true);
|
||||||
|
when(mKeyguardUpdateMonitor.isFaceEnrolled()).thenReturn(true);
|
||||||
|
|
||||||
|
mController.setVisible(true);
|
||||||
|
mController.getKeyguardCallback().onBiometricError(FACE_ERROR_TIMEOUT,
|
||||||
|
"A message", BiometricSourceType.FACE);
|
||||||
|
|
||||||
|
verify(mStatusBarKeyguardViewManager, never()).setKeyguardMessage(eq(message), any());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void faceErrorTimeout_whenFingerprintEnrolled_doesNotShowMessage() {
|
public void faceErrorTimeout_whenFingerprintEnrolled_doesNotShowMessage() {
|
||||||
createController();
|
createController();
|
||||||
|
|||||||
Reference in New Issue
Block a user