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

Commit 495358e3 authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Propagate last-ime-shown in the same task explicitly" into udc-dev am:...

Merge "Propagate last-ime-shown in the same task explicitly" into udc-dev am: 3109c3b7 am: 59117c81 am: c9cc6122 am: 4d2a173a

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



Change-Id: I6241dd11db2b96a5c19778db80ba63a7d5a91829
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 8b751e35 4d2a173a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3570,6 +3570,14 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

                // Tell window manager to prepare for this one to be removed.
                setVisibility(false);
                // Propagate the last IME visibility in the same task, so the IME can show
                // automatically if the next activity has a focused editable view.
                if (mLastImeShown && mTransitionController.isShellTransitionsEnabled()) {
                    final ActivityRecord nextRunning = task.topRunningActivity();
                    if (nextRunning != null) {
                        nextRunning.mLastImeShown = true;
                    }
                }

                if (getTaskFragment().getPausingActivity() == null) {
                    ProtoLog.v(WM_DEBUG_STATES, "Finish needs to pause: %s", this);
+4 −4
Original line number Diff line number Diff line
@@ -9231,7 +9231,6 @@ public class WindowManagerService extends IWindowManager.Stub

    boolean shouldRestoreImeVisibility(IBinder imeTargetWindowToken) {
        final Task imeTargetWindowTask;
        boolean hadRequestedShowIme = false;
        synchronized (mGlobalLock) {
            final WindowState imeTargetWindow = mWindowMap.get(imeTargetWindowToken);
            if (imeTargetWindow == null) {
@@ -9241,14 +9240,15 @@ public class WindowManagerService extends IWindowManager.Stub
            if (imeTargetWindowTask == null) {
                return false;
            }
            if (imeTargetWindow.mActivityRecord != null) {
                hadRequestedShowIme = imeTargetWindow.mActivityRecord.mLastImeShown;
            if (imeTargetWindow.mActivityRecord != null
                    && imeTargetWindow.mActivityRecord.mLastImeShown) {
                return true;
            }
        }
        final TaskSnapshot snapshot = getTaskSnapshot(imeTargetWindowTask.mTaskId,
                imeTargetWindowTask.mUserId, false /* isLowResolution */,
                false /* restoreFromDisk */);
        return snapshot != null && snapshot.hasImeSurface() || hadRequestedShowIme;
        return snapshot != null && snapshot.hasImeSurface();
    }

    @Override