From 675c35b70b88969e23412e580a9dad9397db78f4 Mon Sep 17 00:00:00 2001 From: Beverly Date: Tue, 30 Jan 2024 20:39:29 +0000 Subject: For non-udfps devices, use lock_icon padding specified in pixels. Instead of using the udfps padding calculation. Fixes: 319894241 Flag: ACONFIG com.android.systemui.device_entry_udfps_refactor DEVELOPMENT Test: manually check lock icon on SFPS device Change-Id: If24a5a67af184e093465b8128e974e6fc2dd0b3b --- .../ui/viewmodel/DeviceEntryForegroundViewModel.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryForegroundViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryForegroundViewModel.kt index 310ec95a22df..ad6a36c71e39 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryForegroundViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryForegroundViewModel.kt @@ -27,6 +27,7 @@ import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.keyguard.ui.view.DeviceEntryIconView import com.android.systemui.res.R import javax.inject.Inject +import kotlin.math.roundToInt import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine @@ -74,7 +75,18 @@ constructor( isTransitionToAod && isUdfps } .distinctUntilChanged() - private val padding: Flow = udfpsOverlayInteractor.iconPadding + + private val padding: Flow = + deviceEntryUdfpsInteractor.isUdfpsSupported.flatMapLatest { udfpsSupported -> + if (udfpsSupported) { + udfpsOverlayInteractor.iconPadding + } else { + configurationInteractor.scaleForResolution.map { scale -> + (context.resources.getDimensionPixelSize(R.dimen.lock_icon_padding) * scale) + .roundToInt() + } + } + } val viewModel: Flow = combine( -- cgit v1.2.3-59-g8ed1b