Loading packages/SystemUI/src/com/android/systemui/keyguard/WakefulnessLifecycle.java +7 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,7 @@ public class WakefulnessLifecycle extends Lifecycle<WakefulnessLifecycle.Observe } setWakefulness(WAKEFULNESS_AWAKE); dispatch(Observer::onFinishedWakingUp); dispatch(Observer::onPostFinishedWakingUp); } public void dispatchStartedGoingToSleep(@PowerManager.GoToSleepReason int pmSleepReason) { Loading Loading @@ -236,6 +237,12 @@ public class WakefulnessLifecycle extends Lifecycle<WakefulnessLifecycle.Observe public interface Observer { default void onStartedWakingUp() {} default void onFinishedWakingUp() {} /** * Called after the finished waking up call, ensuring it's after all the other listeners, * reacting to {@link #onFinishedWakingUp()} */ default void onPostFinishedWakingUp() {} default void onStartedGoingToSleep() {} default void onFinishedGoingToSleep() {} } Loading packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt +20 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ import android.animation.ValueAnimator import android.content.Context import android.content.res.Configuration import android.os.SystemClock import android.util.DisplayMetrics import android.util.IndentingPrintWriter import android.util.MathUtils import android.view.MotionEvent Loading @@ -24,6 +23,7 @@ import com.android.systemui.classifier.Classifier import com.android.systemui.classifier.FalsingCollector import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dump.DumpManager import com.android.systemui.keyguard.WakefulnessLifecycle import com.android.systemui.media.MediaHierarchyManager import com.android.systemui.plugins.ActivityStarter.OnDismissAction import com.android.systemui.plugins.FalsingManager Loading Loading @@ -64,6 +64,7 @@ class LockscreenShadeTransitionController @Inject constructor( private val scrimController: ScrimController, private val depthController: NotificationShadeDepthController, private val context: Context, wakefulnessLifecycle: WakefulnessLifecycle, configurationController: ConfigurationController, falsingManager: FalsingManager, dumpManager: DumpManager, Loading Loading @@ -119,6 +120,12 @@ class LockscreenShadeTransitionController @Inject constructor( */ private var nextHideKeyguardNeedsNoAnimation = false /** * Are we currently waking up to the shade locked */ var isWakingToShadeLocked: Boolean = false private set /** * The distance until we're showing the notifications when pulsing */ Loading Loading @@ -160,6 +167,13 @@ class LockscreenShadeTransitionController @Inject constructor( } } }) wakefulnessLifecycle.addObserver(object : WakefulnessLifecycle.Observer { override fun onPostFinishedWakingUp() { // when finishing waking up, the UnlockedScreenOffAnimation has another attempt // to reset keyguard. Let's do it in post isWakingToShadeLocked = false } }) } private fun updateResources() { Loading Loading @@ -488,6 +502,10 @@ class LockscreenShadeTransitionController @Inject constructor( draggedDownEntry = entry } else { logger.logGoingToLockedShade(animationHandler != null) if (statusBarStateController.isDozing) { // Make sure we don't go back to keyguard immediately again after waking up isWakingToShadeLocked = true } statusBarStateController.setState(StatusBarState.SHADE_LOCKED) // This call needs to be after updating the shade state since otherwise // the scrimstate resets too early Loading Loading @@ -598,6 +616,7 @@ class LockscreenShadeTransitionController @Inject constructor( it.println("dragDownAmount: $dragDownAmount") it.println("isDragDownAnywhereEnabled: $isDragDownAnywhereEnabled") it.println("isFalsingCheckNeeded: $isFalsingCheckNeeded") it.println("isWakingToShadeLocked: $isWakingToShadeLocked") it.println("hasPendingHandlerOnKeyguardDismiss: " + "${animationHandlerOnKeyguardDismiss != null}") } Loading packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt +0 −8 Original line number Diff line number Diff line Loading @@ -107,8 +107,6 @@ constructor( private var mDraggedFarEnough: Boolean = false private var mStartingChild: ExpandableView? = null private var mPulsing: Boolean = false var isWakingToShadeLocked: Boolean = false private set private var velocityTracker: VelocityTracker? = null Loading Loading @@ -235,7 +233,6 @@ constructor( mStartingChild = null } if (statusBarStateController.isDozing) { isWakingToShadeLocked = true wakeUpCoordinator.willWakeUp = true mPowerManager!!.wakeUp(SystemClock.uptimeMillis(), WAKE_REASON_GESTURE, "com.android.systemui:PULSEDRAG") Loading Loading @@ -333,10 +330,6 @@ constructor( mPulsing = pulsing } fun onStartedWakingUp() { isWakingToShadeLocked = false } override fun dump(fd: FileDescriptor, pw: PrintWriter, args: Array<out String>) { IndentingPrintWriter(pw, " ").let { it.println("PulseExpansionHandler:") Loading @@ -344,7 +337,6 @@ constructor( it.println("isExpanding: $isExpanding") it.println("leavingLockscreen: $leavingLockscreen") it.println("mPulsing: $mPulsing") it.println("isWakingToShadeLocked: $isWakingToShadeLocked") it.println("qsExpanded: $qsExpanded") it.println("bouncerShowing: $bouncerShowing") } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +1 −2 Original line number Diff line number Diff line Loading @@ -2965,7 +2965,7 @@ public class StatusBar extends SystemUI implements mMessageRouter.cancelMessages(MSG_LAUNCH_TRANSITION_TIMEOUT); if (mUserSwitcherController != null && mUserSwitcherController.useFullscreenUserSwitcher()) { mStatusBarStateController.setState(StatusBarState.FULLSCREEN_USER_SWITCHER); } else if (!mPulseExpansionHandler.isWakingToShadeLocked()) { } else if (!mLockscreenShadeTransitionController.isWakingToShadeLocked()) { mStatusBarStateController.setState(StatusBarState.KEYGUARD); } updatePanelExpansionForKeyguard(); Loading Loading @@ -3570,7 +3570,6 @@ public class StatusBar extends SystemUI implements // once we fully woke up. updateRevealEffect(true /* wakingUp */); updateNotificationPanelTouchState(); mPulseExpansionHandler.onStartedWakingUp(); // If we are waking up during the screen off animation, we should undo making the // expanded visible (we did that so the LightRevealScrim would be visible). Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/WakefulnessLifecycleTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ public class WakefulnessLifecycleTest extends SysuiTestCase { assertEquals(WakefulnessLifecycle.WAKEFULNESS_AWAKE, mWakefulness.getWakefulness()); verify(mWakefulnessObserver).onFinishedWakingUp(); verify(mWakefulnessObserver).onPostFinishedWakingUp(); } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/WakefulnessLifecycle.java +7 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,7 @@ public class WakefulnessLifecycle extends Lifecycle<WakefulnessLifecycle.Observe } setWakefulness(WAKEFULNESS_AWAKE); dispatch(Observer::onFinishedWakingUp); dispatch(Observer::onPostFinishedWakingUp); } public void dispatchStartedGoingToSleep(@PowerManager.GoToSleepReason int pmSleepReason) { Loading Loading @@ -236,6 +237,12 @@ public class WakefulnessLifecycle extends Lifecycle<WakefulnessLifecycle.Observe public interface Observer { default void onStartedWakingUp() {} default void onFinishedWakingUp() {} /** * Called after the finished waking up call, ensuring it's after all the other listeners, * reacting to {@link #onFinishedWakingUp()} */ default void onPostFinishedWakingUp() {} default void onStartedGoingToSleep() {} default void onFinishedGoingToSleep() {} } Loading
packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt +20 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ import android.animation.ValueAnimator import android.content.Context import android.content.res.Configuration import android.os.SystemClock import android.util.DisplayMetrics import android.util.IndentingPrintWriter import android.util.MathUtils import android.view.MotionEvent Loading @@ -24,6 +23,7 @@ import com.android.systemui.classifier.Classifier import com.android.systemui.classifier.FalsingCollector import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dump.DumpManager import com.android.systemui.keyguard.WakefulnessLifecycle import com.android.systemui.media.MediaHierarchyManager import com.android.systemui.plugins.ActivityStarter.OnDismissAction import com.android.systemui.plugins.FalsingManager Loading Loading @@ -64,6 +64,7 @@ class LockscreenShadeTransitionController @Inject constructor( private val scrimController: ScrimController, private val depthController: NotificationShadeDepthController, private val context: Context, wakefulnessLifecycle: WakefulnessLifecycle, configurationController: ConfigurationController, falsingManager: FalsingManager, dumpManager: DumpManager, Loading Loading @@ -119,6 +120,12 @@ class LockscreenShadeTransitionController @Inject constructor( */ private var nextHideKeyguardNeedsNoAnimation = false /** * Are we currently waking up to the shade locked */ var isWakingToShadeLocked: Boolean = false private set /** * The distance until we're showing the notifications when pulsing */ Loading Loading @@ -160,6 +167,13 @@ class LockscreenShadeTransitionController @Inject constructor( } } }) wakefulnessLifecycle.addObserver(object : WakefulnessLifecycle.Observer { override fun onPostFinishedWakingUp() { // when finishing waking up, the UnlockedScreenOffAnimation has another attempt // to reset keyguard. Let's do it in post isWakingToShadeLocked = false } }) } private fun updateResources() { Loading Loading @@ -488,6 +502,10 @@ class LockscreenShadeTransitionController @Inject constructor( draggedDownEntry = entry } else { logger.logGoingToLockedShade(animationHandler != null) if (statusBarStateController.isDozing) { // Make sure we don't go back to keyguard immediately again after waking up isWakingToShadeLocked = true } statusBarStateController.setState(StatusBarState.SHADE_LOCKED) // This call needs to be after updating the shade state since otherwise // the scrimstate resets too early Loading Loading @@ -598,6 +616,7 @@ class LockscreenShadeTransitionController @Inject constructor( it.println("dragDownAmount: $dragDownAmount") it.println("isDragDownAnywhereEnabled: $isDragDownAnywhereEnabled") it.println("isFalsingCheckNeeded: $isFalsingCheckNeeded") it.println("isWakingToShadeLocked: $isWakingToShadeLocked") it.println("hasPendingHandlerOnKeyguardDismiss: " + "${animationHandlerOnKeyguardDismiss != null}") } Loading
packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt +0 −8 Original line number Diff line number Diff line Loading @@ -107,8 +107,6 @@ constructor( private var mDraggedFarEnough: Boolean = false private var mStartingChild: ExpandableView? = null private var mPulsing: Boolean = false var isWakingToShadeLocked: Boolean = false private set private var velocityTracker: VelocityTracker? = null Loading Loading @@ -235,7 +233,6 @@ constructor( mStartingChild = null } if (statusBarStateController.isDozing) { isWakingToShadeLocked = true wakeUpCoordinator.willWakeUp = true mPowerManager!!.wakeUp(SystemClock.uptimeMillis(), WAKE_REASON_GESTURE, "com.android.systemui:PULSEDRAG") Loading Loading @@ -333,10 +330,6 @@ constructor( mPulsing = pulsing } fun onStartedWakingUp() { isWakingToShadeLocked = false } override fun dump(fd: FileDescriptor, pw: PrintWriter, args: Array<out String>) { IndentingPrintWriter(pw, " ").let { it.println("PulseExpansionHandler:") Loading @@ -344,7 +337,6 @@ constructor( it.println("isExpanding: $isExpanding") it.println("leavingLockscreen: $leavingLockscreen") it.println("mPulsing: $mPulsing") it.println("isWakingToShadeLocked: $isWakingToShadeLocked") it.println("qsExpanded: $qsExpanded") it.println("bouncerShowing: $bouncerShowing") } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +1 −2 Original line number Diff line number Diff line Loading @@ -2965,7 +2965,7 @@ public class StatusBar extends SystemUI implements mMessageRouter.cancelMessages(MSG_LAUNCH_TRANSITION_TIMEOUT); if (mUserSwitcherController != null && mUserSwitcherController.useFullscreenUserSwitcher()) { mStatusBarStateController.setState(StatusBarState.FULLSCREEN_USER_SWITCHER); } else if (!mPulseExpansionHandler.isWakingToShadeLocked()) { } else if (!mLockscreenShadeTransitionController.isWakingToShadeLocked()) { mStatusBarStateController.setState(StatusBarState.KEYGUARD); } updatePanelExpansionForKeyguard(); Loading Loading @@ -3570,7 +3570,6 @@ public class StatusBar extends SystemUI implements // once we fully woke up. updateRevealEffect(true /* wakingUp */); updateNotificationPanelTouchState(); mPulseExpansionHandler.onStartedWakingUp(); // If we are waking up during the screen off animation, we should undo making the // expanded visible (we did that so the LightRevealScrim would be visible). Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/WakefulnessLifecycleTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ public class WakefulnessLifecycleTest extends SysuiTestCase { assertEquals(WakefulnessLifecycle.WAKEFULNESS_AWAKE, mWakefulness.getWakefulness()); verify(mWakefulnessObserver).onFinishedWakingUp(); verify(mWakefulnessObserver).onPostFinishedWakingUp(); } @Test Loading