Loading quickstep/src/com/android/quickstep/TouchInteractionService.java +7 −2 Original line number Diff line number Diff line Loading @@ -607,6 +607,9 @@ public class TouchInteractionService extends Service { this::createFallbackSwipeHandler; private final AbsSwipeUpHandler.Factory mRecentsWindowSwipeHandlerFactory = this::createRecentsWindowSwipeHandler; // This needs to be a member to be queued and potentially removed later if the service is // destroyed before the user is unlocked private final Runnable mUserUnlockedRunnable = this::onUserUnlocked; private final ScreenOnTracker.ScreenOnListener mScreenOnListener = this::onScreenOnChanged; Loading Loading @@ -678,8 +681,7 @@ public class TouchInteractionService extends Service { mInputConsumer = InputConsumerController.getRecentsAnimationInputConsumer(); // Call runOnUserUnlocked() before any other callbacks to ensure everything is initialized. LockedUserState.get(this).runOnUserUnlocked(this::onUserUnlocked); LockedUserState.get(this).runOnUserUnlocked(mTaskbarManager::onUserUnlocked); LockedUserState.get(this).runOnUserUnlocked(mUserUnlockedRunnable); mDeviceState.addNavigationModeChangedCallback(this::onNavigationModeChanged); sConnected = true; Loading Loading @@ -746,6 +748,8 @@ public class TouchInteractionService extends Service { mOverviewComponentObserver.setOverviewChangeListener(this::onOverviewTargetChange); onOverviewTargetChange(mOverviewComponentObserver.isHomeAndOverviewSame()); mTaskbarManager.onUserUnlocked(); } public OverviewCommandHelper getOverviewCommandHelper() { Loading Loading @@ -836,6 +840,7 @@ public class TouchInteractionService extends Service { mDesktopVisibilityController.onDestroy(); sConnected = false; LockedUserState.get(this).removeOnUserUnlockedRunnable(mUserUnlockedRunnable); ScreenOnTracker.INSTANCE.get(this).removeListener(mScreenOnListener); super.onDestroy(); } Loading src/com/android/launcher3/util/LockedUserState.kt +7 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,13 @@ class LockedUserState(private val mContext: Context) : SafeCloseable { mUserUnlockedActions.add(action) } /** * Removes a previously queued `Runnable` to be run when the user is unlocked. */ fun removeOnUserUnlockedRunnable(action: Runnable) { mUserUnlockedActions.remove(action) } companion object { @VisibleForTesting @JvmField Loading Loading
quickstep/src/com/android/quickstep/TouchInteractionService.java +7 −2 Original line number Diff line number Diff line Loading @@ -607,6 +607,9 @@ public class TouchInteractionService extends Service { this::createFallbackSwipeHandler; private final AbsSwipeUpHandler.Factory mRecentsWindowSwipeHandlerFactory = this::createRecentsWindowSwipeHandler; // This needs to be a member to be queued and potentially removed later if the service is // destroyed before the user is unlocked private final Runnable mUserUnlockedRunnable = this::onUserUnlocked; private final ScreenOnTracker.ScreenOnListener mScreenOnListener = this::onScreenOnChanged; Loading Loading @@ -678,8 +681,7 @@ public class TouchInteractionService extends Service { mInputConsumer = InputConsumerController.getRecentsAnimationInputConsumer(); // Call runOnUserUnlocked() before any other callbacks to ensure everything is initialized. LockedUserState.get(this).runOnUserUnlocked(this::onUserUnlocked); LockedUserState.get(this).runOnUserUnlocked(mTaskbarManager::onUserUnlocked); LockedUserState.get(this).runOnUserUnlocked(mUserUnlockedRunnable); mDeviceState.addNavigationModeChangedCallback(this::onNavigationModeChanged); sConnected = true; Loading Loading @@ -746,6 +748,8 @@ public class TouchInteractionService extends Service { mOverviewComponentObserver.setOverviewChangeListener(this::onOverviewTargetChange); onOverviewTargetChange(mOverviewComponentObserver.isHomeAndOverviewSame()); mTaskbarManager.onUserUnlocked(); } public OverviewCommandHelper getOverviewCommandHelper() { Loading Loading @@ -836,6 +840,7 @@ public class TouchInteractionService extends Service { mDesktopVisibilityController.onDestroy(); sConnected = false; LockedUserState.get(this).removeOnUserUnlockedRunnable(mUserUnlockedRunnable); ScreenOnTracker.INSTANCE.get(this).removeListener(mScreenOnListener); super.onDestroy(); } Loading
src/com/android/launcher3/util/LockedUserState.kt +7 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,13 @@ class LockedUserState(private val mContext: Context) : SafeCloseable { mUserUnlockedActions.add(action) } /** * Removes a previously queued `Runnable` to be run when the user is unlocked. */ fun removeOnUserUnlockedRunnable(action: Runnable) { mUserUnlockedActions.remove(action) } companion object { @VisibleForTesting @JvmField Loading