Loading core/java/android/view/InsetsState.java +16 −2 Original line number Diff line number Diff line Loading @@ -89,7 +89,9 @@ public class InsetsState implements Parcelable { ITYPE_BOTTOM_DISPLAY_CUTOUT, ITYPE_IME, ITYPE_CLIMATE_BAR, ITYPE_EXTRA_NAVIGATION_BAR ITYPE_EXTRA_NAVIGATION_BAR, ITYPE_LOCAL_NAVIGATION_BAR_1, ITYPE_LOCAL_NAVIGATION_BAR_2 }) public @interface InternalInsetsType {} Loading Loading @@ -132,7 +134,11 @@ public class InsetsState implements Parcelable { public static final int ITYPE_CLIMATE_BAR = 20; public static final int ITYPE_EXTRA_NAVIGATION_BAR = 21; static final int LAST_TYPE = ITYPE_EXTRA_NAVIGATION_BAR; /** Additional types for local insets. **/ public static final int ITYPE_LOCAL_NAVIGATION_BAR_1 = 22; public static final int ITYPE_LOCAL_NAVIGATION_BAR_2 = 23; static final int LAST_TYPE = ITYPE_LOCAL_NAVIGATION_BAR_2; public static final int SIZE = LAST_TYPE + 1; // Derived types Loading Loading @@ -674,6 +680,8 @@ public class InsetsState implements Parcelable { if ((types & Type.NAVIGATION_BARS) != 0) { result.add(ITYPE_NAVIGATION_BAR); result.add(ITYPE_EXTRA_NAVIGATION_BAR); result.add(ITYPE_LOCAL_NAVIGATION_BAR_1); result.add(ITYPE_LOCAL_NAVIGATION_BAR_2); } if ((types & Type.CAPTION_BAR) != 0) { result.add(ITYPE_CAPTION_BAR); Loading Loading @@ -714,6 +722,8 @@ public class InsetsState implements Parcelable { return Type.STATUS_BARS; case ITYPE_NAVIGATION_BAR: case ITYPE_EXTRA_NAVIGATION_BAR: case ITYPE_LOCAL_NAVIGATION_BAR_1: case ITYPE_LOCAL_NAVIGATION_BAR_2: return Type.NAVIGATION_BARS; case ITYPE_CAPTION_BAR: return Type.CAPTION_BAR; Loading Loading @@ -833,6 +843,10 @@ public class InsetsState implements Parcelable { return "ITYPE_CLIMATE_BAR"; case ITYPE_EXTRA_NAVIGATION_BAR: return "ITYPE_EXTRA_NAVIGATION_BAR"; case ITYPE_LOCAL_NAVIGATION_BAR_1: return "ITYPE_LOCAL_NAVIGATION_BAR_1"; case ITYPE_LOCAL_NAVIGATION_BAR_2: return "ITYPE_LOCAL_NAVIGATION_BAR_2"; default: return "ITYPE_UNKNOWN_" + type; } Loading services/core/java/com/android/server/wm/DisplayContent.java +15 −4 Original line number Diff line number Diff line Loading @@ -3326,8 +3326,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } if (mInsetsStateController != null) { for (@InternalInsetsType int type = 0; type < InsetsState.SIZE; type++) { final InsetsSourceProvider provider = mInsetsStateController.peekSourceProvider( type); final WindowContainerInsetsSourceProvider provider = mInsetsStateController .peekSourceProvider(type); if (provider != null) { provider.dumpDebug(proto, type == ITYPE_IME ? IME_INSETS_SOURCE_PROVIDER : INSETS_SOURCE_PROVIDERS, logLevel); Loading Loading @@ -4036,7 +4036,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // app. assignWindowLayers(true /* setLayoutNeeded */); // 3. The z-order of IME might have been changed. Update the above insets state. mInsetsStateController.updateAboveInsetsState(mInputMethodWindow, mInsetsStateController.updateAboveInsetsState( mInsetsStateController.getRawInsetsState().getSourceOrDefaultVisibility(ITYPE_IME)); // 4. Update the IME control target to apply any inset change and animation. // 5. Reparent the IME container surface to either the input target app, or the IME window Loading Loading @@ -4167,7 +4167,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp if (mImeInputTarget != target) { ProtoLog.i(WM_DEBUG_IME, "setInputMethodInputTarget %s", target); setImeInputTarget(target); mInsetsStateController.updateAboveInsetsState(mInputMethodWindow, mInsetsStateController mInsetsStateController.updateAboveInsetsState(mInsetsStateController .getRawInsetsState().getSourceOrDefaultVisibility(ITYPE_IME)); updateImeControlTarget(); } Loading Loading @@ -4809,6 +4809,17 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return candidate; } @Override void updateAboveInsetsState(InsetsState aboveInsetsState, SparseArray<InsetsSourceProvider> localInsetsSourceProvidersFromParent, ArraySet<WindowState> insetsChangedWindows) { if (skipImeWindowsDuringTraversal(mDisplayContent)) { return; } super.updateAboveInsetsState(aboveInsetsState, localInsetsSourceProvidersFromParent, insetsChangedWindows); } @Override boolean forAllWindows(ToBooleanFunction<WindowState> callback, boolean traverseTopToBottom) { Loading services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ import java.io.PrintWriter; * Controller for IME inset source on the server. It's called provider as it provides the * {@link InsetsSource} to the client that uses it in {@link InsetsSourceConsumer}. */ final class ImeInsetsSourceProvider extends InsetsSourceProvider { final class ImeInsetsSourceProvider extends WindowContainerInsetsSourceProvider { private InsetsControlTarget mImeRequester; private Runnable mShowImeRunner; Loading services/core/java/com/android/server/wm/InsetsPolicy.java +5 −4 Original line number Diff line number Diff line Loading @@ -176,7 +176,8 @@ class InsetsPolicy { } boolean isHidden(@InternalInsetsType int type) { final InsetsSourceProvider provider = mStateController.peekSourceProvider(type); final WindowContainerInsetsSourceProvider provider = mStateController .peekSourceProvider(type); return provider != null && provider.hasWindowContainer() && !provider.getSource().isVisible(); } Loading Loading @@ -358,10 +359,10 @@ class InsetsPolicy { // IME needs different frames for certain cases (e.g. navigation bar in gesture nav). if (type == ITYPE_IME) { ArrayMap<Integer, InsetsSourceProvider> providers = mStateController ArrayMap<Integer, WindowContainerInsetsSourceProvider> providers = mStateController .getSourceProviders(); for (int i = providers.size() - 1; i >= 0; i--) { InsetsSourceProvider otherProvider = providers.valueAt(i); WindowContainerInsetsSourceProvider otherProvider = providers.valueAt(i); if (otherProvider.overridesImeFrame()) { InsetsSource override = new InsetsSource( Loading Loading @@ -662,7 +663,7 @@ class InsetsPolicy { final IntArray showingTransientTypes = mShowingTransientTypes; for (int i = showingTransientTypes.size() - 1; i >= 0; i--) { final @InternalInsetsType int type = showingTransientTypes.get(i); InsetsSourceProvider provider = mStateController.getSourceProvider(type); WindowContainerInsetsSourceProvider provider = mStateController.getSourceProvider(type); InsetsSourceControl control = provider.getControl(mDummyControlTarget); if (control == null || control.getLeash() == null) { continue; Loading services/core/java/com/android/server/wm/InsetsSourceProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ import java.util.function.Consumer; * Controller for a specific inset source on the server. It's called provider as it provides the * {@link InsetsSource} to the client that uses it in {@link android.view.InsetsSourceConsumer}. */ class InsetsSourceProvider { abstract class InsetsSourceProvider { protected final DisplayContent mDisplayContent; protected final @NonNull InsetsSource mSource; Loading Loading
core/java/android/view/InsetsState.java +16 −2 Original line number Diff line number Diff line Loading @@ -89,7 +89,9 @@ public class InsetsState implements Parcelable { ITYPE_BOTTOM_DISPLAY_CUTOUT, ITYPE_IME, ITYPE_CLIMATE_BAR, ITYPE_EXTRA_NAVIGATION_BAR ITYPE_EXTRA_NAVIGATION_BAR, ITYPE_LOCAL_NAVIGATION_BAR_1, ITYPE_LOCAL_NAVIGATION_BAR_2 }) public @interface InternalInsetsType {} Loading Loading @@ -132,7 +134,11 @@ public class InsetsState implements Parcelable { public static final int ITYPE_CLIMATE_BAR = 20; public static final int ITYPE_EXTRA_NAVIGATION_BAR = 21; static final int LAST_TYPE = ITYPE_EXTRA_NAVIGATION_BAR; /** Additional types for local insets. **/ public static final int ITYPE_LOCAL_NAVIGATION_BAR_1 = 22; public static final int ITYPE_LOCAL_NAVIGATION_BAR_2 = 23; static final int LAST_TYPE = ITYPE_LOCAL_NAVIGATION_BAR_2; public static final int SIZE = LAST_TYPE + 1; // Derived types Loading Loading @@ -674,6 +680,8 @@ public class InsetsState implements Parcelable { if ((types & Type.NAVIGATION_BARS) != 0) { result.add(ITYPE_NAVIGATION_BAR); result.add(ITYPE_EXTRA_NAVIGATION_BAR); result.add(ITYPE_LOCAL_NAVIGATION_BAR_1); result.add(ITYPE_LOCAL_NAVIGATION_BAR_2); } if ((types & Type.CAPTION_BAR) != 0) { result.add(ITYPE_CAPTION_BAR); Loading Loading @@ -714,6 +722,8 @@ public class InsetsState implements Parcelable { return Type.STATUS_BARS; case ITYPE_NAVIGATION_BAR: case ITYPE_EXTRA_NAVIGATION_BAR: case ITYPE_LOCAL_NAVIGATION_BAR_1: case ITYPE_LOCAL_NAVIGATION_BAR_2: return Type.NAVIGATION_BARS; case ITYPE_CAPTION_BAR: return Type.CAPTION_BAR; Loading Loading @@ -833,6 +843,10 @@ public class InsetsState implements Parcelable { return "ITYPE_CLIMATE_BAR"; case ITYPE_EXTRA_NAVIGATION_BAR: return "ITYPE_EXTRA_NAVIGATION_BAR"; case ITYPE_LOCAL_NAVIGATION_BAR_1: return "ITYPE_LOCAL_NAVIGATION_BAR_1"; case ITYPE_LOCAL_NAVIGATION_BAR_2: return "ITYPE_LOCAL_NAVIGATION_BAR_2"; default: return "ITYPE_UNKNOWN_" + type; } Loading
services/core/java/com/android/server/wm/DisplayContent.java +15 −4 Original line number Diff line number Diff line Loading @@ -3326,8 +3326,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } if (mInsetsStateController != null) { for (@InternalInsetsType int type = 0; type < InsetsState.SIZE; type++) { final InsetsSourceProvider provider = mInsetsStateController.peekSourceProvider( type); final WindowContainerInsetsSourceProvider provider = mInsetsStateController .peekSourceProvider(type); if (provider != null) { provider.dumpDebug(proto, type == ITYPE_IME ? IME_INSETS_SOURCE_PROVIDER : INSETS_SOURCE_PROVIDERS, logLevel); Loading Loading @@ -4036,7 +4036,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // app. assignWindowLayers(true /* setLayoutNeeded */); // 3. The z-order of IME might have been changed. Update the above insets state. mInsetsStateController.updateAboveInsetsState(mInputMethodWindow, mInsetsStateController.updateAboveInsetsState( mInsetsStateController.getRawInsetsState().getSourceOrDefaultVisibility(ITYPE_IME)); // 4. Update the IME control target to apply any inset change and animation. // 5. Reparent the IME container surface to either the input target app, or the IME window Loading Loading @@ -4167,7 +4167,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp if (mImeInputTarget != target) { ProtoLog.i(WM_DEBUG_IME, "setInputMethodInputTarget %s", target); setImeInputTarget(target); mInsetsStateController.updateAboveInsetsState(mInputMethodWindow, mInsetsStateController mInsetsStateController.updateAboveInsetsState(mInsetsStateController .getRawInsetsState().getSourceOrDefaultVisibility(ITYPE_IME)); updateImeControlTarget(); } Loading Loading @@ -4809,6 +4809,17 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp return candidate; } @Override void updateAboveInsetsState(InsetsState aboveInsetsState, SparseArray<InsetsSourceProvider> localInsetsSourceProvidersFromParent, ArraySet<WindowState> insetsChangedWindows) { if (skipImeWindowsDuringTraversal(mDisplayContent)) { return; } super.updateAboveInsetsState(aboveInsetsState, localInsetsSourceProvidersFromParent, insetsChangedWindows); } @Override boolean forAllWindows(ToBooleanFunction<WindowState> callback, boolean traverseTopToBottom) { Loading
services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ import java.io.PrintWriter; * Controller for IME inset source on the server. It's called provider as it provides the * {@link InsetsSource} to the client that uses it in {@link InsetsSourceConsumer}. */ final class ImeInsetsSourceProvider extends InsetsSourceProvider { final class ImeInsetsSourceProvider extends WindowContainerInsetsSourceProvider { private InsetsControlTarget mImeRequester; private Runnable mShowImeRunner; Loading
services/core/java/com/android/server/wm/InsetsPolicy.java +5 −4 Original line number Diff line number Diff line Loading @@ -176,7 +176,8 @@ class InsetsPolicy { } boolean isHidden(@InternalInsetsType int type) { final InsetsSourceProvider provider = mStateController.peekSourceProvider(type); final WindowContainerInsetsSourceProvider provider = mStateController .peekSourceProvider(type); return provider != null && provider.hasWindowContainer() && !provider.getSource().isVisible(); } Loading Loading @@ -358,10 +359,10 @@ class InsetsPolicy { // IME needs different frames for certain cases (e.g. navigation bar in gesture nav). if (type == ITYPE_IME) { ArrayMap<Integer, InsetsSourceProvider> providers = mStateController ArrayMap<Integer, WindowContainerInsetsSourceProvider> providers = mStateController .getSourceProviders(); for (int i = providers.size() - 1; i >= 0; i--) { InsetsSourceProvider otherProvider = providers.valueAt(i); WindowContainerInsetsSourceProvider otherProvider = providers.valueAt(i); if (otherProvider.overridesImeFrame()) { InsetsSource override = new InsetsSource( Loading Loading @@ -662,7 +663,7 @@ class InsetsPolicy { final IntArray showingTransientTypes = mShowingTransientTypes; for (int i = showingTransientTypes.size() - 1; i >= 0; i--) { final @InternalInsetsType int type = showingTransientTypes.get(i); InsetsSourceProvider provider = mStateController.getSourceProvider(type); WindowContainerInsetsSourceProvider provider = mStateController.getSourceProvider(type); InsetsSourceControl control = provider.getControl(mDummyControlTarget); if (control == null || control.getLeash() == null) { continue; Loading
services/core/java/com/android/server/wm/InsetsSourceProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ import java.util.function.Consumer; * Controller for a specific inset source on the server. It's called provider as it provides the * {@link InsetsSource} to the client that uses it in {@link android.view.InsetsSourceConsumer}. */ class InsetsSourceProvider { abstract class InsetsSourceProvider { protected final DisplayContent mDisplayContent; protected final @NonNull InsetsSource mSource; Loading