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

Commit 1514f9a6 authored by Bryce Lee's avatar Bryce Lee Committed by Android (Google) Code Review
Browse files

Merge "Do not defer wm display logic when called from am."

parents a7353961 af3a400e
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -399,6 +399,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
    /** Mapping from (ActivityStack/TaskStack).mStackId to their current state */
    SparseArray<ActivityContainer> mActivityContainers = new SparseArray<>();

    // TODO: There should be an ActivityDisplayController coordinating am/wm interaction.
    /** Mapping from displayId to display current state */
    private final SparseArray<ActivityDisplay> mActivityDisplays = new SparseArray<>();

@@ -3725,12 +3726,10 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
                }
                mActivityDisplays.put(displayId, activityDisplay);
                calculateDefaultMinimalSizeOfResizeableTasks(activityDisplay);
            }
        }
        if (newDisplay) {
                mWindowManager.onDisplayAdded(displayId);
            }
        }
    }

    /** Check if display with specified id is added to the list. */
    boolean isDisplayAdded(int displayId) {
@@ -3768,9 +3767,9 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
                    }
                }
                mActivityDisplays.remove(displayId);
                mWindowManager.onDisplayRemoved(displayId);
            }
        }
        mWindowManager.onDisplayRemoved(displayId);
    }

    private void handleDisplayChanged(int displayId) {
@@ -3779,9 +3778,9 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
            if (activityDisplay != null) {
                // TODO: Update the bounds.
            }
        }
            mWindowManager.onDisplayChanged(displayId);
        }
    }

    private StackInfo getStackInfoLocked(ActivityStack stack) {
        final ActivityDisplay display = mActivityDisplays.get(DEFAULT_DISPLAY);
@@ -4740,7 +4739,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D

            init(mVirtualDisplay.getDisplay());

            mWindowManager.handleDisplayAdded(mDisplayId);
            mWindowManager.onDisplayAdded(mDisplayId);
        }

        void setSurface(Surface surface) {
+13 −41
Original line number Diff line number Diff line
@@ -4634,10 +4634,6 @@ public class WindowManagerService extends IWindowManager.Stub
        public static final int SHOW_STRICT_MODE_VIOLATION = 25;
        public static final int DO_ANIMATION_CALLBACK = 26;

        public static final int DO_DISPLAY_ADDED = 27;
        public static final int DO_DISPLAY_REMOVED = 28;
        public static final int DO_DISPLAY_CHANGED = 29;

        public static final int CLIENT_FREEZE_TIMEOUT = 30;
        public static final int TAP_OUTSIDE_TASK = 31;
        public static final int NOTIFY_ACTIVITY_DRAWN = 32;
@@ -4981,22 +4977,6 @@ public class WindowManagerService extends IWindowManager.Stub
                    break;
                }

                case DO_DISPLAY_ADDED:
                    handleDisplayAdded(msg.arg1);
                    break;

                case DO_DISPLAY_REMOVED:
                    synchronized (mWindowMap) {
                        handleDisplayRemovedLocked(msg.arg1);
                    }
                    break;

                case DO_DISPLAY_CHANGED:
                    synchronized (mWindowMap) {
                        handleDisplayChangedLocked(msg.arg1);
                    }
                    break;

                case TAP_OUTSIDE_TASK: {
                    handleTapOutsideTask((DisplayContent)msg.obj, msg.arg1, msg.arg2);
                }
@@ -6710,10 +6690,6 @@ public class WindowManagerService extends IWindowManager.Stub
    }

    public void onDisplayAdded(int displayId) {
        mH.sendMessage(mH.obtainMessage(H.DO_DISPLAY_ADDED, displayId, 0));
    }

    public void handleDisplayAdded(int displayId) {
        synchronized (mWindowMap) {
            final Display display = mDisplayManager.getDisplay(displayId);
            if (display != null) {
@@ -6725,10 +6701,7 @@ public class WindowManagerService extends IWindowManager.Stub
    }

    public void onDisplayRemoved(int displayId) {
        mH.sendMessage(mH.obtainMessage(H.DO_DISPLAY_REMOVED, displayId, 0));
    }

    private void handleDisplayRemovedLocked(int displayId) {
        synchronized (mWindowMap) {
            final DisplayContent displayContent = mRoot.getDisplayContentOrCreate(displayId);
            if (displayContent != null) {
                displayContent.removeIfPossible();
@@ -6736,18 +6709,17 @@ public class WindowManagerService extends IWindowManager.Stub
            mAnimator.removeDisplayLocked(displayId);
            mWindowPlacerLocked.requestTraversal();
        }

    public void onDisplayChanged(int displayId) {
        mH.sendMessage(mH.obtainMessage(H.DO_DISPLAY_CHANGED, displayId, 0));
    }

    private void handleDisplayChangedLocked(int displayId) {
    public void onDisplayChanged(int displayId) {
        synchronized (mWindowMap) {
            final DisplayContent displayContent = mRoot.getDisplayContentOrCreate(displayId);
            if (displayContent != null) {
                displayContent.updateDisplayInfo();
            }
            mWindowPlacerLocked.requestTraversal();
        }
    }

    @Override
    public Object getWindowManagerLock() {