Loading packages/SystemUI/src/com/android/keyguard/FaceWakeUpTriggersConfig.kt +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ import com.android.systemui.res.R import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.dump.DumpManager import com.android.systemui.keyguard.shared.model.WakeSleepReason import com.android.systemui.power.shared.model.WakeSleepReason import com.android.systemui.util.settings.GlobalSettings import java.io.PrintWriter import java.util.stream.Collectors Loading packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +12 −9 Original line number Diff line number Diff line Loading @@ -55,9 +55,9 @@ import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor; import com.android.systemui.keyguard.shared.model.ScreenModel; import com.android.systemui.keyguard.shared.model.ScreenState; import com.android.systemui.power.shared.model.ScreenPowerState; import com.android.systemui.plugins.ClockController; import com.android.systemui.power.domain.interactor.PowerInteractor; import com.android.systemui.statusbar.notification.AnimatableProperty; import com.android.systemui.statusbar.notification.PropertyAnimator; import com.android.systemui.statusbar.notification.stack.AnimationProperties; Loading @@ -68,13 +68,13 @@ import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.util.ViewController; import kotlin.coroutines.CoroutineContext; import kotlin.coroutines.EmptyCoroutineContext; import java.io.PrintWriter; import javax.inject.Inject; import kotlin.coroutines.CoroutineContext; import kotlin.coroutines.EmptyCoroutineContext; /** * Injectable controller for {@link KeyguardStatusView}. */ Loading @@ -101,6 +101,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV private final InteractionJankMonitor mInteractionJankMonitor; private final Rect mClipBounds = new Rect(); private final KeyguardInteractor mKeyguardInteractor; private final PowerInteractor mPowerInteractor; private Boolean mSplitShadeEnabled = false; private Boolean mStatusViewCentered = true; Loading Loading @@ -134,7 +135,8 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV FeatureFlags featureFlags, InteractionJankMonitor interactionJankMonitor, KeyguardInteractor keyguardInteractor, DumpManager dumpManager) { DumpManager dumpManager, PowerInteractor powerInteractor) { super(keyguardStatusView); mKeyguardSliceViewController = keyguardSliceViewController; mKeyguardClockSwitchController = keyguardClockSwitchController; Loading @@ -147,6 +149,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV mFeatureFlags = featureFlags; mDumpManager = dumpManager; mKeyguardInteractor = keyguardInteractor; mPowerInteractor = powerInteractor; } @Override Loading Loading @@ -207,9 +210,9 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV dozeTimeTick(); }, context); collectFlow(mView, mKeyguardInteractor.getScreenModel(), (ScreenModel model) -> { if (model.getState() == ScreenState.SCREEN_TURNING_ON) { collectFlow(mView, mPowerInteractor.getScreenPowerState(), (ScreenPowerState powerState) -> { if (powerState == ScreenPowerState.SCREEN_TURNING_ON) { dozeTimeTick(); } }, context); Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +14 −1 Original line number Diff line number Diff line Loading @@ -76,11 +76,13 @@ import com.android.systemui.SystemUIApplication; import com.android.systemui.dagger.qualifiers.Application; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.power.shared.model.ScreenPowerState; import com.android.systemui.keyguard.ui.binder.KeyguardSurfaceBehindParamsApplier; import com.android.systemui.keyguard.ui.binder.KeyguardSurfaceBehindViewBinder; import com.android.systemui.keyguard.ui.binder.WindowManagerLockscreenVisibilityViewBinder; import com.android.systemui.keyguard.ui.viewmodel.KeyguardSurfaceBehindViewModel; import com.android.systemui.keyguard.ui.viewmodel.WindowManagerLockscreenVisibilityViewModel; import com.android.systemui.power.domain.interactor.PowerInteractor; import com.android.systemui.settings.DisplayTracker; import com.android.wm.shell.transition.ShellTransitions; import com.android.wm.shell.transition.Transitions; Loading @@ -105,6 +107,7 @@ public class KeyguardService extends Service { private final ScreenOnCoordinator mScreenOnCoordinator; private final ShellTransitions mShellTransitions; private final DisplayTracker mDisplayTracker; private PowerInteractor mPowerInteractor; private static int newModeToLegacyMode(int newMode) { switch (newMode) { Loading Loading @@ -309,7 +312,8 @@ public class KeyguardService extends Service { KeyguardSurfaceBehindViewModel keyguardSurfaceBehindViewModel, KeyguardSurfaceBehindParamsApplier keyguardSurfaceBehindAnimator, @Application CoroutineScope scope, FeatureFlags featureFlags) { FeatureFlags featureFlags, PowerInteractor powerInteractor) { super(); mKeyguardViewMediator = keyguardViewMediator; mKeyguardLifecyclesDispatcher = keyguardLifecyclesDispatcher; Loading @@ -317,6 +321,7 @@ public class KeyguardService extends Service { mShellTransitions = shellTransitions; mDisplayTracker = displayTracker; mFlags = featureFlags; mPowerInteractor = powerInteractor; if (mFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) { WindowManagerLockscreenVisibilityViewBinder.bind( Loading Loading @@ -451,6 +456,7 @@ public class KeyguardService extends Service { checkPermission(); mKeyguardViewMediator.onStartedGoingToSleep( WindowManagerPolicyConstants.translateSleepReasonToOffReason(pmSleepReason)); mPowerInteractor.onStartedGoingToSleep(pmSleepReason); mKeyguardLifecyclesDispatcher.dispatch( KeyguardLifecyclesDispatcher.STARTED_GOING_TO_SLEEP, pmSleepReason); } Loading @@ -464,6 +470,7 @@ public class KeyguardService extends Service { mKeyguardViewMediator.onFinishedGoingToSleep( WindowManagerPolicyConstants.translateSleepReasonToOffReason(pmSleepReason), cameraGestureTriggered); mPowerInteractor.onFinishedGoingToSleep(cameraGestureTriggered); mKeyguardLifecyclesDispatcher.dispatch( KeyguardLifecyclesDispatcher.FINISHED_GOING_TO_SLEEP); } Loading @@ -476,6 +483,7 @@ public class KeyguardService extends Service { Trace.beginSection("KeyguardService.mBinder#onStartedWakingUp"); checkPermission(); mKeyguardViewMediator.onStartedWakingUp(pmWakeReason, cameraGestureTriggered); mPowerInteractor.onStartedWakingUp(pmWakeReason, cameraGestureTriggered); mKeyguardLifecyclesDispatcher.dispatch( KeyguardLifecyclesDispatcher.STARTED_WAKING_UP, pmWakeReason); Trace.endSection(); Loading @@ -486,6 +494,7 @@ public class KeyguardService extends Service { trace("onFinishedWakingUp"); Trace.beginSection("KeyguardService.mBinder#onFinishedWakingUp"); checkPermission(); mPowerInteractor.onFinishedWakingUp(); mKeyguardLifecyclesDispatcher.dispatch(KeyguardLifecyclesDispatcher.FINISHED_WAKING_UP); Trace.endSection(); } Loading @@ -495,6 +504,7 @@ public class KeyguardService extends Service { trace("onScreenTurningOn"); Trace.beginSection("KeyguardService.mBinder#onScreenTurningOn"); checkPermission(); mPowerInteractor.onScreenPowerStateUpdated(ScreenPowerState.SCREEN_TURNING_ON); mKeyguardLifecyclesDispatcher.dispatch(KeyguardLifecyclesDispatcher.SCREEN_TURNING_ON, callback); Loading Loading @@ -530,6 +540,7 @@ public class KeyguardService extends Service { trace("onScreenTurnedOn"); Trace.beginSection("KeyguardService.mBinder#onScreenTurnedOn"); checkPermission(); mPowerInteractor.onScreenPowerStateUpdated(ScreenPowerState.SCREEN_ON); mKeyguardLifecyclesDispatcher.dispatch(KeyguardLifecyclesDispatcher.SCREEN_TURNED_ON); mScreenOnCoordinator.onScreenTurnedOn(); Trace.endSection(); Loading @@ -539,6 +550,7 @@ public class KeyguardService extends Service { public void onScreenTurningOff() { trace("onScreenTurningOff"); checkPermission(); mPowerInteractor.onScreenPowerStateUpdated(ScreenPowerState.SCREEN_TURNING_OFF); mKeyguardLifecyclesDispatcher.dispatch(KeyguardLifecyclesDispatcher.SCREEN_TURNING_OFF); } Loading @@ -546,6 +558,7 @@ public class KeyguardService extends Service { public void onScreenTurnedOff() { trace("onScreenTurnedOff"); checkPermission(); mPowerInteractor.onScreenPowerStateUpdated(ScreenPowerState.SCREEN_OFF); mKeyguardViewMediator.onScreenTurnedOff(); mKeyguardLifecyclesDispatcher.dispatch(KeyguardLifecyclesDispatcher.SCREEN_TURNED_OFF); mScreenOnCoordinator.onScreenTurnedOff(); Loading packages/SystemUI/src/com/android/systemui/keyguard/ResourceTrimmer.kt +10 −9 Original line number Diff line number Diff line Loading @@ -30,15 +30,15 @@ import com.android.systemui.flags.Flags import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor import com.android.systemui.keyguard.shared.model.TransitionState import com.android.systemui.keyguard.shared.model.WakefulnessState import com.android.systemui.power.domain.interactor.PowerInteractor import com.android.systemui.utils.GlobalWindowManager import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch import javax.inject.Inject /** * Releases cached resources on allocated by keyguard. Loading @@ -52,6 +52,7 @@ class ResourceTrimmer @Inject constructor( private val keyguardInteractor: KeyguardInteractor, private val powerInteractor: PowerInteractor, private val keyguardTransitionInteractor: KeyguardTransitionInteractor, private val globalWindowManager: GlobalWindowManager, @Application private val applicationScope: CoroutineScope, Loading @@ -70,7 +71,7 @@ constructor( val isDozingFully = keyguardInteractor.dozeAmount.map { it == 1f }.distinctUntilChanged() combine( keyguardInteractor.wakefulnessModel.map { it.state }, powerInteractor.isAsleep, keyguardInteractor.isDreaming, isDozingFully, ::Triple Loading Loading @@ -106,7 +107,7 @@ constructor( @WorkerThread private fun onWakefulnessUpdated( wakefulness: WakefulnessState, isAsleep: Boolean, isDreaming: Boolean, isDozingFully: Boolean ) { Loading @@ -117,7 +118,7 @@ constructor( if (DEBUG) { Log.d( LOG_TAG, "Wakefulness: $wakefulness Dreaming: $isDreaming DozeAmount: $isDozingFully" "isAsleep: $isAsleep Dreaming: $isDreaming DozeAmount: $isDozingFully" ) } // There are three scenarios: Loading @@ -127,9 +128,9 @@ constructor( // to 1f // * AoD - where we go to ASLEEP with iDreaming = true and dozeAmount slowly increases // to 1f val dozeDisabledAndScreenOff = wakefulness == WakefulnessState.ASLEEP && !isDreaming val dozeDisabledAndScreenOff = isAsleep && !isDreaming val dozeEnabledAndDozeAnimationCompleted = wakefulness == WakefulnessState.ASLEEP && isDreaming && isDozingFully isAsleep && isDreaming && isDozingFully if (dozeDisabledAndScreenOff || dozeEnabledAndDozeAnimationCompleted) { Trace.beginSection("ResourceTrimmer#trimMemory") Log.d(LOG_TAG, "SysUI asleep, trimming memory.") Loading packages/SystemUI/src/com/android/systemui/keyguard/ScreenLifecycle.java +4 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.os.Trace; import com.android.systemui.Dumpable; import com.android.systemui.dump.DumpManager; import com.android.systemui.power.domain.interactor.PowerInteractor; import java.io.PrintWriter; Loading @@ -28,8 +29,11 @@ import javax.inject.Singleton; /** * Tracks the screen lifecycle. * * @deprecated Collect flows from {@link PowerInteractor} instead. */ @Singleton @Deprecated public class ScreenLifecycle extends Lifecycle<ScreenLifecycle.Observer> implements Dumpable { public static final int SCREEN_OFF = 0; Loading Loading
packages/SystemUI/src/com/android/keyguard/FaceWakeUpTriggersConfig.kt +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ import com.android.systemui.res.R import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.dump.DumpManager import com.android.systemui.keyguard.shared.model.WakeSleepReason import com.android.systemui.power.shared.model.WakeSleepReason import com.android.systemui.util.settings.GlobalSettings import java.io.PrintWriter import java.util.stream.Collectors Loading
packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +12 −9 Original line number Diff line number Diff line Loading @@ -55,9 +55,9 @@ import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor; import com.android.systemui.keyguard.shared.model.ScreenModel; import com.android.systemui.keyguard.shared.model.ScreenState; import com.android.systemui.power.shared.model.ScreenPowerState; import com.android.systemui.plugins.ClockController; import com.android.systemui.power.domain.interactor.PowerInteractor; import com.android.systemui.statusbar.notification.AnimatableProperty; import com.android.systemui.statusbar.notification.PropertyAnimator; import com.android.systemui.statusbar.notification.stack.AnimationProperties; Loading @@ -68,13 +68,13 @@ import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.util.ViewController; import kotlin.coroutines.CoroutineContext; import kotlin.coroutines.EmptyCoroutineContext; import java.io.PrintWriter; import javax.inject.Inject; import kotlin.coroutines.CoroutineContext; import kotlin.coroutines.EmptyCoroutineContext; /** * Injectable controller for {@link KeyguardStatusView}. */ Loading @@ -101,6 +101,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV private final InteractionJankMonitor mInteractionJankMonitor; private final Rect mClipBounds = new Rect(); private final KeyguardInteractor mKeyguardInteractor; private final PowerInteractor mPowerInteractor; private Boolean mSplitShadeEnabled = false; private Boolean mStatusViewCentered = true; Loading Loading @@ -134,7 +135,8 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV FeatureFlags featureFlags, InteractionJankMonitor interactionJankMonitor, KeyguardInteractor keyguardInteractor, DumpManager dumpManager) { DumpManager dumpManager, PowerInteractor powerInteractor) { super(keyguardStatusView); mKeyguardSliceViewController = keyguardSliceViewController; mKeyguardClockSwitchController = keyguardClockSwitchController; Loading @@ -147,6 +149,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV mFeatureFlags = featureFlags; mDumpManager = dumpManager; mKeyguardInteractor = keyguardInteractor; mPowerInteractor = powerInteractor; } @Override Loading Loading @@ -207,9 +210,9 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV dozeTimeTick(); }, context); collectFlow(mView, mKeyguardInteractor.getScreenModel(), (ScreenModel model) -> { if (model.getState() == ScreenState.SCREEN_TURNING_ON) { collectFlow(mView, mPowerInteractor.getScreenPowerState(), (ScreenPowerState powerState) -> { if (powerState == ScreenPowerState.SCREEN_TURNING_ON) { dozeTimeTick(); } }, context); Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +14 −1 Original line number Diff line number Diff line Loading @@ -76,11 +76,13 @@ import com.android.systemui.SystemUIApplication; import com.android.systemui.dagger.qualifiers.Application; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.power.shared.model.ScreenPowerState; import com.android.systemui.keyguard.ui.binder.KeyguardSurfaceBehindParamsApplier; import com.android.systemui.keyguard.ui.binder.KeyguardSurfaceBehindViewBinder; import com.android.systemui.keyguard.ui.binder.WindowManagerLockscreenVisibilityViewBinder; import com.android.systemui.keyguard.ui.viewmodel.KeyguardSurfaceBehindViewModel; import com.android.systemui.keyguard.ui.viewmodel.WindowManagerLockscreenVisibilityViewModel; import com.android.systemui.power.domain.interactor.PowerInteractor; import com.android.systemui.settings.DisplayTracker; import com.android.wm.shell.transition.ShellTransitions; import com.android.wm.shell.transition.Transitions; Loading @@ -105,6 +107,7 @@ public class KeyguardService extends Service { private final ScreenOnCoordinator mScreenOnCoordinator; private final ShellTransitions mShellTransitions; private final DisplayTracker mDisplayTracker; private PowerInteractor mPowerInteractor; private static int newModeToLegacyMode(int newMode) { switch (newMode) { Loading Loading @@ -309,7 +312,8 @@ public class KeyguardService extends Service { KeyguardSurfaceBehindViewModel keyguardSurfaceBehindViewModel, KeyguardSurfaceBehindParamsApplier keyguardSurfaceBehindAnimator, @Application CoroutineScope scope, FeatureFlags featureFlags) { FeatureFlags featureFlags, PowerInteractor powerInteractor) { super(); mKeyguardViewMediator = keyguardViewMediator; mKeyguardLifecyclesDispatcher = keyguardLifecyclesDispatcher; Loading @@ -317,6 +321,7 @@ public class KeyguardService extends Service { mShellTransitions = shellTransitions; mDisplayTracker = displayTracker; mFlags = featureFlags; mPowerInteractor = powerInteractor; if (mFlags.isEnabled(Flags.KEYGUARD_WM_STATE_REFACTOR)) { WindowManagerLockscreenVisibilityViewBinder.bind( Loading Loading @@ -451,6 +456,7 @@ public class KeyguardService extends Service { checkPermission(); mKeyguardViewMediator.onStartedGoingToSleep( WindowManagerPolicyConstants.translateSleepReasonToOffReason(pmSleepReason)); mPowerInteractor.onStartedGoingToSleep(pmSleepReason); mKeyguardLifecyclesDispatcher.dispatch( KeyguardLifecyclesDispatcher.STARTED_GOING_TO_SLEEP, pmSleepReason); } Loading @@ -464,6 +470,7 @@ public class KeyguardService extends Service { mKeyguardViewMediator.onFinishedGoingToSleep( WindowManagerPolicyConstants.translateSleepReasonToOffReason(pmSleepReason), cameraGestureTriggered); mPowerInteractor.onFinishedGoingToSleep(cameraGestureTriggered); mKeyguardLifecyclesDispatcher.dispatch( KeyguardLifecyclesDispatcher.FINISHED_GOING_TO_SLEEP); } Loading @@ -476,6 +483,7 @@ public class KeyguardService extends Service { Trace.beginSection("KeyguardService.mBinder#onStartedWakingUp"); checkPermission(); mKeyguardViewMediator.onStartedWakingUp(pmWakeReason, cameraGestureTriggered); mPowerInteractor.onStartedWakingUp(pmWakeReason, cameraGestureTriggered); mKeyguardLifecyclesDispatcher.dispatch( KeyguardLifecyclesDispatcher.STARTED_WAKING_UP, pmWakeReason); Trace.endSection(); Loading @@ -486,6 +494,7 @@ public class KeyguardService extends Service { trace("onFinishedWakingUp"); Trace.beginSection("KeyguardService.mBinder#onFinishedWakingUp"); checkPermission(); mPowerInteractor.onFinishedWakingUp(); mKeyguardLifecyclesDispatcher.dispatch(KeyguardLifecyclesDispatcher.FINISHED_WAKING_UP); Trace.endSection(); } Loading @@ -495,6 +504,7 @@ public class KeyguardService extends Service { trace("onScreenTurningOn"); Trace.beginSection("KeyguardService.mBinder#onScreenTurningOn"); checkPermission(); mPowerInteractor.onScreenPowerStateUpdated(ScreenPowerState.SCREEN_TURNING_ON); mKeyguardLifecyclesDispatcher.dispatch(KeyguardLifecyclesDispatcher.SCREEN_TURNING_ON, callback); Loading Loading @@ -530,6 +540,7 @@ public class KeyguardService extends Service { trace("onScreenTurnedOn"); Trace.beginSection("KeyguardService.mBinder#onScreenTurnedOn"); checkPermission(); mPowerInteractor.onScreenPowerStateUpdated(ScreenPowerState.SCREEN_ON); mKeyguardLifecyclesDispatcher.dispatch(KeyguardLifecyclesDispatcher.SCREEN_TURNED_ON); mScreenOnCoordinator.onScreenTurnedOn(); Trace.endSection(); Loading @@ -539,6 +550,7 @@ public class KeyguardService extends Service { public void onScreenTurningOff() { trace("onScreenTurningOff"); checkPermission(); mPowerInteractor.onScreenPowerStateUpdated(ScreenPowerState.SCREEN_TURNING_OFF); mKeyguardLifecyclesDispatcher.dispatch(KeyguardLifecyclesDispatcher.SCREEN_TURNING_OFF); } Loading @@ -546,6 +558,7 @@ public class KeyguardService extends Service { public void onScreenTurnedOff() { trace("onScreenTurnedOff"); checkPermission(); mPowerInteractor.onScreenPowerStateUpdated(ScreenPowerState.SCREEN_OFF); mKeyguardViewMediator.onScreenTurnedOff(); mKeyguardLifecyclesDispatcher.dispatch(KeyguardLifecyclesDispatcher.SCREEN_TURNED_OFF); mScreenOnCoordinator.onScreenTurnedOff(); Loading
packages/SystemUI/src/com/android/systemui/keyguard/ResourceTrimmer.kt +10 −9 Original line number Diff line number Diff line Loading @@ -30,15 +30,15 @@ import com.android.systemui.flags.Flags import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor import com.android.systemui.keyguard.shared.model.TransitionState import com.android.systemui.keyguard.shared.model.WakefulnessState import com.android.systemui.power.domain.interactor.PowerInteractor import com.android.systemui.utils.GlobalWindowManager import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch import javax.inject.Inject /** * Releases cached resources on allocated by keyguard. Loading @@ -52,6 +52,7 @@ class ResourceTrimmer @Inject constructor( private val keyguardInteractor: KeyguardInteractor, private val powerInteractor: PowerInteractor, private val keyguardTransitionInteractor: KeyguardTransitionInteractor, private val globalWindowManager: GlobalWindowManager, @Application private val applicationScope: CoroutineScope, Loading @@ -70,7 +71,7 @@ constructor( val isDozingFully = keyguardInteractor.dozeAmount.map { it == 1f }.distinctUntilChanged() combine( keyguardInteractor.wakefulnessModel.map { it.state }, powerInteractor.isAsleep, keyguardInteractor.isDreaming, isDozingFully, ::Triple Loading Loading @@ -106,7 +107,7 @@ constructor( @WorkerThread private fun onWakefulnessUpdated( wakefulness: WakefulnessState, isAsleep: Boolean, isDreaming: Boolean, isDozingFully: Boolean ) { Loading @@ -117,7 +118,7 @@ constructor( if (DEBUG) { Log.d( LOG_TAG, "Wakefulness: $wakefulness Dreaming: $isDreaming DozeAmount: $isDozingFully" "isAsleep: $isAsleep Dreaming: $isDreaming DozeAmount: $isDozingFully" ) } // There are three scenarios: Loading @@ -127,9 +128,9 @@ constructor( // to 1f // * AoD - where we go to ASLEEP with iDreaming = true and dozeAmount slowly increases // to 1f val dozeDisabledAndScreenOff = wakefulness == WakefulnessState.ASLEEP && !isDreaming val dozeDisabledAndScreenOff = isAsleep && !isDreaming val dozeEnabledAndDozeAnimationCompleted = wakefulness == WakefulnessState.ASLEEP && isDreaming && isDozingFully isAsleep && isDreaming && isDozingFully if (dozeDisabledAndScreenOff || dozeEnabledAndDozeAnimationCompleted) { Trace.beginSection("ResourceTrimmer#trimMemory") Log.d(LOG_TAG, "SysUI asleep, trimming memory.") Loading
packages/SystemUI/src/com/android/systemui/keyguard/ScreenLifecycle.java +4 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.os.Trace; import com.android.systemui.Dumpable; import com.android.systemui.dump.DumpManager; import com.android.systemui.power.domain.interactor.PowerInteractor; import java.io.PrintWriter; Loading @@ -28,8 +29,11 @@ import javax.inject.Singleton; /** * Tracks the screen lifecycle. * * @deprecated Collect flows from {@link PowerInteractor} instead. */ @Singleton @Deprecated public class ScreenLifecycle extends Lifecycle<ScreenLifecycle.Observer> implements Dumpable { public static final int SCREEN_OFF = 0; Loading