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

Commit d5efc1fd authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Delete unused interface IAM.swapDockedAndFullscreenStack()

Deleting so I don't have to convert to the new windowing model later.

Test: Existing test pass.
Change-Id: I6adbe11348e3f01f4e32d8b404b6399d5eff7152
parent 0568aed2
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -545,11 +545,6 @@ interface IActivityManager {
     */
    void resizePinnedStack(in Rect pinnedBounds, in Rect tempPinnedTaskBounds);
    boolean isVrModePackageEnabled(in ComponentName packageName);
    /**
     * Moves all tasks from the docked stack in the fullscreen stack and puts the top task of the
     * fullscreen stack into the docked stack.
     */
    void swapDockedAndFullscreenStack();
    void notifyLockedProfile(int userId);
    void startConfirmDeviceCredentialIntent(in Intent intent, in Bundle options);
    void sendIdleJobTrigger();
+0 −18
Original line number Diff line number Diff line
@@ -93,7 +93,6 @@ public class DividerView extends FrameLayout implements OnTouchListener,
    private static final int LOG_VALUE_UNDOCK_MAX_OTHER = 1;

    private static final int TASK_POSITION_SAME = Integer.MAX_VALUE;
    private static final boolean SWAPPING_ENABLED = false;

    /**
     * How much the background gets scaled when we are in the minimized dock state.
@@ -153,7 +152,6 @@ public class DividerView extends FrameLayout implements OnTouchListener,
    private boolean mEntranceAnimationRunning;
    private boolean mExitAnimationRunning;
    private int mExitStartPosition;
    private GestureDetector mGestureDetector;
    private boolean mDockedStackMinimized;
    private boolean mHomeStackResizable;
    private boolean mAdjustedForIme;
@@ -295,21 +293,6 @@ public class DividerView extends FrameLayout implements OnTouchListener,
                landscape ? TYPE_HORIZONTAL_DOUBLE_ARROW : TYPE_VERTICAL_DOUBLE_ARROW));
        getViewTreeObserver().addOnComputeInternalInsetsListener(this);
        mHandle.setAccessibilityDelegate(mHandleDelegate);
        mGestureDetector = new GestureDetector(mContext, new SimpleOnGestureListener() {
            @Override
            public boolean onSingleTapUp(MotionEvent e) {
                if (SWAPPING_ENABLED) {
                    updateDockSide();
                    SystemServicesProxy ssp = Recents.getSystemServices();
                    if (mDockSide != WindowManager.DOCKED_INVALID
                            && !ssp.isRecentsActivityVisible()) {
                        mWindowManagerProxy.swapTasks();
                        return true;
                    }
                }
                return false;
            }
        });
    }

    @Override
@@ -478,7 +461,6 @@ public class DividerView extends FrameLayout implements OnTouchListener,
    @Override
    public boolean onTouch(View v, MotionEvent event) {
        convertToScreenCoordinates(event);
        mGestureDetector.onTouchEvent(event);
        final int action = event.getAction() & MotionEvent.ACTION_MASK;
        switch (action) {
            case MotionEvent.ACTION_DOWN:
+0 −15
Original line number Diff line number Diff line
@@ -120,17 +120,6 @@ public class WindowManagerProxy {
        }
    };

    private final Runnable mSwapRunnable = new Runnable() {
        @Override
        public void run() {
            try {
                ActivityManager.getService().swapDockedAndFullscreenStack();
            } catch (RemoteException e) {
                Log.w(TAG, "Failed to resize stack: " + e);
            }
        }
    };

    private final Runnable mSetTouchableRegionRunnable = new Runnable() {
        @Override
        public void run() {
@@ -218,10 +207,6 @@ public class WindowManagerProxy {
        mExecutor.execute(mDimLayerRunnable);
    }

    public void swapTasks() {
        mExecutor.execute(mSwapRunnable);
    }

    public void setTouchRegion(Rect region) {
        synchronized (mDockedRect) {
            mTouchableRegion.set(region);
+0 −50
Original line number Diff line number Diff line
@@ -10604,56 +10604,6 @@ public class ActivityManagerService extends IActivityManager.Stub
        }
    }
    @Override
    public void swapDockedAndFullscreenStack() throws RemoteException {
        enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "swapDockedAndFullscreenStack()");
        synchronized (this) {
            long ident = Binder.clearCallingIdentity();
            try {
                final ActivityStack fullscreenStack = mStackSupervisor.getStack(
                        FULLSCREEN_WORKSPACE_STACK_ID);
                final TaskRecord topTask = fullscreenStack != null ? fullscreenStack.topTask()
                        : null;
                final ActivityStack dockedStack = mStackSupervisor.getStack(DOCKED_STACK_ID);
                final ArrayList<TaskRecord> tasks = dockedStack != null ? dockedStack.getAllTasks()
                        : null;
                if (topTask == null || tasks == null || tasks.size() == 0) {
                    Slog.w(TAG,
                            "Unable to swap tasks, either docked or fullscreen stack is empty.");
                    return;
                }
                // TODO: App transition
                mWindowManager.prepareAppTransition(TRANSIT_ACTIVITY_RELAUNCH, false);
                // Defer the resume until we move all the docked tasks to the fullscreen stack below
                topTask.reparent(DOCKED_STACK_ID, ON_TOP, REPARENT_KEEP_STACK_AT_FRONT, ANIMATE,
                        DEFER_RESUME, "swapDockedAndFullscreenStack - DOCKED_STACK");
                final int size = tasks.size();
                for (int i = 0; i < size; i++) {
                    final int id = tasks.get(i).taskId;
                    if (id == topTask.taskId) {
                        continue;
                    }
                    // Defer the resume until after all the tasks have been moved
                    tasks.get(i).reparent(FULLSCREEN_WORKSPACE_STACK_ID, ON_TOP,
                            REPARENT_KEEP_STACK_AT_FRONT, ANIMATE, DEFER_RESUME,
                            "swapDockedAndFullscreenStack - FULLSCREEN_STACK");
                }
                // Because we deferred the resume to avoid conflicts with stack switches while
                // resuming, we need to do it after all the tasks are moved.
                mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
                mStackSupervisor.resumeFocusedStackTopActivityLocked();
                mWindowManager.executeAppTransition();
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
        }
    }
    /**
     * Moves the input task to the docked stack.
     *