diff options
3 files changed, 17 insertions, 15 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 86ef0d82c1d1..0b8716a8aa40 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -5797,11 +5797,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo Slog.w(TAG, "Failed to deliver showInsets", e); } } - - @Override - public boolean isClientControlled() { - return false; - } } /** diff --git a/services/core/java/com/android/server/wm/InsetsControlTarget.java b/services/core/java/com/android/server/wm/InsetsControlTarget.java index 42c1a078c7e8..c50f296504fc 100644 --- a/services/core/java/com/android/server/wm/InsetsControlTarget.java +++ b/services/core/java/com/android/server/wm/InsetsControlTarget.java @@ -62,11 +62,4 @@ interface InsetsControlTarget { return false; } - /** - * Returns {@code true} if the object controlling the insets is on client. - */ - default boolean isClientControlled() { - return true; - } - } diff --git a/services/core/java/com/android/server/wm/InsetsSourceProvider.java b/services/core/java/com/android/server/wm/InsetsSourceProvider.java index c8d9fe0f0a65..8e6a2656fce3 100644 --- a/services/core/java/com/android/server/wm/InsetsSourceProvider.java +++ b/services/core/java/com/android/server/wm/InsetsSourceProvider.java @@ -351,14 +351,28 @@ class InsetsSourceProvider { } private void updateVisibility() { - final boolean isClientControlled = mControlTarget != null - && mControlTarget.isClientControlled(); - mSource.setVisible(mServerVisible && (!isClientControlled || mClientVisible)); + mSource.setVisible(mServerVisible && (isMirroredSource() || mClientVisible)); ProtoLog.d(WM_DEBUG_IME, "InsetsSource updateVisibility serverVisible: %s clientVisible: %s", mServerVisible, mClientVisible); } + private boolean isMirroredSource() { + if (mWin == null) { + return false; + } + final int[] provides = mWin.mAttrs.providesInsetsTypes; + if (provides == null) { + return false; + } + for (int i = 0; i < provides.length; i++) { + if (provides[i] == ITYPE_IME) { + return true; + } + } + return false; + } + InsetsSourceControl getControl(InsetsControlTarget target) { if (target == mControlTarget) { if (!mIsLeashReadyForDispatching && mControl != null) { |