Loading core/java/android/view/InsetsAnimationControlImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -308,7 +308,7 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll false /* isScreenRound */, false /* alwaysConsumeSystemBars */, null /* displayCutout */, LayoutParams.SOFT_INPUT_ADJUST_RESIZE /* legacySoftInputMode*/, 0 /* legacySystemUiFlags */, typeSideMap) 0 /* legacyWindowFlags */, 0 /* legacySystemUiFlags */, typeSideMap) .getInsets(mTypes); } Loading core/java/android/view/InsetsController.java +6 −4 Original line number Diff line number Diff line Loading @@ -501,6 +501,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation private PendingControlRequest mPendingImeControlRequest; private int mLastLegacySoftInputMode; private int mLastLegacyWindowFlags; private int mLastLegacySystemUiFlags; private DisplayCutout mLastDisplayCutout; private boolean mStartingAnimation; Loading Loading @@ -569,8 +570,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation WindowInsets insets = state.calculateInsets(mFrame, mState /* ignoringVisibilityState*/, mLastInsets.isRound(), mLastInsets.shouldAlwaysConsumeSystemBars(), mLastDisplayCutout, mLastLegacySoftInputMode, mLastLegacySystemUiFlags, null /* typeSideMap */); mLastDisplayCutout, mLastLegacySoftInputMode, mLastLegacyWindowFlags, mLastLegacySystemUiFlags, null /* typeSideMap */); mHost.dispatchWindowInsetsAnimationProgress(insets, mUnmodifiableTmpRunningAnims); if (DEBUG) { for (WindowInsetsAnimation anim : mUnmodifiableTmpRunningAnims) { Loading Loading @@ -706,13 +707,14 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation @VisibleForTesting public WindowInsets calculateInsets(boolean isScreenRound, boolean alwaysConsumeSystemBars, DisplayCutout cutout, int legacySoftInputMode, int legacySystemUiFlags) { int legacySoftInputMode, int legacyWindowFlags, int legacySystemUiFlags) { mLastLegacySoftInputMode = legacySoftInputMode; mLastLegacyWindowFlags = legacyWindowFlags; mLastLegacySystemUiFlags = legacySystemUiFlags; mLastDisplayCutout = cutout; mLastInsets = mState.calculateInsets(mFrame, null /* ignoringVisibilityState*/, isScreenRound, alwaysConsumeSystemBars, cutout, legacySoftInputMode, legacySystemUiFlags, legacySoftInputMode, legacyWindowFlags, legacySystemUiFlags, null /* typeSideMap */); return mLastInsets; } Loading core/java/android/view/InsetsState.java +13 −6 Original line number Diff line number Diff line Loading @@ -22,13 +22,14 @@ import static android.view.ViewRootImpl.NEW_INSETS_MODE_IME; import static android.view.ViewRootImpl.NEW_INSETS_MODE_NONE; import static android.view.ViewRootImpl.sNewInsetsMode; import static android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES; import static android.view.WindowInsets.Type.SIZE; import static android.view.WindowInsets.Type.SYSTEM_GESTURES; import static android.view.WindowInsets.Type.displayCutout; import static android.view.WindowInsets.Type.ime; import static android.view.WindowInsets.Type.indexOf; import static android.view.WindowInsets.Type.isVisibleInsetsType; import static android.view.WindowInsets.Type.statusBars; import static android.view.WindowInsets.Type.systemBars; import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST; Loading @@ -38,7 +39,6 @@ import android.graphics.Insets; import android.graphics.Rect; import android.os.Parcel; import android.os.Parcelable; import android.util.ArrayMap; import android.util.ArraySet; import android.util.SparseIntArray; import android.view.WindowInsets.Type; Loading Loading @@ -171,7 +171,7 @@ public class InsetsState implements Parcelable { */ public WindowInsets calculateInsets(Rect frame, @Nullable InsetsState ignoringVisibilityState, boolean isScreenRound, boolean alwaysConsumeSystemBars, DisplayCutout cutout, int legacySoftInputMode, int legacySystemUiFlags, int legacySoftInputMode, int legacyWindowFlags, int legacySystemUiFlags, @Nullable @InternalInsetsSide SparseIntArray typeSideMap) { Insets[] typeInsetsMap = new Insets[Type.SIZE]; Insets[] typeMaxInsetsMap = new Insets[Type.SIZE]; Loading Loading @@ -218,10 +218,17 @@ public class InsetsState implements Parcelable { } } final int softInputAdjustMode = legacySoftInputMode & SOFT_INPUT_MASK_ADJUST; @InsetsType int compatInsetsTypes = systemBars() | displayCutout(); if (softInputAdjustMode == SOFT_INPUT_ADJUST_RESIZE) { compatInsetsTypes |= ime(); } if ((legacyWindowFlags & FLAG_FULLSCREEN) != 0) { compatInsetsTypes &= ~statusBars(); } return new WindowInsets(typeInsetsMap, typeMaxInsetsMap, typeVisibilityMap, isScreenRound, alwaysConsumeSystemBars, cutout, softInputAdjustMode == SOFT_INPUT_ADJUST_RESIZE ? systemBars() | displayCutout() | ime() : systemBars() | displayCutout(), alwaysConsumeSystemBars, cutout, compatInsetsTypes, sNewInsetsMode == NEW_INSETS_MODE_FULL && (legacySystemUiFlags & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0); } Loading core/java/android/view/ViewRootImpl.java +2 −1 Original line number Diff line number Diff line Loading @@ -2265,7 +2265,8 @@ public final class ViewRootImpl implements ViewParent, mLastWindowInsets = mInsetsController.calculateInsets( mContext.getResources().getConfiguration().isScreenRound(), mAttachInfo.mAlwaysConsumeSystemBars, mPendingDisplayCutout.get(), mWindowAttributes.softInputMode, (mWindowAttributes.systemUiVisibility mWindowAttributes.softInputMode, mWindowAttributes.flags, (mWindowAttributes.systemUiVisibility | mWindowAttributes.subtreeSystemUiVisibility)); Rect visibleInsets = mInsetsController.calculateVisibleInsets( Loading core/java/android/view/WindowInsets.java +12 −13 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package android.view; import static android.view.WindowInsets.Type.CAPTION_BAR; import static android.view.WindowInsets.Type.DISPLAY_CUTOUT; import static android.view.WindowInsets.Type.FIRST; import static android.view.WindowInsets.Type.IME; Loading Loading @@ -95,7 +94,7 @@ public final class WindowInsets { private final boolean mStableInsetsConsumed; private final boolean mDisplayCutoutConsumed; private final int mCompatInsetTypes; private final int mCompatInsetsTypes; private final boolean mCompatIgnoreVisibility; /** Loading Loading @@ -150,8 +149,8 @@ public final class WindowInsets { @Nullable Insets[] typeMaxInsetsMap, boolean[] typeVisibilityMap, boolean isRound, boolean alwaysConsumeSystemBars, DisplayCutout displayCutout, int compatInsetTypes, boolean compatIgnoreVisibility) { boolean alwaysConsumeSystemBars, DisplayCutout displayCutout, @InsetsType int compatInsetsTypes, boolean compatIgnoreVisibility) { mSystemWindowInsetsConsumed = typeInsetsMap == null; mTypeInsetsMap = mSystemWindowInsetsConsumed ? new Insets[SIZE] Loading @@ -165,7 +164,7 @@ public final class WindowInsets { mTypeVisibilityMap = typeVisibilityMap; mIsRound = isRound; mAlwaysConsumeSystemBars = alwaysConsumeSystemBars; mCompatInsetTypes = compatInsetTypes; mCompatInsetsTypes = compatInsetsTypes; mCompatIgnoreVisibility = compatIgnoreVisibility; mDisplayCutoutConsumed = displayCutout == null; Loading @@ -183,7 +182,7 @@ public final class WindowInsets { src.mStableInsetsConsumed ? null : src.mTypeMaxInsetsMap, src.mTypeVisibilityMap, src.mIsRound, src.mAlwaysConsumeSystemBars, displayCutoutCopyConstructorArgument(src), src.mCompatInsetTypes, src.mCompatInsetsTypes, src.mCompatIgnoreVisibility); } Loading Loading @@ -310,11 +309,11 @@ public final class WindowInsets { @NonNull public Insets getSystemWindowInsets() { Insets result = mCompatIgnoreVisibility ? getInsetsIgnoringVisibility(mCompatInsetTypes & ~ime()) : getInsets(mCompatInsetTypes); ? getInsetsIgnoringVisibility(mCompatInsetsTypes & ~ime()) : getInsets(mCompatInsetsTypes); // We can't query max insets for IME, so we need to add it manually after. if ((mCompatInsetTypes & ime()) != 0 && mCompatIgnoreVisibility) { if ((mCompatInsetsTypes & ime()) != 0 && mCompatIgnoreVisibility) { result = Insets.max(result, getInsets(ime())); } return result; Loading Loading @@ -503,7 +502,7 @@ public final class WindowInsets { mTypeVisibilityMap, mIsRound, mAlwaysConsumeSystemBars, null /* displayCutout */, mCompatInsetTypes, mCompatIgnoreVisibility); mCompatInsetsTypes, mCompatIgnoreVisibility); } Loading Loading @@ -554,7 +553,7 @@ public final class WindowInsets { mTypeVisibilityMap, mIsRound, mAlwaysConsumeSystemBars, displayCutoutCopyConstructorArgument(this), mCompatInsetTypes, mCompatIgnoreVisibility); mCompatInsetsTypes, mCompatIgnoreVisibility); } // TODO(b/119190588): replace @code with @link below Loading Loading @@ -627,7 +626,7 @@ public final class WindowInsets { @Deprecated @NonNull public Insets getStableInsets() { return getInsets(mTypeMaxInsetsMap, mCompatInsetTypes); return getInsets(mTypeMaxInsetsMap, mCompatInsetsTypes); } /** Loading Loading @@ -939,7 +938,7 @@ public final class WindowInsets { : mDisplayCutout == null ? DisplayCutout.NO_CUTOUT : mDisplayCutout.inset(left, top, right, bottom), mCompatInsetTypes, mCompatIgnoreVisibility); mCompatInsetsTypes, mCompatIgnoreVisibility); } @Override Loading Loading
core/java/android/view/InsetsAnimationControlImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -308,7 +308,7 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll false /* isScreenRound */, false /* alwaysConsumeSystemBars */, null /* displayCutout */, LayoutParams.SOFT_INPUT_ADJUST_RESIZE /* legacySoftInputMode*/, 0 /* legacySystemUiFlags */, typeSideMap) 0 /* legacyWindowFlags */, 0 /* legacySystemUiFlags */, typeSideMap) .getInsets(mTypes); } Loading
core/java/android/view/InsetsController.java +6 −4 Original line number Diff line number Diff line Loading @@ -501,6 +501,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation private PendingControlRequest mPendingImeControlRequest; private int mLastLegacySoftInputMode; private int mLastLegacyWindowFlags; private int mLastLegacySystemUiFlags; private DisplayCutout mLastDisplayCutout; private boolean mStartingAnimation; Loading Loading @@ -569,8 +570,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation WindowInsets insets = state.calculateInsets(mFrame, mState /* ignoringVisibilityState*/, mLastInsets.isRound(), mLastInsets.shouldAlwaysConsumeSystemBars(), mLastDisplayCutout, mLastLegacySoftInputMode, mLastLegacySystemUiFlags, null /* typeSideMap */); mLastDisplayCutout, mLastLegacySoftInputMode, mLastLegacyWindowFlags, mLastLegacySystemUiFlags, null /* typeSideMap */); mHost.dispatchWindowInsetsAnimationProgress(insets, mUnmodifiableTmpRunningAnims); if (DEBUG) { for (WindowInsetsAnimation anim : mUnmodifiableTmpRunningAnims) { Loading Loading @@ -706,13 +707,14 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation @VisibleForTesting public WindowInsets calculateInsets(boolean isScreenRound, boolean alwaysConsumeSystemBars, DisplayCutout cutout, int legacySoftInputMode, int legacySystemUiFlags) { int legacySoftInputMode, int legacyWindowFlags, int legacySystemUiFlags) { mLastLegacySoftInputMode = legacySoftInputMode; mLastLegacyWindowFlags = legacyWindowFlags; mLastLegacySystemUiFlags = legacySystemUiFlags; mLastDisplayCutout = cutout; mLastInsets = mState.calculateInsets(mFrame, null /* ignoringVisibilityState*/, isScreenRound, alwaysConsumeSystemBars, cutout, legacySoftInputMode, legacySystemUiFlags, legacySoftInputMode, legacyWindowFlags, legacySystemUiFlags, null /* typeSideMap */); return mLastInsets; } Loading
core/java/android/view/InsetsState.java +13 −6 Original line number Diff line number Diff line Loading @@ -22,13 +22,14 @@ import static android.view.ViewRootImpl.NEW_INSETS_MODE_IME; import static android.view.ViewRootImpl.NEW_INSETS_MODE_NONE; import static android.view.ViewRootImpl.sNewInsetsMode; import static android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES; import static android.view.WindowInsets.Type.SIZE; import static android.view.WindowInsets.Type.SYSTEM_GESTURES; import static android.view.WindowInsets.Type.displayCutout; import static android.view.WindowInsets.Type.ime; import static android.view.WindowInsets.Type.indexOf; import static android.view.WindowInsets.Type.isVisibleInsetsType; import static android.view.WindowInsets.Type.statusBars; import static android.view.WindowInsets.Type.systemBars; import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST; Loading @@ -38,7 +39,6 @@ import android.graphics.Insets; import android.graphics.Rect; import android.os.Parcel; import android.os.Parcelable; import android.util.ArrayMap; import android.util.ArraySet; import android.util.SparseIntArray; import android.view.WindowInsets.Type; Loading Loading @@ -171,7 +171,7 @@ public class InsetsState implements Parcelable { */ public WindowInsets calculateInsets(Rect frame, @Nullable InsetsState ignoringVisibilityState, boolean isScreenRound, boolean alwaysConsumeSystemBars, DisplayCutout cutout, int legacySoftInputMode, int legacySystemUiFlags, int legacySoftInputMode, int legacyWindowFlags, int legacySystemUiFlags, @Nullable @InternalInsetsSide SparseIntArray typeSideMap) { Insets[] typeInsetsMap = new Insets[Type.SIZE]; Insets[] typeMaxInsetsMap = new Insets[Type.SIZE]; Loading Loading @@ -218,10 +218,17 @@ public class InsetsState implements Parcelable { } } final int softInputAdjustMode = legacySoftInputMode & SOFT_INPUT_MASK_ADJUST; @InsetsType int compatInsetsTypes = systemBars() | displayCutout(); if (softInputAdjustMode == SOFT_INPUT_ADJUST_RESIZE) { compatInsetsTypes |= ime(); } if ((legacyWindowFlags & FLAG_FULLSCREEN) != 0) { compatInsetsTypes &= ~statusBars(); } return new WindowInsets(typeInsetsMap, typeMaxInsetsMap, typeVisibilityMap, isScreenRound, alwaysConsumeSystemBars, cutout, softInputAdjustMode == SOFT_INPUT_ADJUST_RESIZE ? systemBars() | displayCutout() | ime() : systemBars() | displayCutout(), alwaysConsumeSystemBars, cutout, compatInsetsTypes, sNewInsetsMode == NEW_INSETS_MODE_FULL && (legacySystemUiFlags & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0); } Loading
core/java/android/view/ViewRootImpl.java +2 −1 Original line number Diff line number Diff line Loading @@ -2265,7 +2265,8 @@ public final class ViewRootImpl implements ViewParent, mLastWindowInsets = mInsetsController.calculateInsets( mContext.getResources().getConfiguration().isScreenRound(), mAttachInfo.mAlwaysConsumeSystemBars, mPendingDisplayCutout.get(), mWindowAttributes.softInputMode, (mWindowAttributes.systemUiVisibility mWindowAttributes.softInputMode, mWindowAttributes.flags, (mWindowAttributes.systemUiVisibility | mWindowAttributes.subtreeSystemUiVisibility)); Rect visibleInsets = mInsetsController.calculateVisibleInsets( Loading
core/java/android/view/WindowInsets.java +12 −13 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package android.view; import static android.view.WindowInsets.Type.CAPTION_BAR; import static android.view.WindowInsets.Type.DISPLAY_CUTOUT; import static android.view.WindowInsets.Type.FIRST; import static android.view.WindowInsets.Type.IME; Loading Loading @@ -95,7 +94,7 @@ public final class WindowInsets { private final boolean mStableInsetsConsumed; private final boolean mDisplayCutoutConsumed; private final int mCompatInsetTypes; private final int mCompatInsetsTypes; private final boolean mCompatIgnoreVisibility; /** Loading Loading @@ -150,8 +149,8 @@ public final class WindowInsets { @Nullable Insets[] typeMaxInsetsMap, boolean[] typeVisibilityMap, boolean isRound, boolean alwaysConsumeSystemBars, DisplayCutout displayCutout, int compatInsetTypes, boolean compatIgnoreVisibility) { boolean alwaysConsumeSystemBars, DisplayCutout displayCutout, @InsetsType int compatInsetsTypes, boolean compatIgnoreVisibility) { mSystemWindowInsetsConsumed = typeInsetsMap == null; mTypeInsetsMap = mSystemWindowInsetsConsumed ? new Insets[SIZE] Loading @@ -165,7 +164,7 @@ public final class WindowInsets { mTypeVisibilityMap = typeVisibilityMap; mIsRound = isRound; mAlwaysConsumeSystemBars = alwaysConsumeSystemBars; mCompatInsetTypes = compatInsetTypes; mCompatInsetsTypes = compatInsetsTypes; mCompatIgnoreVisibility = compatIgnoreVisibility; mDisplayCutoutConsumed = displayCutout == null; Loading @@ -183,7 +182,7 @@ public final class WindowInsets { src.mStableInsetsConsumed ? null : src.mTypeMaxInsetsMap, src.mTypeVisibilityMap, src.mIsRound, src.mAlwaysConsumeSystemBars, displayCutoutCopyConstructorArgument(src), src.mCompatInsetTypes, src.mCompatInsetsTypes, src.mCompatIgnoreVisibility); } Loading Loading @@ -310,11 +309,11 @@ public final class WindowInsets { @NonNull public Insets getSystemWindowInsets() { Insets result = mCompatIgnoreVisibility ? getInsetsIgnoringVisibility(mCompatInsetTypes & ~ime()) : getInsets(mCompatInsetTypes); ? getInsetsIgnoringVisibility(mCompatInsetsTypes & ~ime()) : getInsets(mCompatInsetsTypes); // We can't query max insets for IME, so we need to add it manually after. if ((mCompatInsetTypes & ime()) != 0 && mCompatIgnoreVisibility) { if ((mCompatInsetsTypes & ime()) != 0 && mCompatIgnoreVisibility) { result = Insets.max(result, getInsets(ime())); } return result; Loading Loading @@ -503,7 +502,7 @@ public final class WindowInsets { mTypeVisibilityMap, mIsRound, mAlwaysConsumeSystemBars, null /* displayCutout */, mCompatInsetTypes, mCompatIgnoreVisibility); mCompatInsetsTypes, mCompatIgnoreVisibility); } Loading Loading @@ -554,7 +553,7 @@ public final class WindowInsets { mTypeVisibilityMap, mIsRound, mAlwaysConsumeSystemBars, displayCutoutCopyConstructorArgument(this), mCompatInsetTypes, mCompatIgnoreVisibility); mCompatInsetsTypes, mCompatIgnoreVisibility); } // TODO(b/119190588): replace @code with @link below Loading Loading @@ -627,7 +626,7 @@ public final class WindowInsets { @Deprecated @NonNull public Insets getStableInsets() { return getInsets(mTypeMaxInsetsMap, mCompatInsetTypes); return getInsets(mTypeMaxInsetsMap, mCompatInsetsTypes); } /** Loading Loading @@ -939,7 +938,7 @@ public final class WindowInsets { : mDisplayCutout == null ? DisplayCutout.NO_CUTOUT : mDisplayCutout.inset(left, top, right, bottom), mCompatInsetTypes, mCompatIgnoreVisibility); mCompatInsetsTypes, mCompatIgnoreVisibility); } @Override Loading