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

Commit 5d74f117 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Cancels out long press on recents fixed from previous change"

parents e600fbaf 8d372880
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