diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/IWindow.aidl | 8 | ||||
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 19 |
2 files changed, 27 insertions, 0 deletions
diff --git a/core/java/android/view/IWindow.aidl b/core/java/android/view/IWindow.aidl index 4b872d3ad758..8bf99ec4f251 100644 --- a/core/java/android/view/IWindow.aidl +++ b/core/java/android/view/IWindow.aidl @@ -81,6 +81,14 @@ oneway interface IWindow { */ void showInsets(int types, boolean fromIme); + /** + * Called when a set of insets source window should be hidden by policy. + * + * @param types internal inset types (WindowInsets.Type.InsetType) to hide + * @param fromIme true if this request originated from IME (InputMethodService). + */ + void hideInsets(int types, boolean fromIme); + void moved(int newX, int newY); void dispatchAppVisibility(boolean visible); void dispatchGetNewSurface(); diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index cf0698575851..c7acf83f10b3 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -4530,6 +4530,7 @@ public final class ViewRootImpl implements ViewParent, private static final int MSG_SYSTEM_GESTURE_EXCLUSION_CHANGED = 32; private static final int MSG_LOCATION_IN_PARENT_DISPLAY_CHANGED = 33; private static final int MSG_SHOW_INSETS = 34; + private static final int MSG_HIDE_INSETS = 35; final class ViewRootHandler extends Handler { @@ -4596,6 +4597,8 @@ public final class ViewRootImpl implements ViewParent, return "MSG_LOCATION_IN_PARENT_DISPLAY_CHANGED"; case MSG_SHOW_INSETS: return "MSG_SHOW_INSETS"; + case MSG_HIDE_INSETS: + return "MSG_HIDE_INSETS"; } return super.getMessageName(message); } @@ -4714,6 +4717,10 @@ public final class ViewRootImpl implements ViewParent, mInsetsController.show(msg.arg1, msg.arg2 == 1); break; } + case MSG_HIDE_INSETS: { + mInsetsController.hide(msg.arg1, msg.arg2 == 1); + break; + } case MSG_WINDOW_MOVED: if (mAdded) { final int w = mWinFrame.width(); @@ -7513,6 +7520,10 @@ public final class ViewRootImpl implements ViewParent, mHandler.obtainMessage(MSG_SHOW_INSETS, types, fromIme ? 1 : 0).sendToTarget(); } + private void hideInsets(@InsetType int types, boolean fromIme) { + mHandler.obtainMessage(MSG_HIDE_INSETS, types, fromIme ? 1 : 0).sendToTarget(); + } + public void dispatchMoved(int newX, int newY) { if (DEBUG_LAYOUT) Log.v(mTag, "Window moved " + this + ": newX=" + newX + " newY=" + newY); if (mTranslator != null) { @@ -8636,6 +8647,14 @@ public final class ViewRootImpl implements ViewParent, } @Override + public void hideInsets(@InsetType int types, boolean fromIme) { + final ViewRootImpl viewAncestor = mViewAncestor.get(); + if (viewAncestor != null) { + viewAncestor.hideInsets(types, fromIme); + } + } + + @Override public void moved(int newX, int newY) { final ViewRootImpl viewAncestor = mViewAncestor.get(); if (viewAncestor != null) { |
