Rename UdfpsKeyguardView files to -Legacy

Do this in a separate CL from the refactor CL to maintain
history on the file.

Test: atest SystemUiRoboTests
Test: atest UdfpsControllerTest UdfpsControllerOverlayTest
Test: atest UdfpsKeyguardViewControllerTest
Test: atest UdfpsKeyguardViewControllerWithCoroutinesTest
Bug: 278719514

Change-Id: I84425548e73aa7834cfe87c00e60b234d17b7c10
This commit is contained in:
Beverly
2023-05-03 13:49:09 +00:00
committed by Beverly Tai
parent e9d162e978
commit ea7325cf8e
12 changed files with 48 additions and 45 deletions

View File

@@ -284,9 +284,9 @@ filegroup {
"tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java",
"tests/src/com/android/systemui/biometrics/UdfpsDialogMeasureAdapterTest.java",
"tests/src/com/android/systemui/biometrics/UdfpsDisplayModeTest.java",
"tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerBaseTest.java",
"tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerTest.java",
"tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerWithCoroutinesTest.kt",
"tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewLegacyControllerBaseTest.java",
"tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewLegacyControllerTest.java",
"tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewLegacyControllerWithCoroutinesTest.kt",
"tests/src/com/android/systemui/biometrics/UdfpsShellTest.kt",
"tests/src/com/android/systemui/biometrics/UdfpsViewTest.kt",
],

View File

@@ -14,7 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<com.android.systemui.biometrics.UdfpsKeyguardView
<com.android.systemui.biometrics.UdfpsKeyguardViewLegacy
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/udfps_animation_view"
@@ -23,4 +23,4 @@
<!-- Add fingerprint views here. See udfps_keyguard_view_internal.xml. -->
</com.android.systemui.biometrics.UdfpsKeyguardView>
</com.android.systemui.biometrics.UdfpsKeyguardViewLegacy>

View File

@@ -780,7 +780,8 @@ public class UdfpsController implements DozeReceiver, Dumpable {
private boolean shouldTryToDismissKeyguard() {
return mOverlay != null
&& mOverlay.getAnimationViewController() instanceof UdfpsKeyguardViewController
&& mOverlay.getAnimationViewController()
instanceof UdfpsKeyguardViewControllerLegacy
&& mKeyguardStateController.canDismissLockScreen()
&& !mAttemptedToDismissKeyguard;
}

View File

@@ -242,8 +242,8 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
)
}
REASON_AUTH_KEYGUARD -> {
UdfpsKeyguardViewController(
view.addUdfpsView(R.layout.udfps_keyguard_view) {
UdfpsKeyguardViewControllerLegacy(
view.addUdfpsView(R.layout.udfps_keyguard_view_legacy) {
updateSensorLocation(sensorBounds)
},
statusBarStateController,
@@ -413,7 +413,7 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
}
private fun shouldRotate(animation: UdfpsAnimationViewController<*>?): Boolean {
if (animation !is UdfpsKeyguardViewController) {
if (animation !is UdfpsKeyguardViewControllerLegacy) {
// always rotate view if we're not on the keyguard
return true
}

View File

@@ -53,9 +53,9 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
/** Class that coordinates non-HBM animations during keyguard authentication. */
open class UdfpsKeyguardViewController
open class UdfpsKeyguardViewControllerLegacy
constructor(
private val view: UdfpsKeyguardView,
private val view: UdfpsKeyguardViewLegacy,
statusBarStateController: StatusBarStateController,
shadeExpansionStateManager: ShadeExpansionStateManager,
private val keyguardViewManager: StatusBarKeyguardViewManager,
@@ -72,7 +72,7 @@ constructor(
private val primaryBouncerInteractor: PrimaryBouncerInteractor,
private val alternateBouncerInteractor: AlternateBouncerInteractor,
) :
UdfpsAnimationViewController<UdfpsKeyguardView>(
UdfpsAnimationViewController<UdfpsKeyguardViewLegacy>(
view,
statusBarStateController,
shadeExpansionStateManager,
@@ -100,7 +100,7 @@ constructor(
view.onDozeAmountChanged(
animation.animatedFraction,
animation.animatedValue as Float,
UdfpsKeyguardView.ANIMATION_UNLOCKED_SCREEN_OFF
UdfpsKeyguardViewLegacy.ANIMATION_UNLOCKED_SCREEN_OFF
)
}
}
@@ -123,7 +123,7 @@ constructor(
view.onDozeAmountChanged(
linear,
eased,
UdfpsKeyguardView.ANIMATION_BETWEEN_AOD_AND_LOCKSCREEN
UdfpsKeyguardViewLegacy.ANIMATION_BETWEEN_AOD_AND_LOCKSCREEN
)
}
lastDozeAmount = linear
@@ -131,7 +131,7 @@ constructor(
}
override fun onStateChanged(statusBarState: Int) {
this@UdfpsKeyguardViewController.statusBarState = statusBarState
this@UdfpsKeyguardViewControllerLegacy.statusBarState = statusBarState
updateAlpha()
updatePauseAuth()
}
@@ -198,7 +198,7 @@ constructor(
private val statusBarKeyguardViewManagerCallback: KeyguardViewManagerCallback =
object : KeyguardViewManagerCallback {
override fun onQSExpansionChanged(qsExpansion: Float) {
this@UdfpsKeyguardViewController.qsExpansion = qsExpansion
this@UdfpsKeyguardViewControllerLegacy.qsExpansion = qsExpansion
updateAlpha()
updatePauseAuth()
}
@@ -296,7 +296,7 @@ constructor(
updateAlpha()
updatePauseAuth()
keyguardViewManager.setOccludingAppBiometricUI(occludingAppBiometricUI)
lockScreenShadeTransitionController.udfpsKeyguardViewController = this
lockScreenShadeTransitionController.mUdfpsKeyguardViewControllerLegacy = this
activityLaunchAnimator.addListener(activityLaunchAnimatorListener)
view.mUseExpandedOverlay = useExpandedOverlay
view.startIconAsyncInflate()
@@ -312,8 +312,8 @@ constructor(
keyguardUpdateMonitor.requestFaceAuthOnOccludingApp(false)
configurationController.removeCallback(configurationListener)
shadeExpansionStateManager.removeExpansionListener(shadeExpansionListener)
if (lockScreenShadeTransitionController.udfpsKeyguardViewController === this) {
lockScreenShadeTransitionController.udfpsKeyguardViewController = null
if (lockScreenShadeTransitionController.mUdfpsKeyguardViewControllerLegacy === this) {
lockScreenShadeTransitionController.mUdfpsKeyguardViewControllerLegacy = null
}
activityLaunchAnimator.removeListener(activityLaunchAnimatorListener)
keyguardViewManager.removeCallback(statusBarKeyguardViewManagerCallback)

View File

@@ -53,9 +53,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* View corresponding with udfps_keyguard_view.xml
* View corresponding with udfps_keyguard_view_legacy.xml
*/
public class UdfpsKeyguardView extends UdfpsAnimationView {
public class UdfpsKeyguardViewLegacy extends UdfpsAnimationView {
private UdfpsDrawable mFingerprintDrawable; // placeholder
private LottieAnimationView mAodFp;
private LottieAnimationView mLockScreenFp;
@@ -80,7 +80,7 @@ public class UdfpsKeyguardView extends UdfpsAnimationView {
private int mAnimationType = ANIMATION_NONE;
private boolean mFullyInflated;
public UdfpsKeyguardView(Context context, @Nullable AttributeSet attrs) {
public UdfpsKeyguardViewLegacy(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
mFingerprintDrawable = new UdfpsFpDrawable(context);

View File

@@ -18,8 +18,7 @@ import com.android.systemui.Dumpable
import com.android.systemui.ExpandHelper
import com.android.systemui.Gefingerpoken
import com.android.systemui.R
import com.android.app.animation.Interpolators
import com.android.systemui.biometrics.UdfpsKeyguardViewController
import com.android.systemui.biometrics.UdfpsKeyguardViewControllerLegacy
import com.android.systemui.classifier.Classifier
import com.android.systemui.classifier.FalsingCollector
import com.android.systemui.dagger.SysUISingleton
@@ -43,6 +42,7 @@ import com.android.systemui.statusbar.phone.KeyguardBypassController
import com.android.systemui.statusbar.phone.LSShadeTransitionLogger
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.util.LargeScreenUtils
import com.android.wm.shell.animation.Interpolators
import java.io.PrintWriter
import javax.inject.Inject
@@ -170,7 +170,7 @@ class LockscreenShadeTransitionController @Inject constructor(
/**
* The udfpsKeyguardViewController if it exists.
*/
var udfpsKeyguardViewController: UdfpsKeyguardViewController? = null
var mUdfpsKeyguardViewControllerLegacy: UdfpsKeyguardViewControllerLegacy? = null
/**
* The touch helper responsible for the drag down animation.
@@ -452,7 +452,7 @@ class LockscreenShadeTransitionController @Inject constructor(
val udfpsProgress = MathUtils.saturate(dragDownAmount / udfpsTransitionDistance)
shadeRepository.setUdfpsTransitionToFullShadeProgress(udfpsProgress)
udfpsKeyguardViewController?.setTransitionToFullShadeProgress(udfpsProgress)
mUdfpsKeyguardViewControllerLegacy?.setTransitionToFullShadeProgress(udfpsProgress)
val statusBarProgress = MathUtils.saturate(dragDownAmount / statusBarTransitionDistance)
centralSurfaces.setTransitionToFullShadeProgress(statusBarProgress)

View File

@@ -108,7 +108,7 @@ class UdfpsControllerOverlayTest : SysuiTestCase() {
@Mock private lateinit var controllerCallback: IUdfpsOverlayControllerCallback
@Mock private lateinit var udfpsController: UdfpsController
@Mock private lateinit var udfpsView: UdfpsView
@Mock private lateinit var udfpsKeyguardView: UdfpsKeyguardView
@Mock private lateinit var mUdfpsKeyguardViewLegacy: UdfpsKeyguardViewLegacy
@Mock private lateinit var activityLaunchAnimator: ActivityLaunchAnimator
@Mock private lateinit var featureFlags: FeatureFlags
@Mock private lateinit var primaryBouncerInteractor: PrimaryBouncerInteractor
@@ -126,8 +126,8 @@ class UdfpsControllerOverlayTest : SysuiTestCase() {
.thenReturn(udfpsView)
whenever(inflater.inflate(R.layout.udfps_bp_view, null))
.thenReturn(mock(UdfpsBpView::class.java))
whenever(inflater.inflate(R.layout.udfps_keyguard_view, null))
.thenReturn(udfpsKeyguardView)
whenever(inflater.inflate(R.layout.udfps_keyguard_view_legacy, null))
.thenReturn(mUdfpsKeyguardViewLegacy)
whenever(inflater.inflate(R.layout.udfps_fpm_empty_view, null))
.thenReturn(mock(UdfpsFpmEmptyView::class.java))
}
@@ -155,7 +155,7 @@ class UdfpsControllerOverlayTest : SysuiTestCase() {
@Test
fun showUdfpsOverlay_keyguard() = withReason(REASON_AUTH_KEYGUARD) {
showUdfpsOverlay()
verify(udfpsKeyguardView).updateSensorLocation(eq(overlayParams.sensorBounds))
verify(mUdfpsKeyguardViewLegacy).updateSensorLocation(eq(overlayParams.sensorBounds))
}
@Test

View File

@@ -198,9 +198,9 @@ public class UdfpsControllerTest extends SysuiTestCase {
@Mock
private UdfpsFpmEmptyView mFpmEmptyView;
@Mock
private UdfpsKeyguardView mKeyguardView;
private UdfpsKeyguardViewLegacy mKeyguardView;
private final UdfpsAnimationViewController mUdfpsKeyguardViewController =
mock(UdfpsKeyguardViewController.class);
mock(UdfpsKeyguardViewControllerLegacy.class);
@Mock
private SystemUIDialogManager mSystemUIDialogManager;
@Mock
@@ -248,7 +248,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
when(mLayoutInflater.inflate(R.layout.udfps_view, null, false))
.thenReturn(mUdfpsView);
when(mLayoutInflater.inflate(R.layout.udfps_keyguard_view, null))
when(mLayoutInflater.inflate(R.layout.udfps_keyguard_view_legacy, null))
.thenReturn(mKeyguardView); // for showOverlay REASON_AUTH_FPM_KEYGUARD
when(mLayoutInflater.inflate(R.layout.udfps_bp_view, null))
.thenReturn(mBpView);

View File

@@ -52,9 +52,9 @@ import org.mockito.MockitoAnnotations;
import java.util.List;
public class UdfpsKeyguardViewControllerBaseTest extends SysuiTestCase {
public class UdfpsKeyguardViewLegacyControllerBaseTest extends SysuiTestCase {
// Dependencies
protected @Mock UdfpsKeyguardView mView;
protected @Mock UdfpsKeyguardViewLegacy mView;
protected @Mock Context mResourceContext;
protected @Mock StatusBarStateController mStatusBarStateController;
protected @Mock ShadeExpansionStateManager mShadeExpansionStateManager;
@@ -75,7 +75,7 @@ public class UdfpsKeyguardViewControllerBaseTest extends SysuiTestCase {
protected FakeFeatureFlags mFeatureFlags = new FakeFeatureFlags();
protected UdfpsKeyguardViewController mController;
protected UdfpsKeyguardViewControllerLegacy mController;
// Capture listeners so that they can be used to send events
private @Captor ArgumentCaptor<StatusBarStateController.StateListener> mStateListenerCaptor;
@@ -135,7 +135,7 @@ public class UdfpsKeyguardViewControllerBaseTest extends SysuiTestCase {
mKeyguardStateControllerCallback = mKeyguardStateControllerCallbackCaptor.getValue();
}
public UdfpsKeyguardViewController createUdfpsKeyguardViewController() {
public UdfpsKeyguardViewControllerLegacy createUdfpsKeyguardViewController() {
return createUdfpsKeyguardViewController(false, false);
}
@@ -145,10 +145,10 @@ public class UdfpsKeyguardViewControllerBaseTest extends SysuiTestCase {
mKeyguardViewManagerCallback = mKeyguardViewManagerCallbackArgumentCaptor.getValue();
}
protected UdfpsKeyguardViewController createUdfpsKeyguardViewController(
protected UdfpsKeyguardViewControllerLegacy createUdfpsKeyguardViewController(
boolean useModernBouncer, boolean useExpandedOverlay) {
mFeatureFlags.set(Flags.UDFPS_NEW_TOUCH_DETECTION, useExpandedOverlay);
UdfpsKeyguardViewController controller = new UdfpsKeyguardViewController(
UdfpsKeyguardViewControllerLegacy controller = new UdfpsKeyguardViewControllerLegacy(
mView,
mStatusBarStateController,
mShadeExpansionStateManager,

View File

@@ -45,9 +45,10 @@ import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper(setAsMainLooper = true)
public class UdfpsKeyguardViewControllerTest extends UdfpsKeyguardViewControllerBaseTest {
public class UdfpsKeyguardViewLegacyControllerTest extends
UdfpsKeyguardViewLegacyControllerBaseTest {
@Override
public UdfpsKeyguardViewController createUdfpsKeyguardViewController() {
public UdfpsKeyguardViewControllerLegacy createUdfpsKeyguardViewController() {
return createUdfpsKeyguardViewController(/* useModernBouncer */ false,
/* useExpandedOverlay */ false);
}
@@ -90,7 +91,7 @@ public class UdfpsKeyguardViewControllerTest extends UdfpsKeyguardViewController
mController.onViewAttached();
verify(mView, atLeast(1)).setPauseAuth(true);
verify(mView).onDozeAmountChanged(dozeAmount, dozeAmount,
UdfpsKeyguardView.ANIMATION_BETWEEN_AOD_AND_LOCKSCREEN);
UdfpsKeyguardViewLegacy.ANIMATION_BETWEEN_AOD_AND_LOCKSCREEN);
}
@Test
@@ -118,7 +119,7 @@ public class UdfpsKeyguardViewControllerTest extends UdfpsKeyguardViewController
mStatusBarStateListener.onDozeAmountChanged(linear, eased);
verify(mView).onDozeAmountChanged(linear, eased,
UdfpsKeyguardView.ANIMATION_BETWEEN_AOD_AND_LOCKSCREEN);
UdfpsKeyguardViewLegacy.ANIMATION_BETWEEN_AOD_AND_LOCKSCREEN);
}
@Test

View File

@@ -60,7 +60,8 @@ import org.mockito.MockitoAnnotations
@RoboPilotTest
@TestableLooper.RunWithLooper
@kotlinx.coroutines.ExperimentalCoroutinesApi
class UdfpsKeyguardViewControllerWithCoroutinesTest : UdfpsKeyguardViewControllerBaseTest() {
class UdfpsKeyguardViewLegacyControllerWithCoroutinesTest :
UdfpsKeyguardViewLegacyControllerBaseTest() {
lateinit var keyguardBouncerRepository: KeyguardBouncerRepository
@Mock private lateinit var bouncerLogger: TableLogBuffer
@@ -82,7 +83,7 @@ class UdfpsKeyguardViewControllerWithCoroutinesTest : UdfpsKeyguardViewControlle
super.setUp()
}
override fun createUdfpsKeyguardViewController(): UdfpsKeyguardViewController? {
override fun createUdfpsKeyguardViewController(): UdfpsKeyguardViewControllerLegacy? {
mPrimaryBouncerInteractor =
PrimaryBouncerInteractor(
keyguardBouncerRepository,