Loading packages/SystemUI/res-keyguard/layout/alternate_bouncer.xml +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:sysui="http://schemas.android.com/apk/res-auto" android:id="@+id/alternate_bouncer" android:focusable="true" android:clickable="true" android:layout_width="match_parent" android:layout_height="match_parent"> Loading packages/SystemUI/res/layout/sidefps_view.xml +2 −1 Original line number Diff line number Diff line Loading @@ -22,4 +22,5 @@ android:layout_height="wrap_content" app:lottie_autoPlay="true" app:lottie_loop="true" app:lottie_rawRes="@raw/sfps_pulse" /> No newline at end of file app:lottie_rawRes="@raw/sfps_pulse" android:importantForAccessibility="no"/> No newline at end of file packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinder.kt +25 −12 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.WindowManager import android.view.accessibility.AccessibilityEvent import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.airbnb.lottie.LottieAnimationView Loading @@ -46,11 +47,11 @@ import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.res.R import com.android.systemui.util.kotlin.sample import dagger.Lazy import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.combine import kotlinx.coroutines.launch import javax.inject.Inject /** Binds the side fingerprint sensor indicator view to [SideFpsOverlayViewModel]. */ @OptIn(ExperimentalCoroutinesApi::class) Loading Loading @@ -126,11 +127,6 @@ constructor( } overlayView = layoutInflater.get().inflate(R.layout.sidefps_view, null, false) .apply { contentDescription = context.resources.getString( R.string.accessibility_side_fingerprint_indicator_label ) } val overlayViewModel = SideFpsOverlayViewModel( Loading @@ -139,13 +135,11 @@ constructor( displayStateInteractor.get(), sfpsSensorInteractor.get(), ) overlayView?.let { overlayView -> bind(overlayView, overlayViewModel, windowManager.get()) overlayView.visibility = View.INVISIBLE bind(overlayView!!, overlayViewModel, windowManager.get()) overlayView!!.visibility = View.INVISIBLE Log.d(TAG, "show(): adding overlayView $overlayView") windowManager.get().addView(overlayView, overlayViewModel.defaultOverlayViewParams) } } /** Hide the side fingerprint sensor indicator */ private fun hide() { Loading Loading @@ -185,6 +179,25 @@ constructor( overlayShowAnimator.start() it.setAccessibilityDelegate( object : View.AccessibilityDelegate() { override fun dispatchPopulateAccessibilityEvent( host: View, event: AccessibilityEvent ): Boolean { return if ( event.getEventType() === android.view.accessibility.AccessibilityEvent .TYPE_WINDOW_STATE_CHANGED ) { true } else { super.dispatchPopulateAccessibilityEvent(host, event) } } } ) repeatOnLifecycle(Lifecycle.State.STARTED) { launch { viewModel.lottieCallbacks.collect { callbacks -> Loading packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/SideFpsOverlayViewModel.kt +1 −5 Original line number Diff line number Diff line Loading @@ -81,9 +81,7 @@ constructor( WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED or WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN or WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL, Utils.FINGERPRINT_OVERLAY_LAYOUT_PARAM_FLAGS, PixelFormat.TRANSLUCENT ) .apply { Loading @@ -93,8 +91,6 @@ constructor( layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS privateFlags = PRIVATE_FLAG_TRUSTED_OVERLAY or PRIVATE_FLAG_NO_MOVE_ANIMATION // Avoid announcing window title. accessibilityTitle = " " } private val indicatorAsset: Flow<Int> = Loading packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinderTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,6 @@ class SideFpsOverlayViewBinderTest : SysuiTestCase() { `when`(layoutInflater.inflate(R.layout.sidefps_view, null, false)).thenReturn(sideFpsView) `when`(sideFpsView.requireViewById<LottieAnimationView>(eq(R.id.sidefps_animation))) .thenReturn(mock(LottieAnimationView::class.java)) `when`(sideFpsView.context).thenReturn(mContext) with(mock(ViewPropertyAnimator::class.java)) { `when`(sideFpsView.animate()).thenReturn(this) `when`(alpha(Mockito.anyFloat())).thenReturn(this) Loading Loading
packages/SystemUI/res-keyguard/layout/alternate_bouncer.xml +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:sysui="http://schemas.android.com/apk/res-auto" android:id="@+id/alternate_bouncer" android:focusable="true" android:clickable="true" android:layout_width="match_parent" android:layout_height="match_parent"> Loading
packages/SystemUI/res/layout/sidefps_view.xml +2 −1 Original line number Diff line number Diff line Loading @@ -22,4 +22,5 @@ android:layout_height="wrap_content" app:lottie_autoPlay="true" app:lottie_loop="true" app:lottie_rawRes="@raw/sfps_pulse" /> No newline at end of file app:lottie_rawRes="@raw/sfps_pulse" android:importantForAccessibility="no"/> No newline at end of file
packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinder.kt +25 −12 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.WindowManager import android.view.accessibility.AccessibilityEvent import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.airbnb.lottie.LottieAnimationView Loading @@ -46,11 +47,11 @@ import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.res.R import com.android.systemui.util.kotlin.sample import dagger.Lazy import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.combine import kotlinx.coroutines.launch import javax.inject.Inject /** Binds the side fingerprint sensor indicator view to [SideFpsOverlayViewModel]. */ @OptIn(ExperimentalCoroutinesApi::class) Loading Loading @@ -126,11 +127,6 @@ constructor( } overlayView = layoutInflater.get().inflate(R.layout.sidefps_view, null, false) .apply { contentDescription = context.resources.getString( R.string.accessibility_side_fingerprint_indicator_label ) } val overlayViewModel = SideFpsOverlayViewModel( Loading @@ -139,13 +135,11 @@ constructor( displayStateInteractor.get(), sfpsSensorInteractor.get(), ) overlayView?.let { overlayView -> bind(overlayView, overlayViewModel, windowManager.get()) overlayView.visibility = View.INVISIBLE bind(overlayView!!, overlayViewModel, windowManager.get()) overlayView!!.visibility = View.INVISIBLE Log.d(TAG, "show(): adding overlayView $overlayView") windowManager.get().addView(overlayView, overlayViewModel.defaultOverlayViewParams) } } /** Hide the side fingerprint sensor indicator */ private fun hide() { Loading Loading @@ -185,6 +179,25 @@ constructor( overlayShowAnimator.start() it.setAccessibilityDelegate( object : View.AccessibilityDelegate() { override fun dispatchPopulateAccessibilityEvent( host: View, event: AccessibilityEvent ): Boolean { return if ( event.getEventType() === android.view.accessibility.AccessibilityEvent .TYPE_WINDOW_STATE_CHANGED ) { true } else { super.dispatchPopulateAccessibilityEvent(host, event) } } } ) repeatOnLifecycle(Lifecycle.State.STARTED) { launch { viewModel.lottieCallbacks.collect { callbacks -> Loading
packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/SideFpsOverlayViewModel.kt +1 −5 Original line number Diff line number Diff line Loading @@ -81,9 +81,7 @@ constructor( WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED or WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN or WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL, Utils.FINGERPRINT_OVERLAY_LAYOUT_PARAM_FLAGS, PixelFormat.TRANSLUCENT ) .apply { Loading @@ -93,8 +91,6 @@ constructor( layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS privateFlags = PRIVATE_FLAG_TRUSTED_OVERLAY or PRIVATE_FLAG_NO_MOVE_ANIMATION // Avoid announcing window title. accessibilityTitle = " " } private val indicatorAsset: Flow<Int> = Loading
packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinderTest.kt +0 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,6 @@ class SideFpsOverlayViewBinderTest : SysuiTestCase() { `when`(layoutInflater.inflate(R.layout.sidefps_view, null, false)).thenReturn(sideFpsView) `when`(sideFpsView.requireViewById<LottieAnimationView>(eq(R.id.sidefps_animation))) .thenReturn(mock(LottieAnimationView::class.java)) `when`(sideFpsView.context).thenReturn(mContext) with(mock(ViewPropertyAnimator::class.java)) { `when`(sideFpsView.animate()).thenReturn(this) `when`(alpha(Mockito.anyFloat())).thenReturn(this) Loading