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

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

am cf6e0d68: Merge "Add display synchronously." into klp-modular-dev

* commit 'cf6e0d68':
  Add display synchronously.
parents 5b0acf0d cf6e0d68
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -2987,8 +2987,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
            final Display display = virtualDisplay.getDisplay();
            final Display display = virtualDisplay.getDisplay();
            final int displayId = display.getDisplayId();
            final int displayId = display.getDisplayId();


            // Do WindowManager operation first so that it is ahead of CREATE_STACK in the H queue.
            mWindowManager.handleDisplayAdded(displayId);
            mWindowManager.onDisplayAdded(displayId);


            synchronized (mService) {
            synchronized (mService) {
                ActivityDisplay activityDisplay = new ActivityDisplay(display);
                ActivityDisplay activityDisplay = new ActivityDisplay(display);
+8 −9
Original line number Original line Diff line number Diff line
@@ -4863,7 +4863,6 @@ public class WindowManagerService extends IWindowManager.Stub
            final TaskStack stack = task.mStack;
            final TaskStack stack = task.mStack;
            EventLog.writeEvent(EventLogTags.WM_TASK_REMOVED, taskId, "removeTask");
            EventLog.writeEvent(EventLogTags.WM_TASK_REMOVED, taskId, "removeTask");
            stack.removeTask(task);
            stack.removeTask(task);
            stack.getDisplayContent().layoutNeeded = true;
        }
        }
    }
    }


@@ -7445,9 +7444,7 @@ public class WindowManagerService extends IWindowManager.Stub
                }
                }


                case DO_DISPLAY_ADDED:
                case DO_DISPLAY_ADDED:
                    synchronized (mWindowMap) {
                    handleDisplayAdded(msg.arg1);
                        handleDisplayAddedLocked(msg.arg1);
                    }
                    break;
                    break;


                case DO_DISPLAY_REMOVED:
                case DO_DISPLAY_REMOVED:
@@ -10790,13 +10787,15 @@ public class WindowManagerService extends IWindowManager.Stub
        mH.sendMessage(mH.obtainMessage(H.DO_DISPLAY_ADDED, displayId, 0));
        mH.sendMessage(mH.obtainMessage(H.DO_DISPLAY_ADDED, displayId, 0));
    }
    }


    private void handleDisplayAddedLocked(int displayId) {
    public void handleDisplayAdded(int displayId) {
        synchronized (mWindowMap) {
            final Display display = mDisplayManager.getDisplay(displayId);
            final Display display = mDisplayManager.getDisplay(displayId);
            if (display != null) {
            if (display != null) {
                createDisplayContentLocked(display);
                createDisplayContentLocked(display);
                displayReady(displayId);
                displayReady(displayId);
            }
            }
        }
        }
    }


    @Override
    @Override
    public void onDisplayRemoved(int displayId) {
    public void onDisplayRemoved(int displayId) {