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

Commit af82a882 authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Fix PIP window moving during quick scrub.

Bug: 110799409
Test: Manual
Change-Id: Ib7c7d87ddb5aee3149127415bfc31b9cd24dd16b
parent 107dcf8d
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -175,11 +175,13 @@ public class UiFactory {

    public static void onLauncherStateOrResumeChanged(Launcher launcher) {
        LauncherState state = launcher.getStateManager().getState();
        if (!OverviewInteractionState.INSTANCE.get(launcher).swipeGestureInitializing()) {
            DeviceProfile profile = launcher.getDeviceProfile();
            WindowManagerWrapper.getInstance().setShelfHeight(
                    (state == NORMAL || state == OVERVIEW) && launcher.isUserActive()
                            && !profile.isVerticalBarLayout(),
                    profile.hotseatBarSizePx);
        }

        if (state == NORMAL) {
            launcher.<RecentsView>getOverviewPanel().setSwipeDownShouldLaunchApp(false);
+11 −0
Original line number Diff line number Diff line
@@ -70,6 +70,8 @@ public class OverviewInteractionState {
    private final Handler mUiHandler;
    private final Handler mBgHandler;

    private boolean mSwipeGestureInitializing = false;

    // These are updated on the background thread
    private ISystemUiProxy mISystemUiProxy;
    private boolean mSwipeUpEnabled = true;
@@ -179,6 +181,15 @@ public class OverviewInteractionState {
        }
    }

    @WorkerThread
    public void setSwipeGestureInitializing(boolean swipeGestureInitializing) {
        mSwipeGestureInitializing = swipeGestureInitializing;
    }

    public boolean swipeGestureInitializing() {
        return mSwipeGestureInitializing;
    }

    private class SwipeUpGestureEnabledSettingObserver extends ContentObserver {
        private Handler mHandler;
        private ContentResolver mResolver;
+10 −2
Original line number Diff line number Diff line
@@ -90,7 +90,14 @@ public class TouchInteractionService extends Service {
        public void onMotionEvent(MotionEvent ev) {
            mEventQueue.queue(ev);

            String name = sMotionEventNames.get(ev.getActionMasked());
            int action = ev.getActionMasked();
            if (action == ACTION_DOWN) {
                mOverviewInteractionState.setSwipeGestureInitializing(true);
            } else if (action == ACTION_UP || action == ACTION_CANCEL) {
                mOverviewInteractionState.setSwipeGestureInitializing(false);
            }

            String name = sMotionEventNames.get(action);
            if (name != null){
                TraceHelper.partitionSection("SysUiBinder", name);
            }
@@ -106,6 +113,7 @@ public class TouchInteractionService extends Service {
        @Override
        public void onQuickScrubStart() {
            mEventQueue.onQuickScrubStart();
            mOverviewInteractionState.setSwipeGestureInitializing(false);
            TraceHelper.partitionSection("SysUiBinder", "onQuickScrubStart");
        }

@@ -146,8 +154,8 @@ public class TouchInteractionService extends Service {
        @Override
        public void onQuickStep(MotionEvent motionEvent) {
            mEventQueue.onQuickStep(motionEvent);
            mOverviewInteractionState.setSwipeGestureInitializing(false);
            TraceHelper.endSection("SysUiBinder", "onQuickStep");

        }

        @Override