Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/LockSection.kt +4 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import com.android.compose.animation.scene.ElementKey import com.android.systemui.biometrics.AuthController import com.android.systemui.customization.R as customR import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.flags.FeatureFlagsClassic import com.android.systemui.flags.Flags import com.android.systemui.keyguard.ui.binder.DeviceEntryIconViewBinder Loading @@ -49,12 +50,14 @@ import com.android.systemui.res.R import com.android.systemui.statusbar.VibratorHelper import dagger.Lazy import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope class LockSection @Inject constructor( @Application private val applicationScope: CoroutineScope, @Main private val mainDispatcher: CoroutineDispatcher, private val windowManager: WindowManager, private val authController: AuthController, private val featureFlags: FeatureFlagsClassic, Loading @@ -80,6 +83,7 @@ constructor( id = R.id.device_entry_icon_view DeviceEntryIconViewBinder.bind( applicationScope, mainDispatcher, this, deviceEntryIconViewModel.get(), deviceEntryForegroundViewModel.get(), Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt +29 −21 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import com.android.systemui.plugins.FalsingManager import com.android.systemui.res.R import com.android.systemui.statusbar.VibratorHelper import com.android.systemui.util.kotlin.DisposableHandles import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.DisposableHandle Loading @@ -56,6 +57,7 @@ object DeviceEntryIconViewBinder { @JvmStatic fun bind( applicationScope: CoroutineScope, mainImmediateDispatcher: CoroutineDispatcher, view: DeviceEntryIconView, viewModel: DeviceEntryIconViewModel, fgViewModel: DeviceEntryForegroundViewModel, Loading Loading @@ -95,6 +97,32 @@ object DeviceEntryIconViewBinder { } } disposables += view.repeatWhenAttached(mainImmediateDispatcher) { repeatOnLifecycle(Lifecycle.State.CREATED) { launch("$TAG#viewModel.useBackgroundProtection") { viewModel.useBackgroundProtection.collect { useBackgroundProtection -> if (useBackgroundProtection) { bgView.visibility = View.VISIBLE } else { bgView.visibility = View.GONE } } } launch("$TAG#viewModel.burnInOffsets") { viewModel.burnInOffsets.collect { burnInOffsets -> view.translationX = burnInOffsets.x.toFloat() view.translationY = burnInOffsets.y.toFloat() view.aodFpDrawable.progress = burnInOffsets.progress } } launch("$TAG#viewModel.deviceEntryViewAlpha") { viewModel.deviceEntryViewAlpha.collect { alpha -> view.alpha = alpha } } } } disposables += view.repeatWhenAttached { // Repeat on CREATED so that the view will always observe the entire Loading Loading @@ -152,26 +180,6 @@ object DeviceEntryIconViewBinder { } } } launch("$TAG#viewModel.useBackgroundProtection") { viewModel.useBackgroundProtection.collect { useBackgroundProtection -> if (useBackgroundProtection) { bgView.visibility = View.VISIBLE } else { bgView.visibility = View.GONE } } } launch("$TAG#viewModel.burnInOffsets") { viewModel.burnInOffsets.collect { burnInOffsets -> view.translationX = burnInOffsets.x.toFloat() view.translationY = burnInOffsets.y.toFloat() view.aodFpDrawable.progress = burnInOffsets.progress } } launch("$TAG#viewModel.deviceEntryViewAlpha") { viewModel.deviceEntryViewAlpha.collect { alpha -> view.alpha = alpha } } } } Loading Loading @@ -212,7 +220,7 @@ object DeviceEntryIconViewBinder { } disposables += bgView.repeatWhenAttached { bgView.repeatWhenAttached(mainImmediateDispatcher) { repeatOnLifecycle(Lifecycle.State.CREATED) { launch("$TAG#bgViewModel.alpha") { bgViewModel.alpha.collect { alpha -> bgView.alpha = alpha } Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt +4 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import androidx.constraintlayout.widget.ConstraintSet import com.android.systemui.biometrics.AuthController import com.android.systemui.customization.R as customR import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.flags.FeatureFlags import com.android.systemui.flags.Flags import com.android.systemui.keyguard.shared.model.KeyguardSection Loading @@ -48,6 +49,7 @@ import com.android.systemui.shade.ShadeDisplayAware import com.android.systemui.statusbar.VibratorHelper import dagger.Lazy import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.DisposableHandle Loading @@ -56,6 +58,7 @@ class DefaultDeviceEntrySection @Inject constructor( @Application private val applicationScope: CoroutineScope, @Main private val mainDispatcher: CoroutineDispatcher, private val authController: AuthController, private val windowManager: WindowManager, @ShadeDisplayAware private val context: Context, Loading Loading @@ -91,6 +94,7 @@ constructor( disposableHandle = DeviceEntryIconViewBinder.bind( applicationScope, mainDispatcher, it, deviceEntryIconViewModel.get(), deviceEntryForegroundViewModel.get(), Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySectionTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -31,11 +31,13 @@ import com.android.systemui.flags.Flags import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryBackgroundViewModel import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryForegroundViewModel import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryIconViewModel import com.android.systemui.kosmos.testDispatcher import com.android.systemui.log.logcatLogBuffer import com.android.systemui.plugins.FalsingManager import com.android.systemui.res.R import com.android.systemui.shade.NotificationPanelView import com.android.systemui.statusbar.VibratorHelper import com.android.systemui.testKosmos import com.android.systemui.util.mockito.whenever import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.flow.MutableStateFlow Loading Loading @@ -68,6 +70,7 @@ class DefaultDeviceEntrySectionTest : SysuiTestCase() { underTest = DefaultDeviceEntrySection( TestScope().backgroundScope, testKosmos().testDispatcher, authController, windowManager, context, Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/LockSection.kt +4 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import com.android.compose.animation.scene.ElementKey import com.android.systemui.biometrics.AuthController import com.android.systemui.customization.R as customR import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.flags.FeatureFlagsClassic import com.android.systemui.flags.Flags import com.android.systemui.keyguard.ui.binder.DeviceEntryIconViewBinder Loading @@ -49,12 +50,14 @@ import com.android.systemui.res.R import com.android.systemui.statusbar.VibratorHelper import dagger.Lazy import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope class LockSection @Inject constructor( @Application private val applicationScope: CoroutineScope, @Main private val mainDispatcher: CoroutineDispatcher, private val windowManager: WindowManager, private val authController: AuthController, private val featureFlags: FeatureFlagsClassic, Loading @@ -80,6 +83,7 @@ constructor( id = R.id.device_entry_icon_view DeviceEntryIconViewBinder.bind( applicationScope, mainDispatcher, this, deviceEntryIconViewModel.get(), deviceEntryForegroundViewModel.get(), Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/DeviceEntryIconViewBinder.kt +29 −21 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import com.android.systemui.plugins.FalsingManager import com.android.systemui.res.R import com.android.systemui.statusbar.VibratorHelper import com.android.systemui.util.kotlin.DisposableHandles import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.DisposableHandle Loading @@ -56,6 +57,7 @@ object DeviceEntryIconViewBinder { @JvmStatic fun bind( applicationScope: CoroutineScope, mainImmediateDispatcher: CoroutineDispatcher, view: DeviceEntryIconView, viewModel: DeviceEntryIconViewModel, fgViewModel: DeviceEntryForegroundViewModel, Loading Loading @@ -95,6 +97,32 @@ object DeviceEntryIconViewBinder { } } disposables += view.repeatWhenAttached(mainImmediateDispatcher) { repeatOnLifecycle(Lifecycle.State.CREATED) { launch("$TAG#viewModel.useBackgroundProtection") { viewModel.useBackgroundProtection.collect { useBackgroundProtection -> if (useBackgroundProtection) { bgView.visibility = View.VISIBLE } else { bgView.visibility = View.GONE } } } launch("$TAG#viewModel.burnInOffsets") { viewModel.burnInOffsets.collect { burnInOffsets -> view.translationX = burnInOffsets.x.toFloat() view.translationY = burnInOffsets.y.toFloat() view.aodFpDrawable.progress = burnInOffsets.progress } } launch("$TAG#viewModel.deviceEntryViewAlpha") { viewModel.deviceEntryViewAlpha.collect { alpha -> view.alpha = alpha } } } } disposables += view.repeatWhenAttached { // Repeat on CREATED so that the view will always observe the entire Loading Loading @@ -152,26 +180,6 @@ object DeviceEntryIconViewBinder { } } } launch("$TAG#viewModel.useBackgroundProtection") { viewModel.useBackgroundProtection.collect { useBackgroundProtection -> if (useBackgroundProtection) { bgView.visibility = View.VISIBLE } else { bgView.visibility = View.GONE } } } launch("$TAG#viewModel.burnInOffsets") { viewModel.burnInOffsets.collect { burnInOffsets -> view.translationX = burnInOffsets.x.toFloat() view.translationY = burnInOffsets.y.toFloat() view.aodFpDrawable.progress = burnInOffsets.progress } } launch("$TAG#viewModel.deviceEntryViewAlpha") { viewModel.deviceEntryViewAlpha.collect { alpha -> view.alpha = alpha } } } } Loading Loading @@ -212,7 +220,7 @@ object DeviceEntryIconViewBinder { } disposables += bgView.repeatWhenAttached { bgView.repeatWhenAttached(mainImmediateDispatcher) { repeatOnLifecycle(Lifecycle.State.CREATED) { launch("$TAG#bgViewModel.alpha") { bgViewModel.alpha.collect { alpha -> bgView.alpha = alpha } Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt +4 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import androidx.constraintlayout.widget.ConstraintSet import com.android.systemui.biometrics.AuthController import com.android.systemui.customization.R as customR import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.flags.FeatureFlags import com.android.systemui.flags.Flags import com.android.systemui.keyguard.shared.model.KeyguardSection Loading @@ -48,6 +49,7 @@ import com.android.systemui.shade.ShadeDisplayAware import com.android.systemui.statusbar.VibratorHelper import dagger.Lazy import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.DisposableHandle Loading @@ -56,6 +58,7 @@ class DefaultDeviceEntrySection @Inject constructor( @Application private val applicationScope: CoroutineScope, @Main private val mainDispatcher: CoroutineDispatcher, private val authController: AuthController, private val windowManager: WindowManager, @ShadeDisplayAware private val context: Context, Loading Loading @@ -91,6 +94,7 @@ constructor( disposableHandle = DeviceEntryIconViewBinder.bind( applicationScope, mainDispatcher, it, deviceEntryIconViewModel.get(), deviceEntryForegroundViewModel.get(), Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySectionTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -31,11 +31,13 @@ import com.android.systemui.flags.Flags import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryBackgroundViewModel import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryForegroundViewModel import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryIconViewModel import com.android.systemui.kosmos.testDispatcher import com.android.systemui.log.logcatLogBuffer import com.android.systemui.plugins.FalsingManager import com.android.systemui.res.R import com.android.systemui.shade.NotificationPanelView import com.android.systemui.statusbar.VibratorHelper import com.android.systemui.testKosmos import com.android.systemui.util.mockito.whenever import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.flow.MutableStateFlow Loading Loading @@ -68,6 +70,7 @@ class DefaultDeviceEntrySectionTest : SysuiTestCase() { underTest = DefaultDeviceEntrySection( TestScope().backgroundScope, testKosmos().testDispatcher, authController, windowManager, context, Loading