Loading services/core/java/com/android/server/wm/ActivityRecord.java +1 −8 Original line number Diff line number Diff line Loading @@ -727,6 +727,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A /** * When set to true, the IME insets will be frozen until the next app becomes IME input target. * @see InsetsPolicy#adjustVisibilityForIme * @see ImeInsetsSourceProvider#updateClientVisibility */ boolean mImeInsetsFrozenUntilStartInput; Loading Loading @@ -1576,7 +1577,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A if (newParent != null) { if (isState(RESUMED)) { newParent.setResumedActivity(this, "onParentChanged"); mImeInsetsFrozenUntilStartInput = false; } mLetterboxUiController.onActivityParentChanged(newParent); } Loading Loading @@ -8874,13 +8874,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } } @Override void onResize() { // Reset freezing IME insets flag when the activity resized. mImeInsetsFrozenUntilStartInput = false; super.onResize(); } private boolean applyAspectRatio(Rect outBounds, Rect containingAppBounds, Rect containingBounds) { return applyAspectRatio(outBounds, containingAppBounds, containingBounds, Loading services/core/java/com/android/server/wm/DisplayContent.java +28 −4 Original line number Diff line number Diff line Loading @@ -4509,11 +4509,35 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp mImeWindowsContainer.getParent().mSurfaceControl)); updateImeControlTarget(forceUpdateImeParent); } // Unfreeze IME insets after the new target updated, in case updateAboveInsetsState may // deliver unrelated IME insets change to the non-IME requester. if (target != null) { target.unfreezeInsetsAfterStartInput(); } /** * Callback from {@link ImeInsetsSourceProvider#updateClientVisibility} for the system to * judge whether or not to notify the IME insets provider to dispatch this reported IME client * visibility state to the app clients when needed. */ boolean onImeInsetsClientVisibilityUpdate() { boolean[] changed = new boolean[1]; // Unlike the IME layering target or the control target can be updated during the layout // change, the IME input target requires to be changed after gaining the input focus. // In case unfreezing IME insets state may too early during IME focus switching, we unfreeze // when activities going to be visible until the input target changed, or the // activity was the current input target that has to unfreeze after updating the IME // client visibility. final ActivityRecord inputTargetActivity = mImeInputTarget != null ? mImeInputTarget.getActivityRecord() : null; final boolean targetChanged = mImeInputTarget != mLastImeInputTarget; if (targetChanged || inputTargetActivity != null && inputTargetActivity.isVisibleRequested() && inputTargetActivity.mImeInsetsFrozenUntilStartInput) { forAllActivities(r -> { if (r.mImeInsetsFrozenUntilStartInput && r.isVisibleRequested()) { r.mImeInsetsFrozenUntilStartInput = false; changed[0] = true; } }); } return changed[0]; } void updateImeControlTarget() { Loading services/core/java/com/android/server/wm/EmbeddedWindowController.java +0 −4 Original line number Diff line number Diff line Loading @@ -334,10 +334,6 @@ class EmbeddedWindowController { return true; } @Override public void unfreezeInsetsAfterStartInput() { } @Override public InsetsControlTarget getImeControlTarget() { return mWmService.getDefaultDisplayContentLocked().mRemoteInsetsControlTarget; Loading services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java +4 −0 Original line number Diff line number Diff line Loading @@ -140,10 +140,14 @@ final class ImeInsetsSourceProvider extends WindowContainerInsetsSourceProvider @Override protected boolean updateClientVisibility(InsetsControlTarget caller) { if (caller != getControlTarget()) { return false; } boolean changed = super.updateClientVisibility(caller); if (changed && caller.isRequestedVisible(mSource.getType())) { reportImeDrawnForOrganizer(caller); } changed |= mDisplayContent.onImeInsetsClientVisibilityUpdate(); return changed; } Loading services/core/java/com/android/server/wm/InputTarget.java +1 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,8 @@ package com.android.server.wm; import android.view.IWindow; import android.util.proto.ProtoOutputStream; import android.view.IWindow; /** * Common interface between focusable objects. Loading Loading @@ -58,7 +58,6 @@ interface InputTarget { boolean canScreenshotIme(); ActivityRecord getActivityRecord(); void unfreezeInsetsAfterStartInput(); boolean isInputMethodClientFocus(int uid, int pid); Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +1 −8 Original line number Diff line number Diff line Loading @@ -727,6 +727,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A /** * When set to true, the IME insets will be frozen until the next app becomes IME input target. * @see InsetsPolicy#adjustVisibilityForIme * @see ImeInsetsSourceProvider#updateClientVisibility */ boolean mImeInsetsFrozenUntilStartInput; Loading Loading @@ -1576,7 +1577,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A if (newParent != null) { if (isState(RESUMED)) { newParent.setResumedActivity(this, "onParentChanged"); mImeInsetsFrozenUntilStartInput = false; } mLetterboxUiController.onActivityParentChanged(newParent); } Loading Loading @@ -8874,13 +8874,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } } @Override void onResize() { // Reset freezing IME insets flag when the activity resized. mImeInsetsFrozenUntilStartInput = false; super.onResize(); } private boolean applyAspectRatio(Rect outBounds, Rect containingAppBounds, Rect containingBounds) { return applyAspectRatio(outBounds, containingAppBounds, containingBounds, Loading
services/core/java/com/android/server/wm/DisplayContent.java +28 −4 Original line number Diff line number Diff line Loading @@ -4509,11 +4509,35 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp mImeWindowsContainer.getParent().mSurfaceControl)); updateImeControlTarget(forceUpdateImeParent); } // Unfreeze IME insets after the new target updated, in case updateAboveInsetsState may // deliver unrelated IME insets change to the non-IME requester. if (target != null) { target.unfreezeInsetsAfterStartInput(); } /** * Callback from {@link ImeInsetsSourceProvider#updateClientVisibility} for the system to * judge whether or not to notify the IME insets provider to dispatch this reported IME client * visibility state to the app clients when needed. */ boolean onImeInsetsClientVisibilityUpdate() { boolean[] changed = new boolean[1]; // Unlike the IME layering target or the control target can be updated during the layout // change, the IME input target requires to be changed after gaining the input focus. // In case unfreezing IME insets state may too early during IME focus switching, we unfreeze // when activities going to be visible until the input target changed, or the // activity was the current input target that has to unfreeze after updating the IME // client visibility. final ActivityRecord inputTargetActivity = mImeInputTarget != null ? mImeInputTarget.getActivityRecord() : null; final boolean targetChanged = mImeInputTarget != mLastImeInputTarget; if (targetChanged || inputTargetActivity != null && inputTargetActivity.isVisibleRequested() && inputTargetActivity.mImeInsetsFrozenUntilStartInput) { forAllActivities(r -> { if (r.mImeInsetsFrozenUntilStartInput && r.isVisibleRequested()) { r.mImeInsetsFrozenUntilStartInput = false; changed[0] = true; } }); } return changed[0]; } void updateImeControlTarget() { Loading
services/core/java/com/android/server/wm/EmbeddedWindowController.java +0 −4 Original line number Diff line number Diff line Loading @@ -334,10 +334,6 @@ class EmbeddedWindowController { return true; } @Override public void unfreezeInsetsAfterStartInput() { } @Override public InsetsControlTarget getImeControlTarget() { return mWmService.getDefaultDisplayContentLocked().mRemoteInsetsControlTarget; Loading
services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java +4 −0 Original line number Diff line number Diff line Loading @@ -140,10 +140,14 @@ final class ImeInsetsSourceProvider extends WindowContainerInsetsSourceProvider @Override protected boolean updateClientVisibility(InsetsControlTarget caller) { if (caller != getControlTarget()) { return false; } boolean changed = super.updateClientVisibility(caller); if (changed && caller.isRequestedVisible(mSource.getType())) { reportImeDrawnForOrganizer(caller); } changed |= mDisplayContent.onImeInsetsClientVisibilityUpdate(); return changed; } Loading
services/core/java/com/android/server/wm/InputTarget.java +1 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,8 @@ package com.android.server.wm; import android.view.IWindow; import android.util.proto.ProtoOutputStream; import android.view.IWindow; /** * Common interface between focusable objects. Loading Loading @@ -58,7 +58,6 @@ interface InputTarget { boolean canScreenshotIme(); ActivityRecord getActivityRecord(); void unfreezeInsetsAfterStartInput(); boolean isInputMethodClientFocus(int uid, int pid); Loading