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

Commit 5faabb52 authored by Lingyu Feng's avatar Lingyu Feng Committed by Android (Google) Code Review
Browse files

Merge "Notify StatusBar and NavBar via onDisplayRemoveSystemDecorations when...

Merge "Notify StatusBar and NavBar via onDisplayRemoveSystemDecorations when starting mirroring" into main
parents dba1063d cb539a54
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -213,6 +213,11 @@ oneway interface IStatusBar
     */
    void onDisplayReady(int displayId);

    /**
     * Notifies System UI that the system decorations should be removed from the display.
     */
    void onDisplayRemoveSystemDecorations(int displayId);

    /**
     * Notifies System UI side of system bar attribute change on the specified display.
     *
+5 −0
Original line number Diff line number Diff line
@@ -274,6 +274,11 @@ public class NavigationBarControllerImpl implements
    private final CommandQueue.Callbacks mCommandQueueCallbacks = new CommandQueue.Callbacks() {
        @Override
        public void onDisplayRemoved(int displayId) {
            onDisplayRemoveSystemDecorations(displayId);
        }

        @Override
        public void onDisplayRemoveSystemDecorations(int displayId) {
            removeNavigationBar(displayId);
            mHasNavBar.delete(displayId);
        }
+20 −0
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ public class CommandQueue extends IStatusBar.Stub implements
    private static final int MSG_TOGGLE_QUICK_SETTINGS_PANEL = 82 << MSG_SHIFT;
    private static final int MSG_WALLET_ACTION_LAUNCH_GESTURE = 83 << MSG_SHIFT;
    private static final int MSG_SET_HAS_NAVIGATION_BAR = 84 << MSG_SHIFT;
    private static final int MSG_DISPLAY_REMOVE_SYSTEM_DECORATIONS = 85 << MSG_SHIFT;
    public static final int FLAG_EXCLUDE_NONE = 0;
    public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
    public static final int FLAG_EXCLUDE_RECENTS_PANEL = 1 << 1;
@@ -419,6 +420,12 @@ public class CommandQueue extends IStatusBar.Stub implements
        default void onDisplayReady(int displayId) {
        }

        /**
         * @see IStatusBar#onDisplayRemoveSystemDecorations(int)
         */
        default void onDisplayRemoveSystemDecorations(int displayId) {
        }

        /**
         * @see DisplayTracker.Callback#onDisplayRemoved(int)
         */
@@ -1204,6 +1211,14 @@ public class CommandQueue extends IStatusBar.Stub implements
        }
    }

    @Override
    public void onDisplayRemoveSystemDecorations(int displayId) {
        synchronized (mLock) {
            mHandler.obtainMessage(MSG_DISPLAY_REMOVE_SYSTEM_DECORATIONS, displayId, 0)
                    .sendToTarget();
        }
    }

    // This was previously called from WM, but is now called from WMShell
    public void onRecentsAnimationStateChanged(boolean running) {
        synchronized (mLock) {
@@ -1841,6 +1856,11 @@ public class CommandQueue extends IStatusBar.Stub implements
                        mCallbacks.get(i).onDisplayReady(msg.arg1);
                    }
                    break;
                case MSG_DISPLAY_REMOVE_SYSTEM_DECORATIONS:
                    for (int i = 0; i < mCallbacks.size(); i++) {
                        mCallbacks.get(i).onDisplayRemoveSystemDecorations(msg.arg1);
                    }
                    break;
                case MSG_RECENTS_ANIMATION_STATE_CHANGED:
                    for (int i = 0; i < mCallbacks.size(); i++) {
                        mCallbacks.get(i).onRecentsAnimationStateChanged(msg.arg1 > 0);
+7 −0
Original line number Diff line number Diff line
@@ -177,6 +177,13 @@ public interface StatusBarManagerInternal {
     */
    void onDisplayReady(int displayId);

    /**
     * Notifies System UI that the system decorations should be removed from the display.
     *
     * @param displayId display ID
     */
    void onDisplayRemoveSystemDecorations(int displayId);

    /** @see com.android.internal.statusbar.IStatusBar#onSystemBarAttributesChanged */
    void onSystemBarAttributesChanged(int displayId, @Appearance int appearance,
            AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme,
+20 −0
Original line number Diff line number Diff line
@@ -792,6 +792,26 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
            }
        }

        @Override
        public void onDisplayRemoveSystemDecorations(int displayId) {
            if (isVisibleBackgroundUserOnDisplay(displayId)) {
                if (SPEW) {
                    Slog.d(TAG,
                            "Skipping onDisplayRemoveSystemDecorations for visible background "
                                    + "user "
                                    + mUserManagerInternal.getUserAssignedToDisplay(displayId));
                }
                return;
            }

            IStatusBar bar = mBar;
            if (bar != null) {
                try {
                    bar.onDisplayRemoveSystemDecorations(displayId);
                } catch (RemoteException ex) {}
            }
        }

        @Override
        public void onSystemBarAttributesChanged(int displayId, @Appearance int appearance,
                AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme,
Loading