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

Commit d4abbb96 authored by Craig Mautner's avatar Craig Mautner Committed by Android Git Automerger
Browse files

am 93884a5b: Fix invalid stackId bug.

* commit '93884a5b':
  Fix invalid stackId bug.
parents 291d6468 93884a5b
Loading
Loading
Loading
Loading
+8 −22
Original line number Diff line number Diff line
@@ -4815,27 +4815,20 @@ public class WindowManagerService extends IWindowManager.Stub
        }
    }

    public void createStack(int stackId, int displayId) {
        mH.sendMessage(mH.obtainMessage(H.CREATE_STACK, stackId, displayId));
    }

    /**
     * Create a new TaskStack and place it next to an existing stack.
     * Create a new TaskStack and place it on a DisplayContent.
     * @param stackId The unique identifier of the new stack.
     * @param displayId The unique identifier of the DisplayContent.
     */
    private void createStackLocked(int stackId, int displayId) {
    public void createStack(int stackId, int displayId) {
        final long origId = Binder.clearCallingIdentity();
        try {
            synchronized (mWindowMap) {
                final int numDisplays = mDisplayContents.size();
                for (int displayNdx = 0; displayNdx < numDisplays; ++displayNdx) {
                    final DisplayContent displayContent = mDisplayContents.valueAt(displayNdx);
                    if (displayContent.getDisplayId() == displayId) {
                final DisplayContent displayContent = mDisplayContents.get(displayId);
                if (displayContent != null) {
                    TaskStack stack = displayContent.createStack(stackId);
                    mStackIdToStack.put(stackId, stack);
                    performLayoutAndPlaceSurfacesLocked();
                        return;
                    }
                }
            }
        } finally {
@@ -7051,8 +7044,6 @@ public class WindowManagerService extends IWindowManager.Stub

        public static final int REMOVE_STARTING_TIMEOUT = 33;

        public static final int CREATE_STACK = 34;

        @Override
        public void handleMessage(Message msg) {
            if (DEBUG_WINDOW_TRACE) {
@@ -7490,11 +7481,6 @@ public class WindowManagerService extends IWindowManager.Stub
                    } catch (RemoteException e) {
                    }
                    break;
                case CREATE_STACK:
                    synchronized (mWindowMap) {
                        createStackLocked(msg.arg1, msg.arg2);
                    }
                    break;
            }
            if (DEBUG_WINDOW_TRACE) {
                Slog.v(TAG, "handleMessage: exit");