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

Commit 2a4120e7 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of [15919265, 15919266, 15919267, 15919014, 15919015,...

Merge cherrypicks of [15919265, 15919266, 15919267, 15919014, 15919015, 15919110, 15919205, 15919286] into sc-d1-release

Change-Id: I24f5575a08e9dc9865db9e5e6bc799d1fdb406a5
parents 31e4ac17 bd761f7c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -88,4 +88,9 @@ oneway interface ITaskOrganizer {
     * user has pressed back on the root activity of a task controlled by the task organizer.
     */
    void onBackPressedOnTaskRoot(in ActivityManager.RunningTaskInfo taskInfo);

    /**
     * Called when the IME has drawn on the organized task.
     */
    void onImeDrawnOnTask(int taskId);
}
+9 −0
Original line number Diff line number Diff line
@@ -144,6 +144,10 @@ public class TaskOrganizer extends WindowOrganizer {
    @BinderThread
    public void onBackPressedOnTaskRoot(@NonNull ActivityManager.RunningTaskInfo taskInfo) {}

    /** @hide */
    @BinderThread
    public void onImeDrawnOnTask(int taskId) {}

    /**
     * Creates a persistent root task in WM for a particular windowing-mode.
     * @param displayId The display to create the root task on.
@@ -287,6 +291,11 @@ public class TaskOrganizer extends WindowOrganizer {
        public void onBackPressedOnTaskRoot(ActivityManager.RunningTaskInfo info) {
            mExecutor.execute(() -> TaskOrganizer.this.onBackPressedOnTaskRoot(info));
        }

        @Override
        public void onImeDrawnOnTask(int taskId) {
            mExecutor.execute(() -> TaskOrganizer.this.onImeDrawnOnTask(taskId));
        }
    };

    private ITaskOrganizerController getController() {
+7 −0
Original line number Diff line number Diff line
@@ -335,6 +335,13 @@ public class ShellTaskOrganizer extends TaskOrganizer implements
        }
    }

    @Override
    public void onImeDrawnOnTask(int taskId) {
        if (mStartingWindow != null) {
            mStartingWindow.onImeDrawnOnTask(taskId);
        }
    }

    @Override
    public void onTaskAppeared(RunningTaskInfo taskInfo, SurfaceControl leash) {
        synchronized (mLock) {
+12 −2
Original line number Diff line number Diff line
@@ -545,6 +545,15 @@ public class StartingSurfaceDrawer {
        removeWindowSynced(taskId, null, null, false);
    }

    void onImeDrawnOnTask(int taskId) {
        final StartingWindowRecord record = mStartingWindowRecords.get(taskId);
        if (record != null && record.mTaskSnapshotWindow != null
                && record.mTaskSnapshotWindow.hasImeSurface()) {
            record.mTaskSnapshotWindow.removeImmediately();
        }
        mStartingWindowRecords.remove(taskId);
    }

    protected void removeWindowSynced(int taskId, SurfaceControl leash, Rect frame,
            boolean playRevealAnimation) {
        final StartingWindowRecord record = mStartingWindowRecords.get(taskId);
@@ -572,14 +581,15 @@ public class StartingSurfaceDrawer {
                    Slog.e(TAG, "Found empty splash screen, remove!");
                    removeWindowInner(record.mDecorView, false);
                }
                mStartingWindowRecords.remove(taskId);
            }
            if (record.mTaskSnapshotWindow != null) {
                if (DEBUG_TASK_SNAPSHOT) {
                    Slog.v(TAG, "Removing task snapshot window for " + taskId);
                }
                record.mTaskSnapshotWindow.remove();
                record.mTaskSnapshotWindow.scheduleRemove(
                        () -> mStartingWindowRecords.remove(taskId));
            }
            mStartingWindowRecords.remove(taskId);
        }
    }

+7 −0
Original line number Diff line number Diff line
@@ -176,6 +176,13 @@ public class StartingWindowController implements RemoteCallable<StartingWindowCo
                () -> mStartingSurfaceDrawer.onAppSplashScreenViewRemoved(taskId));
    }

    /**
     * Called when the IME has drawn on the organized task.
     */
    public void onImeDrawnOnTask(int taskId) {
        mSplashScreenExecutor.execute(() -> mStartingSurfaceDrawer.onImeDrawnOnTask(taskId));
    }

    /**
     * Called when the content of a task is ready to show, starting window can be removed.
     */
Loading