Remove unused primaryAuth/strongAuth parameter
Bug: 268240415
Test: atest KeyguardSecurityContainerControllerTest KeyguardViewMediatorTest
Change-Id: Ibdb2dc3b08987f2397b15a9b85b4da15b2125e99
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityCallback.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityCallback.java
index 2878df2..38a8cd3 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityCallback.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityCallback.java
@@ -96,7 +96,7 @@
/**
* Dismisses keyguard and go to unlocked state.
*/
- default void finish(boolean strongAuth, int targetUserId) {
+ default void finish(int targetUserId) {
}
/**
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
index 9f3908a..d90785d 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
@@ -290,13 +290,11 @@
* Authentication has happened and it's time to dismiss keyguard. This function
* should clean up and inform KeyguardViewMediator.
*
- * @param fromPrimaryAuth whether the user has authenticated with primary auth like
- * pattern, password or PIN but not by trust agents or fingerprint
* @param targetUserId a user that needs to be the foreground user at the dismissal
* completion.
*/
@Override
- public void finish(boolean fromPrimaryAuth, int targetUserId) {
+ public void finish(int targetUserId) {
// If there's a pending runnable because the user interacted with a widget
// and we're leaving keyguard, then run it.
boolean deferKeyguardDone = false;
@@ -309,9 +307,9 @@
}
if (mViewMediatorCallback != null) {
if (deferKeyguardDone) {
- mViewMediatorCallback.keyguardDonePending(fromPrimaryAuth, targetUserId);
+ mViewMediatorCallback.keyguardDonePending(targetUserId);
} else {
- mViewMediatorCallback.keyguardDone(fromPrimaryAuth, targetUserId);
+ mViewMediatorCallback.keyguardDone(targetUserId);
}
}
@@ -690,8 +688,8 @@
/**
* Dismiss keyguard due to a user unlock event.
*/
- public void finish(boolean primaryAuth, int currentUser) {
- mKeyguardSecurityCallback.finish(primaryAuth, currentUser);
+ public void finish(int currentUser) {
+ mKeyguardSecurityCallback.finish(currentUser);
}
/**
@@ -902,7 +900,7 @@
mUiEventLogger.log(uiEvent, getSessionId());
}
if (finish) {
- mKeyguardSecurityCallback.finish(primaryAuth, targetUserId);
+ mKeyguardSecurityCallback.finish(targetUserId);
}
return finish;
}
diff --git a/packages/SystemUI/src/com/android/keyguard/ViewMediatorCallback.java b/packages/SystemUI/src/com/android/keyguard/ViewMediatorCallback.java
index 14ec27a..8d49f08d 100644
--- a/packages/SystemUI/src/com/android/keyguard/ViewMediatorCallback.java
+++ b/packages/SystemUI/src/com/android/keyguard/ViewMediatorCallback.java
@@ -29,11 +29,9 @@
/**
* Report that the keyguard is done.
*
- * @param primaryAuth whether the user has authenticated with primary authentication like
- * pattern, password or PIN but not by trust agents or fingerprint
* @param targetUserId a user that needs to be the foreground user at the completion.
*/
- void keyguardDone(boolean primaryAuth, int targetUserId);
+ void keyguardDone(int targetUserId);
/**
* Report that the keyguard is done drawing.
@@ -47,13 +45,11 @@
void setNeedsInput(boolean needsInput);
/**
- * Report that the keyguard is dismissable, pending the next keyguardDone call.
+ * Report that the keyguard is dismissible, pending the next keyguardDone call.
*
- * @param primaryAuth whether the user has authenticated with primary authentication like
- * pattern, password or PIN but not by trust agents or fingerprint
* @param targetUserId a user that needs to be the foreground user at the completion.
*/
- void keyguardDonePending(boolean primaryAuth, int targetUserId);
+ void keyguardDonePending(int targetUserId);
/**
* Report when keyguard is actually gone
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/KeyguardBouncerViewBinder.kt b/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/KeyguardBouncerViewBinder.kt
index 56f1cf6..e29d6bd 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/KeyguardBouncerViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/KeyguardBouncerViewBinder.kt
@@ -221,7 +221,6 @@
launch {
viewModel.keyguardAuthenticated.collect {
securityContainerController.finish(
- it,
KeyguardUpdateMonitor.getCurrentUser()
)
viewModel.notifyKeyguardAuthenticated()
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index fd15853..07c65a9 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -181,6 +181,7 @@
import java.util.function.Consumer;
import dagger.Lazy;
+
import kotlinx.coroutines.CoroutineDispatcher;
/**
@@ -775,7 +776,7 @@
}
@Override
- public void keyguardDone(boolean primaryAuth, int targetUserId) {
+ public void keyguardDone(int targetUserId) {
if (targetUserId != KeyguardUpdateMonitor.getCurrentUser()) {
return;
}
@@ -796,7 +797,7 @@
}
@Override
- public void keyguardDonePending(boolean primaryAuth, int targetUserId) {
+ public void keyguardDonePending(int targetUserId) {
Trace.beginSection("KeyguardViewMediator.mViewMediatorCallback#keyguardDonePending");
if (DEBUG) Log.d(TAG, "keyguardDonePending");
if (targetUserId != KeyguardUpdateMonitor.getCurrentUser()) {
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt
index dff058c..80172a1 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt
@@ -83,7 +83,6 @@
import org.junit.runner.RunWith
import org.mockito.ArgumentCaptor
import org.mockito.ArgumentMatcher
-import org.mockito.ArgumentMatchers.anyBoolean
import org.mockito.ArgumentMatchers.anyInt
import org.mockito.ArgumentMatchers.eq
import org.mockito.Captor
@@ -442,8 +441,8 @@
)
// THEN the next security method of PIN is set, and the keyguard is not marked as done
- verify(viewMediatorCallback, never()).keyguardDonePending(anyBoolean(), anyInt())
- verify(viewMediatorCallback, never()).keyguardDone(anyBoolean(), anyInt())
+ verify(viewMediatorCallback, never()).keyguardDonePending(anyInt())
+ verify(viewMediatorCallback, never()).keyguardDone(anyInt())
Truth.assertThat(underTest.currentSecurityMode).isEqualTo(SecurityMode.PIN)
}
@@ -467,7 +466,7 @@
)
// THEN the next security method of None will dismiss keyguard.
- verify(viewMediatorCallback).keyguardDone(anyBoolean(), anyInt())
+ verify(viewMediatorCallback).keyguardDone(anyInt())
}
@Test
@@ -510,7 +509,7 @@
)
// THEN the next security method of None will dismiss keyguard.
- verify(viewMediatorCallback, never()).keyguardDone(anyBoolean(), anyInt())
+ verify(viewMediatorCallback, never()).keyguardDone(anyInt())
}
@Test
fun showNextSecurityScreenOrFinish_SimPin_Swipe_userNotSetup() {
@@ -534,7 +533,7 @@
)
// THEN the next security method of None will dismiss keyguard.
- verify(viewMediatorCallback).keyguardDone(anyBoolean(), anyInt())
+ verify(viewMediatorCallback).keyguardDone(anyInt())
}
@Test
@@ -679,7 +678,7 @@
val action: OnDismissAction = mock()
whenever(action.willRunAnimationOnKeyguard()).thenReturn(true)
underTest.setOnDismissAction(action, null /* cancelAction */)
- underTest.finish(false /* strongAuth */, 0 /* currentUser */)
+ underTest.finish(0 /* currentUser */)
Truth.assertThat(underTest.willRunDismissFromKeyguard()).isTrue()
}
@@ -688,14 +687,14 @@
val action: OnDismissAction = mock()
whenever(action.willRunAnimationOnKeyguard()).thenReturn(false)
underTest.setOnDismissAction(action, null /* cancelAction */)
- underTest.finish(false /* strongAuth */, 0 /* currentUser */)
+ underTest.finish(0 /* currentUser */)
Truth.assertThat(underTest.willRunDismissFromKeyguard()).isFalse()
}
@Test
fun willRunDismissFromKeyguardIsFalseWhenNoDismissActionSet() {
underTest.setOnDismissAction(null /* action */, null /* cancelAction */)
- underTest.finish(false /* strongAuth */, 0 /* currentUser */)
+ underTest.finish(0 /* currentUser */)
Truth.assertThat(underTest.willRunDismissFromKeyguard()).isFalse()
}
@@ -806,7 +805,7 @@
// Upon init, we have never dismisses the keyguard.
underTest.onInit()
runCurrent()
- verify(viewMediatorCallback, never()).keyguardDone(anyBoolean(), anyInt())
+ verify(viewMediatorCallback, never()).keyguardDone(anyInt())
// Once the view is attached, we start listening but simply going to the bouncer scene
// is
@@ -823,7 +822,7 @@
sceneInteractor.onSceneChanged(SceneModel(SceneKey.Bouncer, null), "reason")
sceneTransitionStateFlow.value = ObservableTransitionState.Idle(SceneKey.Bouncer)
runCurrent()
- verify(viewMediatorCallback, never()).keyguardDone(anyBoolean(), anyInt())
+ verify(viewMediatorCallback, never()).keyguardDone(anyInt())
// While listening, going from the bouncer scene to the gone scene, does dismiss the
// keyguard.
@@ -834,7 +833,7 @@
sceneInteractor.onSceneChanged(SceneModel(SceneKey.Gone, null), "reason")
sceneTransitionStateFlow.value = ObservableTransitionState.Idle(SceneKey.Gone)
runCurrent()
- verify(viewMediatorCallback).keyguardDone(anyBoolean(), anyInt())
+ verify(viewMediatorCallback).keyguardDone(anyInt())
// While listening, moving back to the bouncer scene does not dismiss the keyguard
// again.
@@ -846,7 +845,7 @@
sceneInteractor.onSceneChanged(SceneModel(SceneKey.Bouncer, null), "reason")
sceneTransitionStateFlow.value = ObservableTransitionState.Idle(SceneKey.Bouncer)
runCurrent()
- verify(viewMediatorCallback, never()).keyguardDone(anyBoolean(), anyInt())
+ verify(viewMediatorCallback, never()).keyguardDone(anyInt())
// Detaching the view stops listening, so moving from the bouncer scene to the gone
// scene
@@ -859,7 +858,7 @@
sceneInteractor.onSceneChanged(SceneModel(SceneKey.Gone, null), "reason")
sceneTransitionStateFlow.value = ObservableTransitionState.Idle(SceneKey.Gone)
runCurrent()
- verify(viewMediatorCallback, never()).keyguardDone(anyBoolean(), anyInt())
+ verify(viewMediatorCallback, never()).keyguardDone(anyInt())
// While not listening, moving to the lockscreen does not dismiss the keyguard.
sceneInteractor.changeScene(SceneModel(SceneKey.Lockscreen, null), "reason")
@@ -873,7 +872,7 @@
sceneInteractor.onSceneChanged(SceneModel(SceneKey.Lockscreen, null), "reason")
sceneTransitionStateFlow.value = ObservableTransitionState.Idle(SceneKey.Lockscreen)
runCurrent()
- verify(viewMediatorCallback, never()).keyguardDone(anyBoolean(), anyInt())
+ verify(viewMediatorCallback, never()).keyguardDone(anyInt())
// Reattaching the view starts listening again so moving from the bouncer scene to the
// gone scene now does dismiss the keyguard again, this time from lockscreen.
@@ -889,7 +888,7 @@
sceneInteractor.onSceneChanged(SceneModel(SceneKey.Gone, null), "reason")
sceneTransitionStateFlow.value = ObservableTransitionState.Idle(SceneKey.Gone)
runCurrent()
- verify(viewMediatorCallback).keyguardDone(anyBoolean(), anyInt())
+ verify(viewMediatorCallback).keyguardDone(anyInt())
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
index 4a79a21..3e9f471 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
@@ -390,8 +390,7 @@
mViewMediator.setKeyguardEnabled(false);
TestableLooper.get(this).processAllMessages();
- mViewMediator.mViewMediatorCallback.keyguardDonePending(true,
- mUpdateMonitor.getCurrentUser());
+ mViewMediator.mViewMediatorCallback.keyguardDonePending(mUpdateMonitor.getCurrentUser());
mViewMediator.mViewMediatorCallback.readyForKeyguardDone();
final ArgumentCaptor<Runnable> animationRunnableCaptor =
ArgumentCaptor.forClass(Runnable.class);
@@ -681,8 +680,7 @@
startMockKeyguardExitAnimation();
assertTrue(mViewMediator.isAnimatingBetweenKeyguardAndSurfaceBehind());
- mViewMediator.mViewMediatorCallback.keyguardDonePending(true,
- mUpdateMonitor.getCurrentUser());
+ mViewMediator.mViewMediatorCallback.keyguardDonePending(mUpdateMonitor.getCurrentUser());
mViewMediator.mViewMediatorCallback.readyForKeyguardDone();
TestableLooper.get(this).processAllMessages();
verify(mKeyguardUnlockAnimationController).notifyFinishedKeyguardExitAnimation(false);
@@ -743,8 +741,7 @@
// Verify keyguard told of authentication
verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(anyBoolean());
- mViewMediator.mViewMediatorCallback.keyguardDonePending(true,
- mUpdateMonitor.getCurrentUser());
+ mViewMediator.mViewMediatorCallback.keyguardDonePending(mUpdateMonitor.getCurrentUser());
mViewMediator.mViewMediatorCallback.readyForKeyguardDone();
final ArgumentCaptor<Runnable> animationRunnableCaptor =
ArgumentCaptor.forClass(Runnable.class);
@@ -773,8 +770,7 @@
// Verify keyguard told of authentication
verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(anyBoolean());
clearInvocations(mStatusBarKeyguardViewManager);
- mViewMediator.mViewMediatorCallback.keyguardDonePending(true,
- mUpdateMonitor.getCurrentUser());
+ mViewMediator.mViewMediatorCallback.keyguardDonePending(mUpdateMonitor.getCurrentUser());
mViewMediator.mViewMediatorCallback.readyForKeyguardDone();
final ArgumentCaptor<Runnable> animationRunnableCaptor =
ArgumentCaptor.forClass(Runnable.class);
@@ -804,8 +800,7 @@
// Verify keyguard told of authentication
verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(anyBoolean());
- mViewMediator.mViewMediatorCallback.keyguardDonePending(true,
- mUpdateMonitor.getCurrentUser());
+ mViewMediator.mViewMediatorCallback.keyguardDonePending(mUpdateMonitor.getCurrentUser());
mViewMediator.mViewMediatorCallback.readyForKeyguardDone();
final ArgumentCaptor<Runnable> animationRunnableCaptor =
ArgumentCaptor.forClass(Runnable.class);