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

Commit 8d372880 authored by Matthew Ng's avatar Matthew Ng
Browse files

Cancels out long press on recents fixed from previous change

This fixes an error from change-id
Ic9c8a5096ce9f30fc1265774ebb82c1356b1221b where the docked state was
not dismissed when long pressing recents. Minimized state is also
handled by not having the second vibration.

Test: manual - tested home screen, minimized, dock and undock the tasks
into multi-window mode
Fixes: 33655754
Fixes: 29927464
Change-Id: I3adedf9d0e1dcd5fe297f7ca8b9cb8faeba8bcb1
parent 6a435500
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -67,6 +67,10 @@ public class Divider extends SystemUI {
        return mView;
    }

    public boolean isMinimized() {
        return mMinimized;
    }

    private void addDivider(Configuration configuration) {
        mView = (DividerView)
                LayoutInflater.from(mContext).inflate(R.layout.docked_stack_divider, null);
+2 −1
Original line number Diff line number Diff line
@@ -1351,8 +1351,9 @@ public abstract class BaseStatusBar extends SystemUI implements
     *                          anything on successful docking
     * @param metricsUndockAction the action to log when undocking, or -1 to not log anything when
     *                            undocking
     * @return true if toggle split screen was successful
     */
    protected abstract void toggleSplitScreenMode(int metricsDockAction, int metricsUndockAction);
    protected abstract boolean toggleSplitScreenMode(int metricsDockAction, int metricsUndockAction);

    /** Proxy for RecentsComponent */

+14 −16
Original line number Diff line number Diff line
@@ -1365,29 +1365,25 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                return false;
            }

            ActivityManager.RunningTaskInfo runningTask =
                    Recents.getSystemServices().getRunningTask();
            boolean isRunningTaskInHomeOrRecentsStack = runningTask != null &&
                    ActivityManager.StackId.isHomeOrRecentsStack(runningTask.stackId);
            if (isRunningTaskInHomeOrRecentsStack) {
                return false;
            }

            toggleSplitScreenMode(MetricsEvent.ACTION_WINDOW_DOCK_LONGPRESS,
            return toggleSplitScreenMode(MetricsEvent.ACTION_WINDOW_DOCK_LONGPRESS,
                    MetricsEvent.ACTION_WINDOW_UNDOCK_LONGPRESS);
            return true;
        }
    };

    @Override
    protected void toggleSplitScreenMode(int metricsDockAction, int metricsUndockAction) {
    protected boolean toggleSplitScreenMode(int metricsDockAction, int metricsUndockAction) {
        if (mRecents == null) {
            return;
            return false;
        }
        int dockSide = WindowManagerProxy.getInstance().getDockSide();
        if (dockSide == WindowManager.DOCKED_INVALID) {
            mRecents.dockTopTask(NavigationBarGestureHelper.DRAG_MODE_NONE,
            return mRecents.dockTopTask(NavigationBarGestureHelper.DRAG_MODE_NONE,
                    ActivityManager.DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT, null, metricsDockAction);
        } else {
            Divider divider = getComponent(Divider.class);
            if (divider != null && divider.isMinimized()) {
                // Undocking from the minimized state is not supported
                return false;
            } else {
                EventBus.getDefault().send(new UndockingTaskEvent());
                if (metricsUndockAction != -1) {
@@ -1395,6 +1391,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                }
            }
        }
        return true;
    }

    private final View.OnLongClickListener mLongPressHomeListener
            = new View.OnLongClickListener() {
+2 −1
Original line number Diff line number Diff line
@@ -116,7 +116,8 @@ public class TvStatusBar extends BaseStatusBar {
    }

    @Override
    protected void toggleSplitScreenMode(int metricsDockAction, int metricsUndockAction) {
    protected boolean toggleSplitScreenMode(int metricsDockAction, int metricsUndockAction) {
        return false;
    }

    @Override