Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d38320ee authored by Tracy Zhou's avatar Tracy Zhou Committed by Automerger Merge Worker
Browse files

End live tile when notification panel is pulled down for the first time in...

End live tile when notification panel is pulled down for the first time in Overview. am: 0077caa1 am: b5e6dbc9

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16591950

Change-Id: Ib2148b38ffbd3edbb5f80bea4b10aaf9de5dcfdd
parents fbdb6ac5 b5e6dbc9
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -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;
    }
+10 −0
Original line number Diff line number Diff line
@@ -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;
@@ -479,6 +480,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