Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e5fe428 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes Ib856123e,I2baf3541 into main

* changes:
  Fix flaky motion tests
  Adding logs to identify any abnormal updates to the padding of the device entry icon
parents 24b350cd 082314d6
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.hardware.fingerprint.FingerprintManager
import android.hardware.fingerprint.FingerprintSensorProperties
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal
import android.hardware.fingerprint.IFingerprintAuthenticatorsRegisteredCallback
import android.util.Log
import com.android.systemui.biometrics.shared.model.FingerprintSensorType
import com.android.systemui.biometrics.shared.model.SensorStrength
import com.android.systemui.biometrics.shared.model.toSensorStrength
@@ -91,13 +92,14 @@ constructor(
                                trySendWithFailureLogging(
                                    DEFAULT_PROPS,
                                    TAG,
                                    "no registered sensors, use default props"
                                    "no registered sensors, use default props",
                                )
                            } else {
                                Log.d(TAG, "onAllAuthenticatorsRegistered $sensors")
                                trySendWithFailureLogging(
                                    sensors[0],
                                    TAG,
                                    "update properties on authenticators registered"
                                    "update properties on authenticators registered",
                                )
                            }
                        }
@@ -160,7 +162,7 @@ constructor(
                FingerprintSensorProperties.TYPE_UNKNOWN,
                false /* halControlsIllumination */,
                true /* resetLockoutRequiresHardwareAuthToken */,
                listOf<SensorLocationInternal>(SensorLocationInternal.DEFAULT)
                listOf<SensorLocationInternal>(SensorLocationInternal.DEFAULT),
            )
        private val DEFAULT_PROPS =
            FingerprintSensorPropertiesInternal(
@@ -171,7 +173,7 @@ constructor(
                FingerprintSensorProperties.TYPE_UNKNOWN,
                false /* halControlsIllumination */,
                true /* resetLockoutRequiresHardwareAuthToken */,
                listOf<SensorLocationInternal>(SensorLocationInternal.DEFAULT)
                listOf<SensorLocationInternal>(SensorLocationInternal.DEFAULT),
            )
    }
}
+6 −6
Original line number Diff line number Diff line
@@ -48,14 +48,14 @@ constructor(
    private val authController: AuthController,
    private val selectedUserInteractor: SelectedUserInteractor,
    private val fingerprintManager: FingerprintManager?,
    @Application scope: CoroutineScope
    @Application scope: CoroutineScope,
) {
    private fun calculateIconSize(): Int {
        val pixelPitch = context.resources.getFloat(R.dimen.pixel_pitch)
        if (pixelPitch <= 0) {
            Log.e(
                "UdfpsOverlayInteractor",
                "invalid pixelPitch: $pixelPitch. Pixel pitch must be updated per device."
                "invalid pixelPitch: $pixelPitch. Pixel pitch must be updated per device.",
            )
        }
        return (context.resources.getFloat(R.dimen.udfps_icon_size) / pixelPitch).toInt()
@@ -83,12 +83,11 @@ constructor(

    /** Sets whether Udfps overlay should handle touches */
    fun setHandleTouches(shouldHandle: Boolean = true) {
        if (authController.isUdfpsSupported
                && shouldHandle != _shouldHandleTouches.value) {
        if (authController.isUdfpsSupported && shouldHandle != _shouldHandleTouches.value) {
            fingerprintManager?.setIgnoreDisplayTouches(
                requestId.value,
                authController.udfpsProps!!.get(0).sensorId,
                !shouldHandle
                !shouldHandle,
            )
        }
        _shouldHandleTouches.value = shouldHandle
@@ -107,10 +106,11 @@ constructor(
                        override fun onUdfpsLocationChanged(
                            udfpsOverlayParams: UdfpsOverlayParams
                        ) {
                            Log.d(TAG, "udfpsOverlayParams updated $udfpsOverlayParams")
                            trySendWithFailureLogging(
                                udfpsOverlayParams,
                                TAG,
                                "update udfpsOverlayParams"
                                "update udfpsOverlayParams",
                            )
                        }
                    }
+2 −0
Original line number Diff line number Diff line
@@ -182,9 +182,11 @@ object DeviceEntryIconViewBinder {
            fgIconView.repeatWhenAttached {
                repeatOnLifecycle(Lifecycle.State.STARTED) {
                    // Start with an empty state
                    Log.d(TAG, "Initializing device entry fgIconView")
                    fgIconView.setImageState(StateSet.NOTHING, /* merge */ false)
                    launch("$TAG#fpIconView.viewModel") {
                        fgViewModel.viewModel.collect { viewModel ->
                            Log.d(TAG, "Updating device entry icon image state $viewModel")
                            fgIconView.setImageState(
                                view.getIconState(viewModel.type, viewModel.useAodVariant),
                                /* merge */ false,
+2 −1
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import com.android.systemui.motion.createSysUiComposeMotionTestRule
import com.android.systemui.res.R
import com.android.systemui.scene.domain.startable.sceneContainerStartable
import com.android.systemui.testKosmos
import kotlin.time.Duration.Companion.seconds
import org.junit.After
import org.junit.Before
import org.junit.Rule
@@ -109,7 +110,7 @@ class BouncerContentTest : SysuiTestCase() {

    @Test
    fun doubleClick_swapSide() =
        motionTestRule.runTest {
        motionTestRule.runTest(timeout = 30.seconds) {
            val motion =
                recordMotion(
                    content = { BouncerContentUnderTest() },
+3 −2
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import com.android.systemui.haptics.msdl.bouncerHapticPlayer
import com.android.systemui.lifecycle.activateIn
import com.android.systemui.motion.createSysUiComposeMotionTestRule
import com.android.systemui.testKosmos
import kotlin.time.Duration.Companion.seconds
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.takeWhile
@@ -71,7 +72,7 @@ class PatternBouncerTest : SysuiTestCase() {

    @Test
    fun entryAnimation() =
        motionTestRule.runTest {
        motionTestRule.runTest(timeout = 30.seconds) {
            val motion =
                recordMotion(
                    content = { play -> if (play) PatternBouncerUnderTest() },
@@ -89,7 +90,7 @@ class PatternBouncerTest : SysuiTestCase() {

    @Test
    fun animateFailure() =
        motionTestRule.runTest {
        motionTestRule.runTest(timeout = 30.seconds) {
            val failureAnimationMotionControl =
                MotionControl(
                    delayReadyToPlay = {