Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/BottomAreaSection.kt +4 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import androidx.core.content.res.ResourcesCompat import com.android.compose.animation.scene.ElementKey import com.android.compose.animation.scene.SceneScope import com.android.systemui.animation.view.LaunchableImageView import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.keyguard.ui.binder.KeyguardIndicationAreaBinder import com.android.systemui.keyguard.ui.binder.KeyguardQuickAffordanceViewBinder import com.android.systemui.keyguard.ui.view.KeyguardIndicationArea Loading @@ -43,6 +44,7 @@ import com.android.systemui.res.R import com.android.systemui.statusbar.KeyguardIndicationController import com.android.systemui.statusbar.VibratorHelper import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.DisposableHandle import kotlinx.coroutines.flow.Flow Loading @@ -54,6 +56,7 @@ constructor( private val vibratorHelper: VibratorHelper, private val indicationController: KeyguardIndicationController, private val indicationAreaViewModel: KeyguardIndicationAreaViewModel, @Main private val mainImmediateDispatcher: CoroutineDispatcher, ) { /** * Renders a single lockscreen shortcut. Loading Loading @@ -161,6 +164,7 @@ constructor( transitionAlpha, falsingManager, vibratorHelper, mainImmediateDispatcher, ) { indicationController.showTransientIndication(it) } 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 @@ -34,6 +34,7 @@ import com.android.keyguard.LockIconView import com.android.keyguard.LockIconViewController import com.android.systemui.biometrics.AuthController import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.deviceentry.shared.DeviceEntryUdfpsRefactor import com.android.systemui.flags.FeatureFlagsClassic import com.android.systemui.flags.Flags Loading @@ -50,12 +51,14 @@ import com.android.systemui.shade.NotificationPanelView 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 mainImmediateDispatcher: CoroutineDispatcher, private val windowManager: WindowManager, private val authController: AuthController, private val featureFlags: FeatureFlagsClassic, Loading Loading @@ -93,6 +96,7 @@ constructor( deviceEntryBackgroundViewModel.get(), falsingManager.get(), vibratorHelper.get(), mainImmediateDispatcher, ) } } else { Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt +4 −2 Original line number Diff line number Diff line Loading @@ -214,14 +214,16 @@ class KeyguardInteractorTest : SysuiTestCase() { ) repository.setStatusBarState(StatusBarState.KEYGUARD) shadeRepository.setLegacyShadeExpansion(1f) // User begins to swipe up shadeRepository.setLegacyShadeExpansion(0.99f) // When not dismissable, no alpha value (null) should emit repository.setKeyguardDismissible(false) assertThat(dismissAlpha).isNull() repository.setKeyguardDismissible(true) assertThat(dismissAlpha).isGreaterThan(0.95f) shadeRepository.setLegacyShadeExpansion(0.98f) assertThat(dismissAlpha).isGreaterThan(0.5f) } @Test Loading packages/SystemUI/src/com/android/keyguard/ClockEventController.kt +12 −8 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.view.ViewTreeObserver.OnGlobalLayoutListener import androidx.annotation.VisibleForTesting import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.android.app.tracing.coroutines.launch import com.android.systemui.broadcast.BroadcastDispatcher import com.android.systemui.customization.R import com.android.systemui.dagger.qualifiers.Background Loading Loading @@ -65,6 +66,7 @@ import java.util.Locale import java.util.TimeZone import java.util.concurrent.Executor import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.DisposableHandle import kotlinx.coroutines.Job Loading @@ -72,7 +74,6 @@ import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.merge import kotlinx.coroutines.launch /** * Controller for a Clock provided by the registry and used on the keyguard. Instantiated by Loading @@ -90,6 +91,7 @@ constructor( @DisplaySpecific private val resources: Resources, private val context: Context, @Main private val mainExecutor: DelayableExecutor, @Main private val mainImmediateDispatcher: CoroutineDispatcher, @Background private val bgExecutor: Executor, private val clockBuffers: ClockMessageBuffers, private val featureFlags: FeatureFlagsClassic, Loading Loading @@ -424,7 +426,7 @@ constructor( keyguardUpdateMonitor.registerCallback(keyguardUpdateMonitorCallback) zenModeController.addCallback(zenModeCallback) disposableHandle = parent.repeatWhenAttached { parent.repeatWhenAttached(mainImmediateDispatcher) { repeatOnLifecycle(Lifecycle.State.CREATED) { listenForDozing(this) if (MigrateClocksToBlueprint.isEnabled) { Loading Loading @@ -530,12 +532,14 @@ constructor( @VisibleForTesting internal fun listenForDozeAmount(scope: CoroutineScope): Job { return scope.launch { keyguardInteractor.dozeAmount.collect { handleDoze(it) } } return scope.launch("$TAG#listenForDozeAmount") { keyguardInteractor.dozeAmount.collect { handleDoze(it) } } } @VisibleForTesting internal fun listenForDozeAmountTransition(scope: CoroutineScope): Job { return scope.launch { return scope.launch("$TAG#listenForDozeAmountTransition") { merge( keyguardTransitionInteractor.aodToLockscreenTransition.map { step -> step.copy(value = 1f - step.value) Loading @@ -553,7 +557,7 @@ constructor( */ @VisibleForTesting internal fun listenForAnyStateToAodTransition(scope: CoroutineScope): Job { return scope.launch { return scope.launch("$TAG#listenForAnyStateToAodTransition") { keyguardTransitionInteractor .transitionStepsToState(AOD) .filter { it.transitionState == TransitionState.STARTED } Loading @@ -575,7 +579,7 @@ constructor( @VisibleForTesting internal fun listenForDozing(scope: CoroutineScope): Job { return scope.launch { return scope.launch("$TAG#listenForDozing") { combine( keyguardInteractor.dozeAmount, keyguardInteractor.isDozing, Loading Loading @@ -640,7 +644,7 @@ constructor( } companion object { private val TAG = ClockEventController::class.simpleName!! private val DOZE_TICKRATE_THRESHOLD = 0.99f private const val TAG = "ClockEventController" private const val DOZE_TICKRATE_THRESHOLD = 0.99f } } packages/SystemUI/src/com/android/systemui/doze/DozeLog.java +9 −0 Original line number Diff line number Diff line Loading @@ -208,6 +208,15 @@ public class DozeLog implements Dumpable { mLogger.logTimeTickScheduled(when, triggerAt); } /** * Logs cancelation requests for time ticks * @param isPending is an unschedule request pending? * @param isTimeTickScheduled is a time tick request scheduled */ public void tracePendingUnscheduleTimeTick(boolean isPending, boolean isTimeTickScheduled) { mLogger.logPendingUnscheduleTimeTick(isPending, isTimeTickScheduled); } /** * Appends keyguard visibility change event to the logs * @param showing whether the keyguard is now showing Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/BottomAreaSection.kt +4 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import androidx.core.content.res.ResourcesCompat import com.android.compose.animation.scene.ElementKey import com.android.compose.animation.scene.SceneScope import com.android.systemui.animation.view.LaunchableImageView import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.keyguard.ui.binder.KeyguardIndicationAreaBinder import com.android.systemui.keyguard.ui.binder.KeyguardQuickAffordanceViewBinder import com.android.systemui.keyguard.ui.view.KeyguardIndicationArea Loading @@ -43,6 +44,7 @@ import com.android.systemui.res.R import com.android.systemui.statusbar.KeyguardIndicationController import com.android.systemui.statusbar.VibratorHelper import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.DisposableHandle import kotlinx.coroutines.flow.Flow Loading @@ -54,6 +56,7 @@ constructor( private val vibratorHelper: VibratorHelper, private val indicationController: KeyguardIndicationController, private val indicationAreaViewModel: KeyguardIndicationAreaViewModel, @Main private val mainImmediateDispatcher: CoroutineDispatcher, ) { /** * Renders a single lockscreen shortcut. Loading Loading @@ -161,6 +164,7 @@ constructor( transitionAlpha, falsingManager, vibratorHelper, mainImmediateDispatcher, ) { indicationController.showTransientIndication(it) } 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 @@ -34,6 +34,7 @@ import com.android.keyguard.LockIconView import com.android.keyguard.LockIconViewController import com.android.systemui.biometrics.AuthController import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.deviceentry.shared.DeviceEntryUdfpsRefactor import com.android.systemui.flags.FeatureFlagsClassic import com.android.systemui.flags.Flags Loading @@ -50,12 +51,14 @@ import com.android.systemui.shade.NotificationPanelView 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 mainImmediateDispatcher: CoroutineDispatcher, private val windowManager: WindowManager, private val authController: AuthController, private val featureFlags: FeatureFlagsClassic, Loading Loading @@ -93,6 +96,7 @@ constructor( deviceEntryBackgroundViewModel.get(), falsingManager.get(), vibratorHelper.get(), mainImmediateDispatcher, ) } } else { Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt +4 −2 Original line number Diff line number Diff line Loading @@ -214,14 +214,16 @@ class KeyguardInteractorTest : SysuiTestCase() { ) repository.setStatusBarState(StatusBarState.KEYGUARD) shadeRepository.setLegacyShadeExpansion(1f) // User begins to swipe up shadeRepository.setLegacyShadeExpansion(0.99f) // When not dismissable, no alpha value (null) should emit repository.setKeyguardDismissible(false) assertThat(dismissAlpha).isNull() repository.setKeyguardDismissible(true) assertThat(dismissAlpha).isGreaterThan(0.95f) shadeRepository.setLegacyShadeExpansion(0.98f) assertThat(dismissAlpha).isGreaterThan(0.5f) } @Test Loading
packages/SystemUI/src/com/android/keyguard/ClockEventController.kt +12 −8 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.view.ViewTreeObserver.OnGlobalLayoutListener import androidx.annotation.VisibleForTesting import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.android.app.tracing.coroutines.launch import com.android.systemui.broadcast.BroadcastDispatcher import com.android.systemui.customization.R import com.android.systemui.dagger.qualifiers.Background Loading Loading @@ -65,6 +66,7 @@ import java.util.Locale import java.util.TimeZone import java.util.concurrent.Executor import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.DisposableHandle import kotlinx.coroutines.Job Loading @@ -72,7 +74,6 @@ import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.merge import kotlinx.coroutines.launch /** * Controller for a Clock provided by the registry and used on the keyguard. Instantiated by Loading @@ -90,6 +91,7 @@ constructor( @DisplaySpecific private val resources: Resources, private val context: Context, @Main private val mainExecutor: DelayableExecutor, @Main private val mainImmediateDispatcher: CoroutineDispatcher, @Background private val bgExecutor: Executor, private val clockBuffers: ClockMessageBuffers, private val featureFlags: FeatureFlagsClassic, Loading Loading @@ -424,7 +426,7 @@ constructor( keyguardUpdateMonitor.registerCallback(keyguardUpdateMonitorCallback) zenModeController.addCallback(zenModeCallback) disposableHandle = parent.repeatWhenAttached { parent.repeatWhenAttached(mainImmediateDispatcher) { repeatOnLifecycle(Lifecycle.State.CREATED) { listenForDozing(this) if (MigrateClocksToBlueprint.isEnabled) { Loading Loading @@ -530,12 +532,14 @@ constructor( @VisibleForTesting internal fun listenForDozeAmount(scope: CoroutineScope): Job { return scope.launch { keyguardInteractor.dozeAmount.collect { handleDoze(it) } } return scope.launch("$TAG#listenForDozeAmount") { keyguardInteractor.dozeAmount.collect { handleDoze(it) } } } @VisibleForTesting internal fun listenForDozeAmountTransition(scope: CoroutineScope): Job { return scope.launch { return scope.launch("$TAG#listenForDozeAmountTransition") { merge( keyguardTransitionInteractor.aodToLockscreenTransition.map { step -> step.copy(value = 1f - step.value) Loading @@ -553,7 +557,7 @@ constructor( */ @VisibleForTesting internal fun listenForAnyStateToAodTransition(scope: CoroutineScope): Job { return scope.launch { return scope.launch("$TAG#listenForAnyStateToAodTransition") { keyguardTransitionInteractor .transitionStepsToState(AOD) .filter { it.transitionState == TransitionState.STARTED } Loading @@ -575,7 +579,7 @@ constructor( @VisibleForTesting internal fun listenForDozing(scope: CoroutineScope): Job { return scope.launch { return scope.launch("$TAG#listenForDozing") { combine( keyguardInteractor.dozeAmount, keyguardInteractor.isDozing, Loading Loading @@ -640,7 +644,7 @@ constructor( } companion object { private val TAG = ClockEventController::class.simpleName!! private val DOZE_TICKRATE_THRESHOLD = 0.99f private const val TAG = "ClockEventController" private const val DOZE_TICKRATE_THRESHOLD = 0.99f } }
packages/SystemUI/src/com/android/systemui/doze/DozeLog.java +9 −0 Original line number Diff line number Diff line Loading @@ -208,6 +208,15 @@ public class DozeLog implements Dumpable { mLogger.logTimeTickScheduled(when, triggerAt); } /** * Logs cancelation requests for time ticks * @param isPending is an unschedule request pending? * @param isTimeTickScheduled is a time tick request scheduled */ public void tracePendingUnscheduleTimeTick(boolean isPending, boolean isTimeTickScheduled) { mLogger.logPendingUnscheduleTimeTick(isPending, isTimeTickScheduled); } /** * Appends keyguard visibility change event to the logs * @param showing whether the keyguard is now showing Loading