Loading core/java/android/view/ViewRootImpl.java +5 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static android.os.Trace.TRACE_TAG_VIEW; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.INVALID_DISPLAY; import static android.view.DragEvent.ACTION_DRAG_LOCATION; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_APP_PROGRESS_GENERATION_ALLOWED; import static android.view.flags.Flags.sensitiveContentPrematureProtectionRemovedFix; import static android.view.InputDevice.SOURCE_CLASS_NONE; import static android.view.InsetsSource.ID_IME; Loading Loading @@ -271,6 +272,7 @@ import com.android.internal.inputmethod.ImeTracing; import com.android.internal.inputmethod.InputMethodDebug; import com.android.internal.os.IResultReceiver; import com.android.internal.os.SomeArgs; import com.android.internal.policy.DecorView; import com.android.internal.policy.PhoneFallbackEventHandler; import com.android.internal.util.FastPrintWriter; import com.android.internal.view.BaseSurfaceHolder; Loading Loading @@ -1576,6 +1578,9 @@ public final class ViewRootImpl implements ViewParent, pendingInsetsController.replayAndAttach(mInsetsController); } } if (mView instanceof DecorView) { mWindowAttributes.privateFlags |= PRIVATE_FLAG_APP_PROGRESS_GENERATION_ALLOWED; } try { mOrigWindowType = mWindowAttributes.type; Loading core/java/android/view/WindowManager.java +6 −0 Original line number Diff line number Diff line Loading @@ -3307,6 +3307,11 @@ public interface WindowManager extends ViewManager { @UnsupportedAppUsage public static final int PRIVATE_FLAG_NO_MOVE_ANIMATION = 1 << 6; /** Window flag: the client side view can intercept back progress, so system does not * need to pilfer pointers. * {@hide} */ public static final int PRIVATE_FLAG_APP_PROGRESS_GENERATION_ALLOWED = 1 << 7; /** Window flag: a special option intended for system dialogs. When * this flag is set, the window will demand focus unconditionally when * it is created. Loading Loading @@ -3500,6 +3505,7 @@ public interface WindowManager extends ViewManager { SYSTEM_FLAG_SHOW_FOR_ALL_USERS, PRIVATE_FLAG_UNRESTRICTED_GESTURE_EXCLUSION, PRIVATE_FLAG_NO_MOVE_ANIMATION, PRIVATE_FLAG_APP_PROGRESS_GENERATION_ALLOWED, PRIVATE_FLAG_SYSTEM_ERROR, PRIVATE_FLAG_OPTIMIZE_MEASURE, PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS, Loading core/java/android/window/BackNavigationInfo.java +27 −2 Original line number Diff line number Diff line Loading @@ -117,6 +117,8 @@ public final class BackNavigationInfo implements Parcelable { @NonNull private final Rect mTouchableRegion; private final boolean mAppProgressGenerationAllowed; /** * Create a new {@link BackNavigationInfo} instance. * Loading @@ -132,7 +134,8 @@ public final class BackNavigationInfo implements Parcelable { boolean isAnimationCallback, @Nullable CustomAnimationInfo customAnimationInfo, int letterboxColor, @Nullable Rect touchableRegion) { @Nullable Rect touchableRegion, boolean appProgressGenerationAllowed) { mType = type; mOnBackNavigationDone = onBackNavigationDone; mOnBackInvokedCallback = onBackInvokedCallback; Loading @@ -141,6 +144,7 @@ public final class BackNavigationInfo implements Parcelable { mCustomAnimationInfo = customAnimationInfo; mLetterboxColor = letterboxColor; mTouchableRegion = new Rect(touchableRegion); mAppProgressGenerationAllowed = appProgressGenerationAllowed; } private BackNavigationInfo(@NonNull Parcel in) { Loading @@ -152,6 +156,7 @@ public final class BackNavigationInfo implements Parcelable { mCustomAnimationInfo = in.readTypedObject(CustomAnimationInfo.CREATOR); mLetterboxColor = in.readInt(); mTouchableRegion = in.readTypedObject(Rect.CREATOR); mAppProgressGenerationAllowed = in.readBoolean(); } /** @hide */ Loading @@ -165,6 +170,7 @@ public final class BackNavigationInfo implements Parcelable { dest.writeTypedObject(mCustomAnimationInfo, flags); dest.writeInt(mLetterboxColor); dest.writeTypedObject(mTouchableRegion, flags); dest.writeBoolean(mAppProgressGenerationAllowed); } /** Loading Loading @@ -223,6 +229,14 @@ public final class BackNavigationInfo implements Parcelable { return mTouchableRegion; } /** * @return The client side view is able to intercept back progress event. * @hide */ public boolean isAppProgressGenerationAllowed() { return mAppProgressGenerationAllowed; } /** * Callback to be called when the back preview is finished in order to notify the server that * it can clean up the resources created for the animation. Loading Loading @@ -420,6 +434,7 @@ public final class BackNavigationInfo implements Parcelable { private int mLetterboxColor = Color.TRANSPARENT; private Rect mTouchableRegion; private boolean mAppProgressGenerationAllowed; /** * @see BackNavigationInfo#getType() Loading Loading @@ -502,6 +517,15 @@ public final class BackNavigationInfo implements Parcelable { mTouchableRegion = new Rect(rect); return this; } /** * @param allowed Whether client side view able to intercept back progress event. */ public Builder setAppProgressAllowed(boolean allowed) { mAppProgressGenerationAllowed = allowed; return this; } /** * Builds and returns an instance of {@link BackNavigationInfo} */ Loading @@ -512,7 +536,8 @@ public final class BackNavigationInfo implements Parcelable { mAnimationCallback, mCustomAnimationInfo, mLetterboxColor, mTouchableRegion); mTouchableRegion, mAppProgressGenerationAllowed); } } } libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +2 −1 Original line number Diff line number Diff line Loading @@ -437,7 +437,8 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont } private boolean isAppProgressGenerationAllowed() { return mBackNavigationInfo.getTouchableRegion().equals(mTouchableArea); return mBackNavigationInfo.isAppProgressGenerationAllowed() && mBackNavigationInfo.getTouchableRegion().equals(mTouchableArea); } /** Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -550,7 +550,8 @@ public class BackAnimationControllerTest extends ShellTestCase { .setType(type) .setOnBackInvokedCallback(mAppCallback) .setOnBackNavigationDone(new RemoteCallback(result)) .setTouchableRegion(mTouchableRegion)); .setTouchableRegion(mTouchableRegion) .setAppProgressAllowed(true)); triggerBackGesture(); mShellExecutor.flushAll(); releaseBackGesture(); Loading Loading
core/java/android/view/ViewRootImpl.java +5 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static android.os.Trace.TRACE_TAG_VIEW; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.INVALID_DISPLAY; import static android.view.DragEvent.ACTION_DRAG_LOCATION; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_APP_PROGRESS_GENERATION_ALLOWED; import static android.view.flags.Flags.sensitiveContentPrematureProtectionRemovedFix; import static android.view.InputDevice.SOURCE_CLASS_NONE; import static android.view.InsetsSource.ID_IME; Loading Loading @@ -271,6 +272,7 @@ import com.android.internal.inputmethod.ImeTracing; import com.android.internal.inputmethod.InputMethodDebug; import com.android.internal.os.IResultReceiver; import com.android.internal.os.SomeArgs; import com.android.internal.policy.DecorView; import com.android.internal.policy.PhoneFallbackEventHandler; import com.android.internal.util.FastPrintWriter; import com.android.internal.view.BaseSurfaceHolder; Loading Loading @@ -1576,6 +1578,9 @@ public final class ViewRootImpl implements ViewParent, pendingInsetsController.replayAndAttach(mInsetsController); } } if (mView instanceof DecorView) { mWindowAttributes.privateFlags |= PRIVATE_FLAG_APP_PROGRESS_GENERATION_ALLOWED; } try { mOrigWindowType = mWindowAttributes.type; Loading
core/java/android/view/WindowManager.java +6 −0 Original line number Diff line number Diff line Loading @@ -3307,6 +3307,11 @@ public interface WindowManager extends ViewManager { @UnsupportedAppUsage public static final int PRIVATE_FLAG_NO_MOVE_ANIMATION = 1 << 6; /** Window flag: the client side view can intercept back progress, so system does not * need to pilfer pointers. * {@hide} */ public static final int PRIVATE_FLAG_APP_PROGRESS_GENERATION_ALLOWED = 1 << 7; /** Window flag: a special option intended for system dialogs. When * this flag is set, the window will demand focus unconditionally when * it is created. Loading Loading @@ -3500,6 +3505,7 @@ public interface WindowManager extends ViewManager { SYSTEM_FLAG_SHOW_FOR_ALL_USERS, PRIVATE_FLAG_UNRESTRICTED_GESTURE_EXCLUSION, PRIVATE_FLAG_NO_MOVE_ANIMATION, PRIVATE_FLAG_APP_PROGRESS_GENERATION_ALLOWED, PRIVATE_FLAG_SYSTEM_ERROR, PRIVATE_FLAG_OPTIMIZE_MEASURE, PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS, Loading
core/java/android/window/BackNavigationInfo.java +27 −2 Original line number Diff line number Diff line Loading @@ -117,6 +117,8 @@ public final class BackNavigationInfo implements Parcelable { @NonNull private final Rect mTouchableRegion; private final boolean mAppProgressGenerationAllowed; /** * Create a new {@link BackNavigationInfo} instance. * Loading @@ -132,7 +134,8 @@ public final class BackNavigationInfo implements Parcelable { boolean isAnimationCallback, @Nullable CustomAnimationInfo customAnimationInfo, int letterboxColor, @Nullable Rect touchableRegion) { @Nullable Rect touchableRegion, boolean appProgressGenerationAllowed) { mType = type; mOnBackNavigationDone = onBackNavigationDone; mOnBackInvokedCallback = onBackInvokedCallback; Loading @@ -141,6 +144,7 @@ public final class BackNavigationInfo implements Parcelable { mCustomAnimationInfo = customAnimationInfo; mLetterboxColor = letterboxColor; mTouchableRegion = new Rect(touchableRegion); mAppProgressGenerationAllowed = appProgressGenerationAllowed; } private BackNavigationInfo(@NonNull Parcel in) { Loading @@ -152,6 +156,7 @@ public final class BackNavigationInfo implements Parcelable { mCustomAnimationInfo = in.readTypedObject(CustomAnimationInfo.CREATOR); mLetterboxColor = in.readInt(); mTouchableRegion = in.readTypedObject(Rect.CREATOR); mAppProgressGenerationAllowed = in.readBoolean(); } /** @hide */ Loading @@ -165,6 +170,7 @@ public final class BackNavigationInfo implements Parcelable { dest.writeTypedObject(mCustomAnimationInfo, flags); dest.writeInt(mLetterboxColor); dest.writeTypedObject(mTouchableRegion, flags); dest.writeBoolean(mAppProgressGenerationAllowed); } /** Loading Loading @@ -223,6 +229,14 @@ public final class BackNavigationInfo implements Parcelable { return mTouchableRegion; } /** * @return The client side view is able to intercept back progress event. * @hide */ public boolean isAppProgressGenerationAllowed() { return mAppProgressGenerationAllowed; } /** * Callback to be called when the back preview is finished in order to notify the server that * it can clean up the resources created for the animation. Loading Loading @@ -420,6 +434,7 @@ public final class BackNavigationInfo implements Parcelable { private int mLetterboxColor = Color.TRANSPARENT; private Rect mTouchableRegion; private boolean mAppProgressGenerationAllowed; /** * @see BackNavigationInfo#getType() Loading Loading @@ -502,6 +517,15 @@ public final class BackNavigationInfo implements Parcelable { mTouchableRegion = new Rect(rect); return this; } /** * @param allowed Whether client side view able to intercept back progress event. */ public Builder setAppProgressAllowed(boolean allowed) { mAppProgressGenerationAllowed = allowed; return this; } /** * Builds and returns an instance of {@link BackNavigationInfo} */ Loading @@ -512,7 +536,8 @@ public final class BackNavigationInfo implements Parcelable { mAnimationCallback, mCustomAnimationInfo, mLetterboxColor, mTouchableRegion); mTouchableRegion, mAppProgressGenerationAllowed); } } }
libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +2 −1 Original line number Diff line number Diff line Loading @@ -437,7 +437,8 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont } private boolean isAppProgressGenerationAllowed() { return mBackNavigationInfo.getTouchableRegion().equals(mTouchableArea); return mBackNavigationInfo.isAppProgressGenerationAllowed() && mBackNavigationInfo.getTouchableRegion().equals(mTouchableArea); } /** Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -550,7 +550,8 @@ public class BackAnimationControllerTest extends ShellTestCase { .setType(type) .setOnBackInvokedCallback(mAppCallback) .setOnBackNavigationDone(new RemoteCallback(result)) .setTouchableRegion(mTouchableRegion)); .setTouchableRegion(mTouchableRegion) .setAppProgressAllowed(true)); triggerBackGesture(); mShellExecutor.flushAll(); releaseBackGesture(); Loading