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

Commit d40e081b authored by Hao Dong's avatar Hao Dong
Browse files

Make sfps indicator window show for all users by changing type

Test: manual test on SFPS devices:
      Switch to 2nd user and setup Fingerprint Unlock. SFPS indicator
      shows at the EDU screen.
Test: atest SideFpsControllerTest
Bug: 259029157
Change-Id: I5cf464608032edf4fd07ee2bfb6b457616d19c1d
parent 33f36e06
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) {