Loading core/java/android/view/IWindow.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,14 @@ oneway interface IWindow { */ void insetsControlChanged(in InsetsState insetsState, in InsetsSourceControl[] activeControls); /** * Called when a set of insets source window should be shown by policy. * * @param types internal inset types (WindowInsets.Type.InsetType) to show * @param fromIme true if this request originated from IME (InputMethodService). */ void showInsets(int types, boolean fromIme); void moved(int newX, int newY); void dispatchAppVisibility(boolean visible); void dispatchGetNewSurface(); Loading core/java/android/view/InsetsController.java +1 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,7 @@ public class InsetsController implements WindowInsetsController { show(types, false /* fromIme */); } private void show(@InsetType int types, boolean fromIme) { void show(@InsetType int types, boolean fromIme) { // TODO: Support a ResultReceiver for IME. // TODO(b/123718661): Make show() work for multi-session IME. int typesReady = 0; Loading core/java/android/view/ViewRootImpl.java +21 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ import android.view.SurfaceControl.Transaction; import android.view.View.AttachInfo; import android.view.View.FocusDirection; import android.view.View.MeasureSpec; import android.view.WindowInsets.Type.InsetType; import android.view.WindowManager.LayoutParams.SoftInputModeFlags; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; Loading Loading @@ -4528,6 +4529,8 @@ public final class ViewRootImpl implements ViewParent, private static final int MSG_INSETS_CONTROL_CHANGED = 31; 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; final class ViewRootHandler extends Handler { @Override Loading Loading @@ -4591,6 +4594,8 @@ public final class ViewRootImpl implements ViewParent, return "MSG_SYSTEM_GESTURE_EXCLUSION_CHANGED"; case MSG_LOCATION_IN_PARENT_DISPLAY_CHANGED: return "MSG_LOCATION_IN_PARENT_DISPLAY_CHANGED"; case MSG_SHOW_INSETS: return "MSG_SHOW_INSETS"; } return super.getMessageName(message); } Loading Loading @@ -4705,6 +4710,10 @@ public final class ViewRootImpl implements ViewParent, mInsetsController.onStateChanged((InsetsState) args.arg1); break; } case MSG_SHOW_INSETS: { mInsetsController.show(msg.arg1, msg.arg2 == 1); break; } case MSG_WINDOW_MOVED: if (mAdded) { final int w = mWinFrame.width(); Loading Loading @@ -7484,6 +7493,10 @@ public final class ViewRootImpl implements ViewParent, mHandler.obtainMessage(MSG_INSETS_CONTROL_CHANGED, args).sendToTarget(); } private void showInsets(@InsetType int types, boolean fromIme) { mHandler.obtainMessage(MSG_SHOW_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) { Loading Loading @@ -8598,6 +8611,14 @@ public final class ViewRootImpl implements ViewParent, } } @Override public void showInsets(@InsetType int types, boolean fromIme) { final ViewRootImpl viewAncestor = mViewAncestor.get(); if (viewAncestor != null) { viewAncestor.showInsets(types, fromIme); } } @Override public void moved(int newX, int newY) { final ViewRootImpl viewAncestor = mViewAncestor.get(); Loading core/java/com/android/internal/view/BaseIWindow.java +5 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.view.IWindowSession; import android.view.InsetsSourceControl; import android.view.InsetsState; import android.view.PointerIcon; import android.view.WindowInsets.Type.InsetType; import com.android.internal.os.IResultReceiver; Loading Loading @@ -74,6 +75,10 @@ public class BaseIWindow extends IWindow.Stub { InsetsSourceControl[] activeControls) throws RemoteException { } @Override public void showInsets(@InsetType int types, boolean fromIme) throws RemoteException { } @Override public void moved(int newX, int newY) { } Loading services/core/java/com/android/server/wm/InsetsControlTarget.java +12 −0 Original line number Diff line number Diff line Loading @@ -16,9 +16,21 @@ package com.android.server.wm; import android.inputmethodservice.InputMethodService; import android.view.WindowInsets.Type.InsetType; /** * Generalization of an object that can control insets state. */ interface InsetsControlTarget { void notifyInsetsControlChanged(); /** * Instructs the control target to show inset sources. * * @param types to specify which types of insets source window should be shown. * @param fromIme {@code true} if IME show request originated from {@link InputMethodService}. */ default void showInsets(@InsetType int types, boolean fromIme) { } } Loading
core/java/android/view/IWindow.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,14 @@ oneway interface IWindow { */ void insetsControlChanged(in InsetsState insetsState, in InsetsSourceControl[] activeControls); /** * Called when a set of insets source window should be shown by policy. * * @param types internal inset types (WindowInsets.Type.InsetType) to show * @param fromIme true if this request originated from IME (InputMethodService). */ void showInsets(int types, boolean fromIme); void moved(int newX, int newY); void dispatchAppVisibility(boolean visible); void dispatchGetNewSurface(); Loading
core/java/android/view/InsetsController.java +1 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,7 @@ public class InsetsController implements WindowInsetsController { show(types, false /* fromIme */); } private void show(@InsetType int types, boolean fromIme) { void show(@InsetType int types, boolean fromIme) { // TODO: Support a ResultReceiver for IME. // TODO(b/123718661): Make show() work for multi-session IME. int typesReady = 0; Loading
core/java/android/view/ViewRootImpl.java +21 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ import android.view.SurfaceControl.Transaction; import android.view.View.AttachInfo; import android.view.View.FocusDirection; import android.view.View.MeasureSpec; import android.view.WindowInsets.Type.InsetType; import android.view.WindowManager.LayoutParams.SoftInputModeFlags; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; Loading Loading @@ -4528,6 +4529,8 @@ public final class ViewRootImpl implements ViewParent, private static final int MSG_INSETS_CONTROL_CHANGED = 31; 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; final class ViewRootHandler extends Handler { @Override Loading Loading @@ -4591,6 +4594,8 @@ public final class ViewRootImpl implements ViewParent, return "MSG_SYSTEM_GESTURE_EXCLUSION_CHANGED"; case MSG_LOCATION_IN_PARENT_DISPLAY_CHANGED: return "MSG_LOCATION_IN_PARENT_DISPLAY_CHANGED"; case MSG_SHOW_INSETS: return "MSG_SHOW_INSETS"; } return super.getMessageName(message); } Loading Loading @@ -4705,6 +4710,10 @@ public final class ViewRootImpl implements ViewParent, mInsetsController.onStateChanged((InsetsState) args.arg1); break; } case MSG_SHOW_INSETS: { mInsetsController.show(msg.arg1, msg.arg2 == 1); break; } case MSG_WINDOW_MOVED: if (mAdded) { final int w = mWinFrame.width(); Loading Loading @@ -7484,6 +7493,10 @@ public final class ViewRootImpl implements ViewParent, mHandler.obtainMessage(MSG_INSETS_CONTROL_CHANGED, args).sendToTarget(); } private void showInsets(@InsetType int types, boolean fromIme) { mHandler.obtainMessage(MSG_SHOW_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) { Loading Loading @@ -8598,6 +8611,14 @@ public final class ViewRootImpl implements ViewParent, } } @Override public void showInsets(@InsetType int types, boolean fromIme) { final ViewRootImpl viewAncestor = mViewAncestor.get(); if (viewAncestor != null) { viewAncestor.showInsets(types, fromIme); } } @Override public void moved(int newX, int newY) { final ViewRootImpl viewAncestor = mViewAncestor.get(); Loading
core/java/com/android/internal/view/BaseIWindow.java +5 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.view.IWindowSession; import android.view.InsetsSourceControl; import android.view.InsetsState; import android.view.PointerIcon; import android.view.WindowInsets.Type.InsetType; import com.android.internal.os.IResultReceiver; Loading Loading @@ -74,6 +75,10 @@ public class BaseIWindow extends IWindow.Stub { InsetsSourceControl[] activeControls) throws RemoteException { } @Override public void showInsets(@InsetType int types, boolean fromIme) throws RemoteException { } @Override public void moved(int newX, int newY) { } Loading
services/core/java/com/android/server/wm/InsetsControlTarget.java +12 −0 Original line number Diff line number Diff line Loading @@ -16,9 +16,21 @@ package com.android.server.wm; import android.inputmethodservice.InputMethodService; import android.view.WindowInsets.Type.InsetType; /** * Generalization of an object that can control insets state. */ interface InsetsControlTarget { void notifyInsetsControlChanged(); /** * Instructs the control target to show inset sources. * * @param types to specify which types of insets source window should be shown. * @param fromIme {@code true} if IME show request originated from {@link InputMethodService}. */ default void showInsets(@InsetType int types, boolean fromIme) { } }