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

Commit 27c05cf4 authored by mpodolian's avatar mpodolian
Browse files

Fix bubble bar location on device boot.

Updated logic to set bubble bar location opposite to navigation bar.

Test: Manual. Restart the device, observe the navigation bar appears at
default location.
Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 377880846

Change-Id: I70546f9ec3b29d65bae2132222dd798a6beecf4d
parent 19037586
Loading
Loading
Loading
Loading
+7 −5
Original line number Original line Diff line number Diff line
@@ -274,8 +274,11 @@ public class BubbleController implements ConfigurationChangeListener,
    private final DragAndDropController mDragAndDropController;
    private final DragAndDropController mDragAndDropController;
    /** Used to send bubble events to launcher. */
    /** Used to send bubble events to launcher. */
    private Bubbles.BubbleStateListener mBubbleStateListener;
    private Bubbles.BubbleStateListener mBubbleStateListener;
    /** Used to track previous navigation mode to detect switch to buttons navigation. */
    /**
    private boolean mIsPrevNavModeGestures;
     * Used to track previous navigation mode to detect switch to buttons navigation. Set to
     * true to switch the bubble bar to the opposite side for 3 nav buttons mode on device boot.
     */
    private boolean mIsPrevNavModeGestures = true;
    /** Used to send updates to the views from {@link #mBubbleDataListener}. */
    /** Used to send updates to the views from {@link #mBubbleDataListener}. */
    private BubbleViewCallback mBubbleViewCallback;
    private BubbleViewCallback mBubbleViewCallback;


@@ -357,7 +360,6 @@ public class BubbleController implements ConfigurationChangeListener,
            }
            }
        };
        };
        mExpandedViewManager = BubbleExpandedViewManager.fromBubbleController(this);
        mExpandedViewManager = BubbleExpandedViewManager.fromBubbleController(this);
        mIsPrevNavModeGestures = ContextUtils.isGestureNavigationMode(mContext);
    }
    }


    private void registerOneHandedState(OneHandedController oneHanded) {
    private void registerOneHandedState(OneHandedController oneHanded) {
@@ -593,9 +595,9 @@ public class BubbleController implements ConfigurationChangeListener,
        if (mBubbleStateListener != null) {
        if (mBubbleStateListener != null) {
            boolean isCurrentNavModeGestures = ContextUtils.isGestureNavigationMode(mContext);
            boolean isCurrentNavModeGestures = ContextUtils.isGestureNavigationMode(mContext);
            if (mIsPrevNavModeGestures && !isCurrentNavModeGestures) {
            if (mIsPrevNavModeGestures && !isCurrentNavModeGestures) {
                BubbleBarLocation navButtonsLocation = ContextUtils.isRtl(mContext)
                BubbleBarLocation bubbleBarLocation = ContextUtils.isRtl(mContext)
                        ? BubbleBarLocation.RIGHT : BubbleBarLocation.LEFT;
                        ? BubbleBarLocation.RIGHT : BubbleBarLocation.LEFT;
                mBubblePositioner.setBubbleBarLocation(navButtonsLocation);
                mBubblePositioner.setBubbleBarLocation(bubbleBarLocation);
            }
            }
            mIsPrevNavModeGestures = isCurrentNavModeGestures;
            mIsPrevNavModeGestures = isCurrentNavModeGestures;
            BubbleBarUpdate update = mBubbleData.getInitialStateForBubbleBar();
            BubbleBarUpdate update = mBubbleData.getInitialStateForBubbleBar();