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

Commit f4172d5a authored by Sukesh Ram's avatar Sukesh Ram
Browse files

[Connected Displays in Taskbar] Refactor TaskbarDelegate for Display Signals

Refactor the TaskbarDelegate to support multiple pass down displayId specific signals down to the taskbar level.

Flag: EXEMPT not adding new behavior
Bug: 376128251
Test: Manual
Change-Id: I41ec5c394adb2e804aedf189c8f57fd2c8d84366
parent f2577749
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -115,23 +115,23 @@ oneway interface IOverviewProxy {
    /**
     * Sent when {@link TaskbarDelegate#checkNavBarModes} is called.
     */
    void checkNavBarModes() = 30;
    void checkNavBarModes(int displayId) = 30;

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

    /**
     * Sent when {@link TaskbarDelegate#touchAutoDim} is called. {@param reset} is true, when auto
     * dim is reset after a timeout.
     */
    void touchAutoDim(boolean reset) = 32;
    void touchAutoDim(int displayid, boolean reset) = 32;

    /**
     * Sent when {@link TaskbarDelegate#transitionTo} is called.
     */
    void transitionTo(int barMode, boolean animate) = 33;
    void transitionTo(int displayId, int barMode, boolean animate) = 33;

    /**
     * Sent when {@link TaskbarDelegate#appTransitionPending} is called.
+4 −4
Original line number Diff line number Diff line
@@ -395,7 +395,7 @@ public class NavigationBarControllerImpl implements
        if (navBar != null) {
            navBar.checkNavBarModes();
        } else {
            mTaskbarDelegate.checkNavBarModes();
            mTaskbarDelegate.checkNavBarModes(displayId);
        }
    }

@@ -405,7 +405,7 @@ public class NavigationBarControllerImpl implements
        if (navBar != null) {
            navBar.finishBarAnimations();
        } else {
            mTaskbarDelegate.finishBarAnimations();
            mTaskbarDelegate.finishBarAnimations(displayId);
        }
    }

@@ -415,7 +415,7 @@ public class NavigationBarControllerImpl implements
        if (navBar != null) {
            navBar.touchAutoDim();
        } else {
            mTaskbarDelegate.touchAutoDim();
            mTaskbarDelegate.touchAutoDim(displayId);
        }
    }

@@ -425,7 +425,7 @@ public class NavigationBarControllerImpl implements
        if (navBar != null) {
            navBar.transitionTo(barMode, animate);
        } else {
            mTaskbarDelegate.transitionTo(barMode, animate);
            mTaskbarDelegate.transitionTo(displayId, barMode, animate);
        }
    }

+19 −9
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
    private final AutoHideUiElement mAutoHideUiElement = new AutoHideUiElement() {
        @Override
        public void synchronizeState() {
            checkNavBarModes();
            checkNavBarModes(mDisplayId);
        }

        @Override
@@ -220,6 +220,16 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
        mEdgeBackGestureHandler = navBarHelper.getEdgeBackGestureHandler();
    }

    @Override
    public void onDisplayReady(int displayId) {
        CommandQueue.Callbacks.super.onDisplayReady(displayId);
    }

    @Override
    public void onDisplayRemoved(int displayId) {
        CommandQueue.Callbacks.super.onDisplayRemoved(displayId);
    }

    // Separated into a method to keep setDependencies() clean/readable.
    private LightBarTransitionsController createLightBarTransitionsController() {

@@ -349,31 +359,31 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
        }
    }

    void checkNavBarModes() {
    void checkNavBarModes(int displayId) {
        if (mOverviewProxyService.getProxy() == null) {
            return;
        }

        try {
            mOverviewProxyService.getProxy().checkNavBarModes();
            mOverviewProxyService.getProxy().checkNavBarModes(displayId);
        } catch (RemoteException e) {
            Log.e(TAG, "checkNavBarModes() failed", e);
        }
    }

    void finishBarAnimations() {
    void finishBarAnimations(int displayId) {
        if (mOverviewProxyService.getProxy() == null) {
            return;
        }

        try {
            mOverviewProxyService.getProxy().finishBarAnimations();
            mOverviewProxyService.getProxy().finishBarAnimations(displayId);
        } catch (RemoteException e) {
            Log.e(TAG, "finishBarAnimations() failed", e);
        }
    }

    void touchAutoDim() {
    void touchAutoDim(int displayId) {
        if (mOverviewProxyService.getProxy() == null) {
            return;
        }
@@ -382,19 +392,19 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
            int state = mStatusBarStateController.getState();
            boolean shouldReset =
                    state != StatusBarState.KEYGUARD && state != StatusBarState.SHADE_LOCKED;
            mOverviewProxyService.getProxy().touchAutoDim(shouldReset);
            mOverviewProxyService.getProxy().touchAutoDim(displayId, shouldReset);
        } catch (RemoteException e) {
            Log.e(TAG, "touchAutoDim() failed", e);
        }
    }

    void transitionTo(@BarTransitions.TransitionMode int barMode, boolean animate) {
    void transitionTo(int displayId, @BarTransitions.TransitionMode int barMode, boolean animate) {
        if (mOverviewProxyService.getProxy() == null) {
            return;
        }

        try {
            mOverviewProxyService.getProxy().transitionTo(barMode, animate);
            mOverviewProxyService.getProxy().transitionTo(displayId, barMode, animate);
        } catch (RemoteException e) {
            Log.e(TAG, "transitionTo() failed, barMode: " + barMode, e);
        }