Loading core/java/android/view/InsetsAnimationControlImpl.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.view; package android.view; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.view.InsetsController.ANIMATION_TYPE_SHOW; import static android.view.InsetsController.ANIMATION_TYPE_SHOW; import static android.view.InsetsController.AnimationType; import static android.view.InsetsController.AnimationType; import static android.view.InsetsController.DEBUG; import static android.view.InsetsController.DEBUG; Loading @@ -24,6 +25,7 @@ import static android.view.InsetsState.ISIDE_LEFT; import static android.view.InsetsState.ISIDE_RIGHT; import static android.view.InsetsState.ISIDE_RIGHT; import static android.view.InsetsState.ISIDE_TOP; import static android.view.InsetsState.ISIDE_TOP; import static android.view.InsetsState.ITYPE_IME; import static android.view.InsetsState.ITYPE_IME; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION; import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE; import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE; Loading Loading @@ -308,8 +310,8 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll false /* isScreenRound */, false /* isScreenRound */, false /* alwaysConsumeSystemBars */, null /* displayCutout */, false /* alwaysConsumeSystemBars */, null /* displayCutout */, LayoutParams.SOFT_INPUT_ADJUST_RESIZE /* legacySoftInputMode*/, LayoutParams.SOFT_INPUT_ADJUST_RESIZE /* legacySoftInputMode*/, 0 /* legacyWindowFlags */, 0 /* legacySystemUiFlags */, typeSideMap) 0 /* legacyWindowFlags */, 0 /* legacySystemUiFlags */, TYPE_APPLICATION, .getInsets(mTypes); WINDOWING_MODE_UNDEFINED, typeSideMap).getInsets(mTypes); } } private Insets sanitize(Insets insets) { private Insets sanitize(Insets insets) { Loading core/java/android/view/InsetsController.java +9 −4 Original line number Original line Diff line number Diff line Loading @@ -500,9 +500,11 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation /** Pending control request that is waiting on IME to be ready to be shown */ /** Pending control request that is waiting on IME to be ready to be shown */ private PendingControlRequest mPendingImeControlRequest; private PendingControlRequest mPendingImeControlRequest; private int mWindowType; private int mLastLegacySoftInputMode; private int mLastLegacySoftInputMode; private int mLastLegacyWindowFlags; private int mLastLegacyWindowFlags; private int mLastLegacySystemUiFlags; private int mLastLegacySystemUiFlags; private int mLastWindowingMode; private DisplayCutout mLastDisplayCutout; private DisplayCutout mLastDisplayCutout; private boolean mStartingAnimation; private boolean mStartingAnimation; private int mCaptionInsetsHeight = 0; private int mCaptionInsetsHeight = 0; Loading Loading @@ -571,7 +573,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation WindowInsets insets = state.calculateInsets(mFrame, mState /* ignoringVisibilityState*/, WindowInsets insets = state.calculateInsets(mFrame, mState /* ignoringVisibilityState*/, mLastInsets.isRound(), mLastInsets.shouldAlwaysConsumeSystemBars(), mLastInsets.isRound(), mLastInsets.shouldAlwaysConsumeSystemBars(), mLastDisplayCutout, mLastLegacySoftInputMode, mLastLegacyWindowFlags, mLastDisplayCutout, mLastLegacySoftInputMode, mLastLegacyWindowFlags, mLastLegacySystemUiFlags, null /* typeSideMap */); mLastLegacySystemUiFlags, mWindowType, mLastWindowingMode, null /* typeSideMap */); mHost.dispatchWindowInsetsAnimationProgress(insets, mUnmodifiableTmpRunningAnims); mHost.dispatchWindowInsetsAnimationProgress(insets, mUnmodifiableTmpRunningAnims); if (DEBUG) { if (DEBUG) { for (WindowInsetsAnimation anim : mUnmodifiableTmpRunningAnims) { for (WindowInsetsAnimation anim : mUnmodifiableTmpRunningAnims) { Loading Loading @@ -709,9 +712,11 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation * @see InsetsState#calculateInsets * @see InsetsState#calculateInsets */ */ @VisibleForTesting @VisibleForTesting public WindowInsets calculateInsets(boolean isScreenRound, public WindowInsets calculateInsets(boolean isScreenRound, boolean alwaysConsumeSystemBars, boolean alwaysConsumeSystemBars, DisplayCutout cutout, DisplayCutout cutout, int windowType, int windowingMode, int legacySoftInputMode, int legacyWindowFlags, int legacySystemUiFlags) { int legacySoftInputMode, int legacyWindowFlags, int legacySystemUiFlags) { mWindowType = windowType; mLastWindowingMode = windowingMode; mLastLegacySoftInputMode = legacySoftInputMode; mLastLegacySoftInputMode = legacySoftInputMode; mLastLegacyWindowFlags = legacyWindowFlags; mLastLegacyWindowFlags = legacyWindowFlags; mLastLegacySystemUiFlags = legacySystemUiFlags; mLastLegacySystemUiFlags = legacySystemUiFlags; Loading @@ -719,7 +724,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation mLastInsets = mState.calculateInsets(mFrame, null /* ignoringVisibilityState*/, mLastInsets = mState.calculateInsets(mFrame, null /* ignoringVisibilityState*/, isScreenRound, alwaysConsumeSystemBars, cutout, isScreenRound, alwaysConsumeSystemBars, cutout, legacySoftInputMode, legacyWindowFlags, legacySystemUiFlags, legacySoftInputMode, legacyWindowFlags, legacySystemUiFlags, null /* typeSideMap */); windowType, windowingMode, null /* typeSideMap */); return mLastInsets; return mLastInsets; } } Loading core/java/android/view/InsetsState.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -30,11 +30,15 @@ import static android.view.WindowInsets.Type.isVisibleInsetsType; import static android.view.WindowInsets.Type.statusBars; import static android.view.WindowInsets.Type.statusBars; import static android.view.WindowInsets.Type.systemBars; import static android.view.WindowInsets.Type.systemBars; import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN; import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST; import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ERROR; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import android.annotation.IntDef; import android.annotation.IntDef; import android.annotation.Nullable; import android.annotation.Nullable; import android.app.WindowConfiguration; import android.graphics.Insets; import android.graphics.Insets; import android.graphics.Rect; import android.graphics.Rect; import android.os.Parcel; import android.os.Parcel; Loading Loading @@ -174,6 +178,7 @@ public class InsetsState implements Parcelable { public WindowInsets calculateInsets(Rect frame, @Nullable InsetsState ignoringVisibilityState, public WindowInsets calculateInsets(Rect frame, @Nullable InsetsState ignoringVisibilityState, boolean isScreenRound, boolean alwaysConsumeSystemBars, DisplayCutout cutout, boolean isScreenRound, boolean alwaysConsumeSystemBars, DisplayCutout cutout, int legacySoftInputMode, int legacyWindowFlags, int legacySystemUiFlags, int legacySoftInputMode, int legacyWindowFlags, int legacySystemUiFlags, int windowType, @WindowConfiguration.WindowingMode int windowingMode, @Nullable @InternalInsetsSide SparseIntArray typeSideMap) { @Nullable @InternalInsetsSide SparseIntArray typeSideMap) { Insets[] typeInsetsMap = new Insets[Type.SIZE]; Insets[] typeInsetsMap = new Insets[Type.SIZE]; Insets[] typeMaxInsetsMap = new Insets[Type.SIZE]; Insets[] typeMaxInsetsMap = new Insets[Type.SIZE]; Loading Loading @@ -228,6 +233,9 @@ public class InsetsState implements Parcelable { if ((legacyWindowFlags & FLAG_FULLSCREEN) != 0) { if ((legacyWindowFlags & FLAG_FULLSCREEN) != 0) { compatInsetsTypes &= ~statusBars(); compatInsetsTypes &= ~statusBars(); } } if (clearCompatInsets(windowType, legacyWindowFlags, windowingMode)) { compatInsetsTypes = 0; } return new WindowInsets(typeInsetsMap, typeMaxInsetsMap, typeVisibilityMap, isScreenRound, return new WindowInsets(typeInsetsMap, typeMaxInsetsMap, typeVisibilityMap, isScreenRound, alwaysConsumeSystemBars, cutout, compatInsetsTypes, alwaysConsumeSystemBars, cutout, compatInsetsTypes, Loading Loading @@ -449,6 +457,12 @@ public class InsetsState implements Parcelable { mSources[source.getType()] = source; mSources[source.getType()] = source; } } public static boolean clearCompatInsets(int windowType, int windowFlags, int windowingMode) { return (windowFlags & FLAG_LAYOUT_NO_LIMITS) != 0 && windowType != TYPE_WALLPAPER && windowType != TYPE_SYSTEM_ERROR && !WindowConfiguration.inMultiWindowMode(windowingMode); } public static @InternalInsetsType ArraySet<Integer> toInternalType(@InsetsType int types) { public static @InternalInsetsType ArraySet<Integer> toInternalType(@InsetsType int types) { final ArraySet<Integer> result = new ArraySet<>(); final ArraySet<Integer> result = new ArraySet<>(); if ((types & Type.STATUS_BARS) != 0) { if ((types & Type.STATUS_BARS) != 0) { Loading core/java/android/view/ViewRootImpl.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -2253,9 +2253,11 @@ public final class ViewRootImpl implements ViewParent, /* package */ WindowInsets getWindowInsets(boolean forceConstruct) { /* package */ WindowInsets getWindowInsets(boolean forceConstruct) { if (mLastWindowInsets == null || forceConstruct) { if (mLastWindowInsets == null || forceConstruct) { final Configuration config = mContext.getResources().getConfiguration(); mLastWindowInsets = mInsetsController.calculateInsets( mLastWindowInsets = mInsetsController.calculateInsets( mContext.getResources().getConfiguration().isScreenRound(), config.isScreenRound(), mAttachInfo.mAlwaysConsumeSystemBars, mAttachInfo.mAlwaysConsumeSystemBars, mPendingDisplayCutout.get(), mPendingDisplayCutout.get(), mWindowAttributes.type, config.windowConfiguration.getWindowingMode(), mWindowAttributes.softInputMode, mWindowAttributes.flags, mWindowAttributes.softInputMode, mWindowAttributes.flags, (mWindowAttributes.systemUiVisibility (mWindowAttributes.systemUiVisibility | mWindowAttributes.subtreeSystemUiVisibility)); | mWindowAttributes.subtreeSystemUiVisibility)); Loading core/java/android/view/WindowManagerImpl.java +6 −4 Original line number Original line Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.annotation.UiContext; import android.app.ResourcesManager; import android.app.ResourcesManager; import android.compat.annotation.UnsupportedAppUsage; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.Context; import android.content.res.Configuration; import android.graphics.Insets; import android.graphics.Insets; import android.graphics.Rect; import android.graphics.Rect; import android.graphics.Region; import android.graphics.Region; Loading Loading @@ -271,13 +272,14 @@ public final class WindowManagerImpl implements WindowManager { final boolean alwaysConsumeSystemBars = WindowManagerGlobal.getWindowManagerService() final boolean alwaysConsumeSystemBars = WindowManagerGlobal.getWindowManagerService() .getWindowInsets(attrs, mContext.getDisplayId(), systemWindowInsets, .getWindowInsets(attrs, mContext.getDisplayId(), systemWindowInsets, stableInsets, displayCutout, insetsState); stableInsets, displayCutout, insetsState); final boolean isScreenRound = final Configuration config = mContext.getResources().getConfiguration(); mContext.getResources().getConfiguration().isScreenRound(); final boolean isScreenRound = config.isScreenRound(); final int windowingMode = config.windowConfiguration.getWindowingMode(); if (ViewRootImpl.sNewInsetsMode == NEW_INSETS_MODE_FULL) { if (ViewRootImpl.sNewInsetsMode == NEW_INSETS_MODE_FULL) { return insetsState.calculateInsets(bounds, null /* ignoringVisibilityState*/, return insetsState.calculateInsets(bounds, null /* ignoringVisibilityState*/, isScreenRound, alwaysConsumeSystemBars, displayCutout.get(), isScreenRound, alwaysConsumeSystemBars, displayCutout.get(), SOFT_INPUT_ADJUST_NOTHING, attrs.flags, SOFT_INPUT_ADJUST_NOTHING, attrs.flags, SYSTEM_UI_FLAG_VISIBLE, attrs.type, SYSTEM_UI_FLAG_VISIBLE, null /* typeSideMap */); windowingMode, null /* typeSideMap */); } else { } else { return new WindowInsets.Builder() return new WindowInsets.Builder() .setAlwaysConsumeSystemBars(alwaysConsumeSystemBars) .setAlwaysConsumeSystemBars(alwaysConsumeSystemBars) Loading Loading
core/java/android/view/InsetsAnimationControlImpl.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.view; package android.view; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.view.InsetsController.ANIMATION_TYPE_SHOW; import static android.view.InsetsController.ANIMATION_TYPE_SHOW; import static android.view.InsetsController.AnimationType; import static android.view.InsetsController.AnimationType; import static android.view.InsetsController.DEBUG; import static android.view.InsetsController.DEBUG; Loading @@ -24,6 +25,7 @@ import static android.view.InsetsState.ISIDE_LEFT; import static android.view.InsetsState.ISIDE_RIGHT; import static android.view.InsetsState.ISIDE_RIGHT; import static android.view.InsetsState.ISIDE_TOP; import static android.view.InsetsState.ISIDE_TOP; import static android.view.InsetsState.ITYPE_IME; import static android.view.InsetsState.ITYPE_IME; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION; import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE; import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE; Loading Loading @@ -308,8 +310,8 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll false /* isScreenRound */, false /* isScreenRound */, false /* alwaysConsumeSystemBars */, null /* displayCutout */, false /* alwaysConsumeSystemBars */, null /* displayCutout */, LayoutParams.SOFT_INPUT_ADJUST_RESIZE /* legacySoftInputMode*/, LayoutParams.SOFT_INPUT_ADJUST_RESIZE /* legacySoftInputMode*/, 0 /* legacyWindowFlags */, 0 /* legacySystemUiFlags */, typeSideMap) 0 /* legacyWindowFlags */, 0 /* legacySystemUiFlags */, TYPE_APPLICATION, .getInsets(mTypes); WINDOWING_MODE_UNDEFINED, typeSideMap).getInsets(mTypes); } } private Insets sanitize(Insets insets) { private Insets sanitize(Insets insets) { Loading
core/java/android/view/InsetsController.java +9 −4 Original line number Original line Diff line number Diff line Loading @@ -500,9 +500,11 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation /** Pending control request that is waiting on IME to be ready to be shown */ /** Pending control request that is waiting on IME to be ready to be shown */ private PendingControlRequest mPendingImeControlRequest; private PendingControlRequest mPendingImeControlRequest; private int mWindowType; private int mLastLegacySoftInputMode; private int mLastLegacySoftInputMode; private int mLastLegacyWindowFlags; private int mLastLegacyWindowFlags; private int mLastLegacySystemUiFlags; private int mLastLegacySystemUiFlags; private int mLastWindowingMode; private DisplayCutout mLastDisplayCutout; private DisplayCutout mLastDisplayCutout; private boolean mStartingAnimation; private boolean mStartingAnimation; private int mCaptionInsetsHeight = 0; private int mCaptionInsetsHeight = 0; Loading Loading @@ -571,7 +573,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation WindowInsets insets = state.calculateInsets(mFrame, mState /* ignoringVisibilityState*/, WindowInsets insets = state.calculateInsets(mFrame, mState /* ignoringVisibilityState*/, mLastInsets.isRound(), mLastInsets.shouldAlwaysConsumeSystemBars(), mLastInsets.isRound(), mLastInsets.shouldAlwaysConsumeSystemBars(), mLastDisplayCutout, mLastLegacySoftInputMode, mLastLegacyWindowFlags, mLastDisplayCutout, mLastLegacySoftInputMode, mLastLegacyWindowFlags, mLastLegacySystemUiFlags, null /* typeSideMap */); mLastLegacySystemUiFlags, mWindowType, mLastWindowingMode, null /* typeSideMap */); mHost.dispatchWindowInsetsAnimationProgress(insets, mUnmodifiableTmpRunningAnims); mHost.dispatchWindowInsetsAnimationProgress(insets, mUnmodifiableTmpRunningAnims); if (DEBUG) { if (DEBUG) { for (WindowInsetsAnimation anim : mUnmodifiableTmpRunningAnims) { for (WindowInsetsAnimation anim : mUnmodifiableTmpRunningAnims) { Loading Loading @@ -709,9 +712,11 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation * @see InsetsState#calculateInsets * @see InsetsState#calculateInsets */ */ @VisibleForTesting @VisibleForTesting public WindowInsets calculateInsets(boolean isScreenRound, public WindowInsets calculateInsets(boolean isScreenRound, boolean alwaysConsumeSystemBars, boolean alwaysConsumeSystemBars, DisplayCutout cutout, DisplayCutout cutout, int windowType, int windowingMode, int legacySoftInputMode, int legacyWindowFlags, int legacySystemUiFlags) { int legacySoftInputMode, int legacyWindowFlags, int legacySystemUiFlags) { mWindowType = windowType; mLastWindowingMode = windowingMode; mLastLegacySoftInputMode = legacySoftInputMode; mLastLegacySoftInputMode = legacySoftInputMode; mLastLegacyWindowFlags = legacyWindowFlags; mLastLegacyWindowFlags = legacyWindowFlags; mLastLegacySystemUiFlags = legacySystemUiFlags; mLastLegacySystemUiFlags = legacySystemUiFlags; Loading @@ -719,7 +724,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation mLastInsets = mState.calculateInsets(mFrame, null /* ignoringVisibilityState*/, mLastInsets = mState.calculateInsets(mFrame, null /* ignoringVisibilityState*/, isScreenRound, alwaysConsumeSystemBars, cutout, isScreenRound, alwaysConsumeSystemBars, cutout, legacySoftInputMode, legacyWindowFlags, legacySystemUiFlags, legacySoftInputMode, legacyWindowFlags, legacySystemUiFlags, null /* typeSideMap */); windowType, windowingMode, null /* typeSideMap */); return mLastInsets; return mLastInsets; } } Loading
core/java/android/view/InsetsState.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -30,11 +30,15 @@ import static android.view.WindowInsets.Type.isVisibleInsetsType; import static android.view.WindowInsets.Type.statusBars; import static android.view.WindowInsets.Type.statusBars; import static android.view.WindowInsets.Type.systemBars; import static android.view.WindowInsets.Type.systemBars; import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN; import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN; import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST; import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ERROR; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import android.annotation.IntDef; import android.annotation.IntDef; import android.annotation.Nullable; import android.annotation.Nullable; import android.app.WindowConfiguration; import android.graphics.Insets; import android.graphics.Insets; import android.graphics.Rect; import android.graphics.Rect; import android.os.Parcel; import android.os.Parcel; Loading Loading @@ -174,6 +178,7 @@ public class InsetsState implements Parcelable { public WindowInsets calculateInsets(Rect frame, @Nullable InsetsState ignoringVisibilityState, public WindowInsets calculateInsets(Rect frame, @Nullable InsetsState ignoringVisibilityState, boolean isScreenRound, boolean alwaysConsumeSystemBars, DisplayCutout cutout, boolean isScreenRound, boolean alwaysConsumeSystemBars, DisplayCutout cutout, int legacySoftInputMode, int legacyWindowFlags, int legacySystemUiFlags, int legacySoftInputMode, int legacyWindowFlags, int legacySystemUiFlags, int windowType, @WindowConfiguration.WindowingMode int windowingMode, @Nullable @InternalInsetsSide SparseIntArray typeSideMap) { @Nullable @InternalInsetsSide SparseIntArray typeSideMap) { Insets[] typeInsetsMap = new Insets[Type.SIZE]; Insets[] typeInsetsMap = new Insets[Type.SIZE]; Insets[] typeMaxInsetsMap = new Insets[Type.SIZE]; Insets[] typeMaxInsetsMap = new Insets[Type.SIZE]; Loading Loading @@ -228,6 +233,9 @@ public class InsetsState implements Parcelable { if ((legacyWindowFlags & FLAG_FULLSCREEN) != 0) { if ((legacyWindowFlags & FLAG_FULLSCREEN) != 0) { compatInsetsTypes &= ~statusBars(); compatInsetsTypes &= ~statusBars(); } } if (clearCompatInsets(windowType, legacyWindowFlags, windowingMode)) { compatInsetsTypes = 0; } return new WindowInsets(typeInsetsMap, typeMaxInsetsMap, typeVisibilityMap, isScreenRound, return new WindowInsets(typeInsetsMap, typeMaxInsetsMap, typeVisibilityMap, isScreenRound, alwaysConsumeSystemBars, cutout, compatInsetsTypes, alwaysConsumeSystemBars, cutout, compatInsetsTypes, Loading Loading @@ -449,6 +457,12 @@ public class InsetsState implements Parcelable { mSources[source.getType()] = source; mSources[source.getType()] = source; } } public static boolean clearCompatInsets(int windowType, int windowFlags, int windowingMode) { return (windowFlags & FLAG_LAYOUT_NO_LIMITS) != 0 && windowType != TYPE_WALLPAPER && windowType != TYPE_SYSTEM_ERROR && !WindowConfiguration.inMultiWindowMode(windowingMode); } public static @InternalInsetsType ArraySet<Integer> toInternalType(@InsetsType int types) { public static @InternalInsetsType ArraySet<Integer> toInternalType(@InsetsType int types) { final ArraySet<Integer> result = new ArraySet<>(); final ArraySet<Integer> result = new ArraySet<>(); if ((types & Type.STATUS_BARS) != 0) { if ((types & Type.STATUS_BARS) != 0) { Loading
core/java/android/view/ViewRootImpl.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -2253,9 +2253,11 @@ public final class ViewRootImpl implements ViewParent, /* package */ WindowInsets getWindowInsets(boolean forceConstruct) { /* package */ WindowInsets getWindowInsets(boolean forceConstruct) { if (mLastWindowInsets == null || forceConstruct) { if (mLastWindowInsets == null || forceConstruct) { final Configuration config = mContext.getResources().getConfiguration(); mLastWindowInsets = mInsetsController.calculateInsets( mLastWindowInsets = mInsetsController.calculateInsets( mContext.getResources().getConfiguration().isScreenRound(), config.isScreenRound(), mAttachInfo.mAlwaysConsumeSystemBars, mAttachInfo.mAlwaysConsumeSystemBars, mPendingDisplayCutout.get(), mPendingDisplayCutout.get(), mWindowAttributes.type, config.windowConfiguration.getWindowingMode(), mWindowAttributes.softInputMode, mWindowAttributes.flags, mWindowAttributes.softInputMode, mWindowAttributes.flags, (mWindowAttributes.systemUiVisibility (mWindowAttributes.systemUiVisibility | mWindowAttributes.subtreeSystemUiVisibility)); | mWindowAttributes.subtreeSystemUiVisibility)); Loading
core/java/android/view/WindowManagerImpl.java +6 −4 Original line number Original line Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.annotation.UiContext; import android.app.ResourcesManager; import android.app.ResourcesManager; import android.compat.annotation.UnsupportedAppUsage; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.Context; import android.content.res.Configuration; import android.graphics.Insets; import android.graphics.Insets; import android.graphics.Rect; import android.graphics.Rect; import android.graphics.Region; import android.graphics.Region; Loading Loading @@ -271,13 +272,14 @@ public final class WindowManagerImpl implements WindowManager { final boolean alwaysConsumeSystemBars = WindowManagerGlobal.getWindowManagerService() final boolean alwaysConsumeSystemBars = WindowManagerGlobal.getWindowManagerService() .getWindowInsets(attrs, mContext.getDisplayId(), systemWindowInsets, .getWindowInsets(attrs, mContext.getDisplayId(), systemWindowInsets, stableInsets, displayCutout, insetsState); stableInsets, displayCutout, insetsState); final boolean isScreenRound = final Configuration config = mContext.getResources().getConfiguration(); mContext.getResources().getConfiguration().isScreenRound(); final boolean isScreenRound = config.isScreenRound(); final int windowingMode = config.windowConfiguration.getWindowingMode(); if (ViewRootImpl.sNewInsetsMode == NEW_INSETS_MODE_FULL) { if (ViewRootImpl.sNewInsetsMode == NEW_INSETS_MODE_FULL) { return insetsState.calculateInsets(bounds, null /* ignoringVisibilityState*/, return insetsState.calculateInsets(bounds, null /* ignoringVisibilityState*/, isScreenRound, alwaysConsumeSystemBars, displayCutout.get(), isScreenRound, alwaysConsumeSystemBars, displayCutout.get(), SOFT_INPUT_ADJUST_NOTHING, attrs.flags, SOFT_INPUT_ADJUST_NOTHING, attrs.flags, SYSTEM_UI_FLAG_VISIBLE, attrs.type, SYSTEM_UI_FLAG_VISIBLE, null /* typeSideMap */); windowingMode, null /* typeSideMap */); } else { } else { return new WindowInsets.Builder() return new WindowInsets.Builder() .setAlwaysConsumeSystemBars(alwaysConsumeSystemBars) .setAlwaysConsumeSystemBars(alwaysConsumeSystemBars) Loading