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

Commit e6db9b86 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Notify SysUI of the recents animation so it can disable autohide" into qt-dev

parents b92f0771 67e4936d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -167,4 +167,9 @@ oneway interface IStatusBar
     * Notifies System UI that the display is ready to show system decorations.
     */
    void onDisplayReady(int displayId);

    /**
     * Notifies System UI whether the recents animation is running or not.
     */
    void onRecentsAnimationStateChanged(boolean running);
}
+20 −0
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController<
    private static final int MSG_SHOW_CHARGING_ANIMATION       = 44 << MSG_SHIFT;
    private static final int MSG_SHOW_PINNING_TOAST_ENTER_EXIT = 45 << MSG_SHIFT;
    private static final int MSG_SHOW_PINNING_TOAST_ESCAPE     = 46 << MSG_SHIFT;
    private static final int MSG_RECENTS_ANIMATION_STATE_CHANGED = 47 << MSG_SHIFT;

    public static final int FLAG_EXCLUDE_NONE = 0;
    public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
@@ -281,10 +282,16 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController<
         * @see IStatusBar#onDisplayReady(int)
         */
        default void onDisplayReady(int displayId) { }

        /**
         * @see DisplayManager.DisplayListener#onDisplayRemoved(int)
         */
        default void onDisplayRemoved(int displayId) { }

        /**
         * @see IStatusBar#onRecentsAnimationStateChanged(boolean)
         */
        default void onRecentsAnimationStateChanged(boolean running) { }
    }

    @VisibleForTesting
@@ -785,6 +792,14 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController<
        }
    }

    @Override
    public void onRecentsAnimationStateChanged(boolean running) {
        synchronized (mLock) {
            mHandler.obtainMessage(MSG_RECENTS_ANIMATION_STATE_CHANGED, running ? 1 : 0, 0)
                    .sendToTarget();
        }
    }

    private void handleShowImeButton(int displayId, IBinder token, int vis, int backDisposition,
            boolean showImeSwitcher) {
        if (displayId == INVALID_DISPLAY) return;
@@ -1071,6 +1086,11 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController<
                        mCallbacks.get(i).onDisplayReady(msg.arg1);
                    }
                    break;
                case MSG_RECENTS_ANIMATION_STATE_CHANGED:
                    for (int i = 0; i < mCallbacks.size(); i++) {
                        mCallbacks.get(i).onRecentsAnimationStateChanged(msg.arg1 > 0);
                    }
                    break;
            }
        }
    }
+5 −0
Original line number Diff line number Diff line
@@ -2156,6 +2156,11 @@ public class StatusBar extends SystemUI implements DemoMode,
        }
    }

    @Override
    public void onRecentsAnimationStateChanged(boolean running) {
        setInteracting(StatusBarManager.WINDOW_NAVIGATION_BAR, running);
    }

    protected @TransitionMode int computeStatusBarMode(int oldVal, int newVal) {
        return computeBarMode(oldVal, newVal);
    }
+7 −0
Original line number Diff line number Diff line
@@ -358,4 +358,11 @@ public class CommandQueueTest extends SysuiTestCase {
        waitForIdleSync();
        verify(mCallbacks).onDisplayRemoved(eq(SECONDARY_DISPLAY));
    }

    @Test
    public void testOnRecentsAnimationStateChanged() {
        mCommandQueue.onRecentsAnimationStateChanged(true);
        waitForIdleSync();
        verify(mCallbacks).onRecentsAnimationStateChanged(eq(true));
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -108,4 +108,9 @@ public interface StatusBarManagerInternal {
     * @param displayId display ID
     */
    void onDisplayReady(int displayId);

    /**
     * Notifies System UI whether the recents animation is running.
     */
    void onRecentsAnimationStateChanged(boolean running);
}
Loading