diff options
author | Tracy Zhou <tracyzhou@google.com> | 2022-01-08 22:56:59 -0800 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-01-23 20:56:32 +0000 |
commit | 684b2b77cffd964f8e3cb18351b11a3f83e47068 (patch) | |
tree | 1820eedf8cfd6da6855371c5aec9abd507be5c78 | |
parent | d09bd715b6f79610afd5d0a537c70c8a8718b015 (diff) |
End live tile when notification panel is pulled down for the first time in Overview.
Fixes: 211556489
Test: Go to overview with live tile. Turn on dark theme. Pull the panel back up. Make sure everything looks fine (live tile is ended).
Change-Id: I51cb81718a489ad7568c5e05ace0b3dbc6ca5443
(cherry picked from commit 0077caa15d567da042f19deffe319682043863db)
Merged-In:I51cb81718a489ad7568c5e05ace0b3dbc6ca5443
-rw-r--r-- | quickstep/src/com/android/quickstep/TaskAnimationManager.java | 16 | ||||
-rw-r--r-- | quickstep/src/com/android/quickstep/TouchInteractionService.java | 10 |
2 files changed, 26 insertions, 0 deletions
diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java index d3b17f8324..82c7c08153 100644 --- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java +++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java @@ -220,6 +220,22 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn return mCallbacks; } + public void endLiveTile() { + if (mLastGestureState == null) { + return; + } + BaseActivityInterface activityInterface = mLastGestureState.getActivityInterface(); + if (ENABLE_QUICKSTEP_LIVE_TILE.get() && activityInterface.isInLiveTileMode() + && activityInterface.getCreatedActivity() != null) { + RecentsView recentsView = activityInterface.getCreatedActivity().getOverviewPanel(); + if (recentsView != null) { + recentsView.switchToScreenshot(null, + () -> recentsView.finishRecentsAnimation(true /* toRecents */, + false /* shouldPip */, null)); + } + } + } + public void setLiveTileCleanUpHandler(Runnable cleanUpHandler) { mLiveTileCleanUpHandler = cleanUpHandler; } diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 38d6448405..539239d36a 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -33,6 +33,7 @@ import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SHE import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SHELL_STARTING_WINDOW; import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SMARTSPACE_TRANSITION_CONTROLLER; import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY; +import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_TRACING_ENABLED; import android.annotation.TargetApi; @@ -495,6 +496,15 @@ public class TouchInteractionService extends Service mOverviewComponentObserver.onSystemUiStateChanged(); mTaskbarManager.onSystemUiFlagsChanged(systemUiStateFlags); + boolean wasExpanded = (lastSysUIFlags & SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED) != 0; + boolean isExpanded = + (systemUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED) != 0; + if (wasExpanded != isExpanded && isExpanded) { + // End live tile when expanding the notification panel for the first time from + // overview. + mTaskAnimationManager.endLiveTile(); + } + if ((lastSysUIFlags & SYSUI_STATE_TRACING_ENABLED) != (systemUiStateFlags & SYSUI_STATE_TRACING_ENABLED)) { // Update the tracing state |