Loading core/java/android/view/IWindowSession.aidl +1 −2 Original line number Diff line number Diff line Loading @@ -318,8 +318,7 @@ interface IWindowSession { * Called when the client has changed the local insets state, and now the server should reflect * that new state. */ void insetsModified(IWindow window, in InsetsState state); oneway void insetsModified(IWindow window, in InsetsState state); /** * Called when the system gesture exclusion has changed. Loading core/java/android/view/InsetsAnimationControlImpl.java +0 −1 Original line number Diff line number Diff line Loading @@ -258,7 +258,6 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll return state.calculateInsets(frame, null /* ignoringVisibilityState */, false /* isScreenRound */, false /* alwaysConsumeSystemBars */, null /* displayCutout */, null /* legacyContentInsets */, null /* legacyStableInsets */, LayoutParams.SOFT_INPUT_ADJUST_RESIZE /* legacySoftInputMode*/, 0 /* legacySystemUiFlags */, typeSideMap) .getInsets(mTypes); Loading core/java/android/view/InsetsController.java +14 −18 Original line number Diff line number Diff line Loading @@ -363,9 +363,6 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation private final Runnable mAnimCallback; private final Rect mLastLegacyContentInsets = new Rect(); private final Rect mLastLegacyStableInsets = new Rect(); /** Pending control request that is waiting on IME to be ready to be shown */ private PendingControlRequest mPendingImeControlRequest; Loading Loading @@ -435,8 +432,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation WindowInsets insets = state.calculateInsets(mFrame, mState /* ignoringVisibilityState*/, mLastInsets.isRound(), mLastInsets.shouldAlwaysConsumeSystemBars(), mLastDisplayCutout, mLastLegacyContentInsets, mLastLegacyStableInsets, mLastLegacySoftInputMode, mLastLegacySystemUiFlags, null /* typeSideMap */); mLastDisplayCutout, mLastLegacySoftInputMode, mLastLegacySystemUiFlags, null /* typeSideMap */); mViewRoot.mView.dispatchWindowInsetsAnimationProgress(insets, mUnmodifiableTmpRunningAnims); Loading Loading @@ -466,13 +463,16 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation @VisibleForTesting public boolean onStateChanged(InsetsState state) { if (mState.equals(state) && mLastDispachedState.equals(state)) { boolean localStateChanged = !mState.equals(state); if (!localStateChanged && mLastDispachedState.equals(state)) { return false; } mState.set(state); mLastDispachedState.set(state, true /* copySources */); applyLocalVisibilityOverride(); if (localStateChanged) { mViewRoot.notifyInsetsChanged(); } if (!mState.equals(mLastDispachedState)) { sendStateToWindowManager(); } Loading @@ -484,26 +484,23 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation */ @VisibleForTesting public WindowInsets calculateInsets(boolean isScreenRound, boolean alwaysConsumeSystemBars, DisplayCutout cutout, Rect legacyContentInsets, Rect legacyStableInsets, int legacySoftInputMode, int legacySystemUiFlags) { mLastLegacyContentInsets.set(legacyContentInsets); mLastLegacyStableInsets.set(legacyStableInsets); boolean alwaysConsumeSystemBars, DisplayCutout cutout, int legacySoftInputMode, int legacySystemUiFlags) { mLastLegacySoftInputMode = legacySoftInputMode; mLastLegacySystemUiFlags = legacySystemUiFlags; mLastDisplayCutout = cutout; mLastInsets = mState.calculateInsets(mFrame, null /* ignoringVisibilityState*/, isScreenRound, alwaysConsumeSystemBars, cutout, legacyContentInsets, legacyStableInsets, legacySoftInputMode, legacySystemUiFlags, isScreenRound, alwaysConsumeSystemBars, cutout, legacySoftInputMode, legacySystemUiFlags, null /* typeSideMap */); return mLastInsets; } /** * @see InsetsState#calculateVisibleInsets(Rect, Rect, int) * @see InsetsState#calculateVisibleInsets(Rect, int) */ public Rect calculateVisibleInsets(Rect legacyVisibleInsets, @SoftInputModeFlags int softInputMode) { return mState.calculateVisibleInsets(mFrame, legacyVisibleInsets, softInputMode); public Rect calculateVisibleInsets(@SoftInputModeFlags int softInputMode) { return mState.calculateVisibleInsets(mFrame, softInputMode); } /** Loading Loading @@ -954,7 +951,6 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation } } // TODO: Put this on a dispatcher thread. try { mViewRoot.mWindowSession.insetsModified(mViewRoot.mWindow, tmpState); } catch (RemoteException e) { Loading core/java/android/view/InsetsState.java +1 −12 Original line number Diff line number Diff line Loading @@ -160,7 +160,6 @@ public class InsetsState implements Parcelable { */ public WindowInsets calculateInsets(Rect frame, @Nullable InsetsState ignoringVisibilityState, boolean isScreenRound, boolean alwaysConsumeSystemBars, DisplayCutout cutout, @Nullable Rect legacyContentInsets, @Nullable Rect legacyStableInsets, int legacySoftInputMode, int legacySystemUiFlags, @Nullable @InternalInsetsSide SparseIntArray typeSideMap) { Insets[] typeInsetsMap = new Insets[Type.SIZE]; Loading @@ -168,11 +167,6 @@ public class InsetsState implements Parcelable { boolean[] typeVisibilityMap = new boolean[SIZE]; final Rect relativeFrame = new Rect(frame); final Rect relativeFrameMax = new Rect(frame); if (ViewRootImpl.sNewInsetsMode != NEW_INSETS_MODE_FULL && legacyContentInsets != null && legacyStableInsets != null) { WindowInsets.assignCompatInsets(typeInsetsMap, legacyContentInsets); WindowInsets.assignCompatInsets(typeMaxInsetsMap, legacyStableInsets); } for (int type = FIRST_TYPE; type <= LAST_TYPE; type++) { InsetsSource source = mSources.get(type); if (source == null) { Loading Loading @@ -217,12 +211,7 @@ public class InsetsState implements Parcelable { && (legacySystemUiFlags & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0); } public Rect calculateVisibleInsets(Rect frame, Rect legacyVisibleInsets, @SoftInputModeFlags int softInputMode) { if (sNewInsetsMode == NEW_INSETS_MODE_NONE) { return legacyVisibleInsets; } public Rect calculateVisibleInsets(Rect frame, @SoftInputModeFlags int softInputMode) { Insets insets = Insets.NONE; for (int type = FIRST_TYPE; type <= LAST_TYPE; type++) { InsetsSource source = mSources.get(type); Loading core/java/android/view/View.java +7 −3 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ import android.graphics.drawable.GradientDrawable; import android.hardware.display.DisplayManagerGlobal; import android.net.Uri; import android.os.Build; import android.os.Build.VERSION_CODES; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; Loading Loading @@ -28745,7 +28746,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * of the screen decorations, these are the current insets for the * content of the window. */ @UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = VERSION_CODES.Q, publicAlternatives = "Use {@link WindowInsets#getInsets(int)}") final Rect mContentInsets = new Rect(); /** Loading @@ -28753,7 +28755,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * of the screen decorations, these are the current insets for the * actual visible parts of the window. */ @UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = VERSION_CODES.Q, publicAlternatives = "Use {@link WindowInsets#getInsets(int)}") final Rect mVisibleInsets = new Rect(); /** Loading @@ -28761,7 +28764,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * of the screen decorations, these are the current insets for the * stable system windows. */ @UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = VERSION_CODES.Q, publicAlternatives = "Use {@link WindowInsets#getInsets(int)}") final Rect mStableInsets = new Rect(); final DisplayCutout.ParcelableWrapper mDisplayCutout = Loading
core/java/android/view/IWindowSession.aidl +1 −2 Original line number Diff line number Diff line Loading @@ -318,8 +318,7 @@ interface IWindowSession { * Called when the client has changed the local insets state, and now the server should reflect * that new state. */ void insetsModified(IWindow window, in InsetsState state); oneway void insetsModified(IWindow window, in InsetsState state); /** * Called when the system gesture exclusion has changed. Loading
core/java/android/view/InsetsAnimationControlImpl.java +0 −1 Original line number Diff line number Diff line Loading @@ -258,7 +258,6 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll return state.calculateInsets(frame, null /* ignoringVisibilityState */, false /* isScreenRound */, false /* alwaysConsumeSystemBars */, null /* displayCutout */, null /* legacyContentInsets */, null /* legacyStableInsets */, LayoutParams.SOFT_INPUT_ADJUST_RESIZE /* legacySoftInputMode*/, 0 /* legacySystemUiFlags */, typeSideMap) .getInsets(mTypes); Loading
core/java/android/view/InsetsController.java +14 −18 Original line number Diff line number Diff line Loading @@ -363,9 +363,6 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation private final Runnable mAnimCallback; private final Rect mLastLegacyContentInsets = new Rect(); private final Rect mLastLegacyStableInsets = new Rect(); /** Pending control request that is waiting on IME to be ready to be shown */ private PendingControlRequest mPendingImeControlRequest; Loading Loading @@ -435,8 +432,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation WindowInsets insets = state.calculateInsets(mFrame, mState /* ignoringVisibilityState*/, mLastInsets.isRound(), mLastInsets.shouldAlwaysConsumeSystemBars(), mLastDisplayCutout, mLastLegacyContentInsets, mLastLegacyStableInsets, mLastLegacySoftInputMode, mLastLegacySystemUiFlags, null /* typeSideMap */); mLastDisplayCutout, mLastLegacySoftInputMode, mLastLegacySystemUiFlags, null /* typeSideMap */); mViewRoot.mView.dispatchWindowInsetsAnimationProgress(insets, mUnmodifiableTmpRunningAnims); Loading Loading @@ -466,13 +463,16 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation @VisibleForTesting public boolean onStateChanged(InsetsState state) { if (mState.equals(state) && mLastDispachedState.equals(state)) { boolean localStateChanged = !mState.equals(state); if (!localStateChanged && mLastDispachedState.equals(state)) { return false; } mState.set(state); mLastDispachedState.set(state, true /* copySources */); applyLocalVisibilityOverride(); if (localStateChanged) { mViewRoot.notifyInsetsChanged(); } if (!mState.equals(mLastDispachedState)) { sendStateToWindowManager(); } Loading @@ -484,26 +484,23 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation */ @VisibleForTesting public WindowInsets calculateInsets(boolean isScreenRound, boolean alwaysConsumeSystemBars, DisplayCutout cutout, Rect legacyContentInsets, Rect legacyStableInsets, int legacySoftInputMode, int legacySystemUiFlags) { mLastLegacyContentInsets.set(legacyContentInsets); mLastLegacyStableInsets.set(legacyStableInsets); boolean alwaysConsumeSystemBars, DisplayCutout cutout, int legacySoftInputMode, int legacySystemUiFlags) { mLastLegacySoftInputMode = legacySoftInputMode; mLastLegacySystemUiFlags = legacySystemUiFlags; mLastDisplayCutout = cutout; mLastInsets = mState.calculateInsets(mFrame, null /* ignoringVisibilityState*/, isScreenRound, alwaysConsumeSystemBars, cutout, legacyContentInsets, legacyStableInsets, legacySoftInputMode, legacySystemUiFlags, isScreenRound, alwaysConsumeSystemBars, cutout, legacySoftInputMode, legacySystemUiFlags, null /* typeSideMap */); return mLastInsets; } /** * @see InsetsState#calculateVisibleInsets(Rect, Rect, int) * @see InsetsState#calculateVisibleInsets(Rect, int) */ public Rect calculateVisibleInsets(Rect legacyVisibleInsets, @SoftInputModeFlags int softInputMode) { return mState.calculateVisibleInsets(mFrame, legacyVisibleInsets, softInputMode); public Rect calculateVisibleInsets(@SoftInputModeFlags int softInputMode) { return mState.calculateVisibleInsets(mFrame, softInputMode); } /** Loading Loading @@ -954,7 +951,6 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation } } // TODO: Put this on a dispatcher thread. try { mViewRoot.mWindowSession.insetsModified(mViewRoot.mWindow, tmpState); } catch (RemoteException e) { Loading
core/java/android/view/InsetsState.java +1 −12 Original line number Diff line number Diff line Loading @@ -160,7 +160,6 @@ public class InsetsState implements Parcelable { */ public WindowInsets calculateInsets(Rect frame, @Nullable InsetsState ignoringVisibilityState, boolean isScreenRound, boolean alwaysConsumeSystemBars, DisplayCutout cutout, @Nullable Rect legacyContentInsets, @Nullable Rect legacyStableInsets, int legacySoftInputMode, int legacySystemUiFlags, @Nullable @InternalInsetsSide SparseIntArray typeSideMap) { Insets[] typeInsetsMap = new Insets[Type.SIZE]; Loading @@ -168,11 +167,6 @@ public class InsetsState implements Parcelable { boolean[] typeVisibilityMap = new boolean[SIZE]; final Rect relativeFrame = new Rect(frame); final Rect relativeFrameMax = new Rect(frame); if (ViewRootImpl.sNewInsetsMode != NEW_INSETS_MODE_FULL && legacyContentInsets != null && legacyStableInsets != null) { WindowInsets.assignCompatInsets(typeInsetsMap, legacyContentInsets); WindowInsets.assignCompatInsets(typeMaxInsetsMap, legacyStableInsets); } for (int type = FIRST_TYPE; type <= LAST_TYPE; type++) { InsetsSource source = mSources.get(type); if (source == null) { Loading Loading @@ -217,12 +211,7 @@ public class InsetsState implements Parcelable { && (legacySystemUiFlags & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0); } public Rect calculateVisibleInsets(Rect frame, Rect legacyVisibleInsets, @SoftInputModeFlags int softInputMode) { if (sNewInsetsMode == NEW_INSETS_MODE_NONE) { return legacyVisibleInsets; } public Rect calculateVisibleInsets(Rect frame, @SoftInputModeFlags int softInputMode) { Insets insets = Insets.NONE; for (int type = FIRST_TYPE; type <= LAST_TYPE; type++) { InsetsSource source = mSources.get(type); Loading
core/java/android/view/View.java +7 −3 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ import android.graphics.drawable.GradientDrawable; import android.hardware.display.DisplayManagerGlobal; import android.net.Uri; import android.os.Build; import android.os.Build.VERSION_CODES; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; Loading Loading @@ -28745,7 +28746,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * of the screen decorations, these are the current insets for the * content of the window. */ @UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = VERSION_CODES.Q, publicAlternatives = "Use {@link WindowInsets#getInsets(int)}") final Rect mContentInsets = new Rect(); /** Loading @@ -28753,7 +28755,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * of the screen decorations, these are the current insets for the * actual visible parts of the window. */ @UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = VERSION_CODES.Q, publicAlternatives = "Use {@link WindowInsets#getInsets(int)}") final Rect mVisibleInsets = new Rect(); /** Loading @@ -28761,7 +28764,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * of the screen decorations, these are the current insets for the * stable system windows. */ @UnsupportedAppUsage @UnsupportedAppUsage(maxTargetSdk = VERSION_CODES.Q, publicAlternatives = "Use {@link WindowInsets#getInsets(int)}") final Rect mStableInsets = new Rect(); final DisplayCutout.ParcelableWrapper mDisplayCutout =