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

Commit b8ed1393 authored by Ming-Shin Lu's avatar Ming-Shin Lu Committed by Automerger Merge Worker
Browse files

RESTRICT AUTOMERGE: More improve IME transition during task switch am: 5c233013

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15888530

Change-Id: Iac595386990d5f42f81318e280865cf0f5b30f0b
parents 873f60b0 5c233013
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