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

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

Merge "Refactor onDisplayReady to onDisplayAddSystemDecorations" into main

parents b0035aa3 4be18e7d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -217,9 +217,9 @@ oneway interface IStatusBar
    void setUdfpsRefreshRateCallback(in IUdfpsRefreshRateRequestCallback callback);

    /**
     * Notifies System UI that the display is ready to show system decorations.
     * Notifies System UI that the system decorations should be added on the display.
     */
    void onDisplayReady(int displayId);
    void onDisplayAddSystemDecorations(int displayId);

    /**
     * Notifies System UI that the system decorations should be removed from the display.
+6 −6
Original line number Diff line number Diff line
@@ -460,17 +460,17 @@ public class CommandQueueTest extends SysuiTestCase {
    }

    @Test
    public void testOnDisplayReady() {
        mCommandQueue.onDisplayReady(DEFAULT_DISPLAY);
    public void testonDisplayAddSystemDecorations() {
        mCommandQueue.onDisplayAddSystemDecorations(DEFAULT_DISPLAY);
        waitForIdleSync();
        verify(mCallbacks).onDisplayReady(eq(DEFAULT_DISPLAY));
        verify(mCallbacks).onDisplayAddSystemDecorations(eq(DEFAULT_DISPLAY));
    }

    @Test
    public void testOnDisplayReadyForSecondaryDisplay() {
        mCommandQueue.onDisplayReady(SECONDARY_DISPLAY);
    public void testonDisplayAddSystemDecorationsForSecondaryDisplay() {
        mCommandQueue.onDisplayAddSystemDecorations(SECONDARY_DISPLAY);
        waitForIdleSync();
        verify(mCallbacks).onDisplayReady(eq(SECONDARY_DISPLAY));
        verify(mCallbacks).onDisplayAddSystemDecorations(eq(SECONDARY_DISPLAY));
    }

    @Test
+2 −2
Original line number Diff line number Diff line
@@ -146,9 +146,9 @@ oneway interface ILauncherProxy {
    void onUnbind(IRemoteCallback reply) = 35;

    /**
     * Sent when {@link TaskbarDelegate#onDisplayReady} is called.
     * Sent when {@link TaskbarDelegate#onDisplayAddSystemDecorations} is called.
     */
    void onDisplayReady(int displayId) = 36;
    void onDisplayAddSystemDecorations(int displayId) = 36;

    /**
     * Sent when {@link TaskbarDelegate#onDisplayRemoved} is called.
+4 −1
Original line number Diff line number Diff line
@@ -284,7 +284,10 @@ public class NavigationBarControllerImpl implements
        }

        @Override
        public void onDisplayReady(int displayId) {
        public void onDisplayAddSystemDecorations(int displayId) {
            if (enableDisplayContentModeManagement()) {
                mHasNavBar.put(displayId, true);
            }
            Display display = mDisplayManager.getDisplay(displayId);
            mIsLargeScreen = isLargeScreen(mContext);
            createNavigationBar(display, null /* savedState */, null /* result */);
+4 −4
Original line number Diff line number Diff line
@@ -238,16 +238,16 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
    }

    @Override
    public void onDisplayReady(int displayId) {
        CommandQueue.Callbacks.super.onDisplayReady(displayId);
    public void onDisplayAddSystemDecorations(int displayId) {
        CommandQueue.Callbacks.super.onDisplayAddSystemDecorations(displayId);
        if (mLauncherProxyService.getProxy() == null) {
            return;
        }

        try {
            mLauncherProxyService.getProxy().onDisplayReady(displayId);
            mLauncherProxyService.getProxy().onDisplayAddSystemDecorations(displayId);
        } catch (RemoteException e) {
            Log.e(TAG, "onDisplayReady() failed", e);
            Log.e(TAG, "onDisplayAddSystemDecorations() failed", e);
        }
    }

Loading