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

Commit f013bc0f authored by Hao Dong's avatar Hao Dong Committed by Android (Google) Code Review
Browse files

Merge "Make sfps indicator window show for all users by changing type"

parents d4b82ab5 d40e081b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ constructor(
        WindowManager.LayoutParams(
                WindowManager.LayoutParams.WRAP_CONTENT,
                WindowManager.LayoutParams.WRAP_CONTENT,
                WindowManager.LayoutParams.TYPE_SYSTEM_ERROR,
                WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG,
                Utils.FINGERPRINT_OVERLAY_LAYOUT_PARAM_FLAGS,
                PixelFormat.TRANSLUCENT
            )
+16 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import android.view.WindowInsets
import android.view.WindowManager
import android.view.WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION
import android.view.WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY
import android.view.WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG
import android.view.WindowMetrics
import androidx.test.filters.SmallTest
import com.airbnb.lottie.LottieAnimationView
@@ -422,6 +423,21 @@ class SideFpsControllerTest : SysuiTestCase() {
        assertThat(fingerprintManager.hasSideFpsSensor()).isFalse()
    }

    @Test
    fun testLayoutParams_isKeyguardDialogType() =
        testWithDisplay(deviceConfig = DeviceConfig.Y_ALIGNED_UNFOLDED) {
            sideFpsController.overlayOffsets = sensorLocation
            sideFpsController.updateOverlayParams(windowManager.defaultDisplay, indicatorBounds)
            overlayController.show(SENSOR_ID, REASON_UNKNOWN)
            executor.runAllReady()

            verify(windowManager).updateViewLayout(any(), overlayViewParamsCaptor.capture())

            val lpType = overlayViewParamsCaptor.value.type

            assertThat((lpType and TYPE_KEYGUARD_DIALOG) != 0).isTrue()
        }

    @Test
    fun testLayoutParams_hasNoMoveAnimationWindowFlag() =
        testWithDisplay(deviceConfig = DeviceConfig.Y_ALIGNED_UNFOLDED) {