Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a285706 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Clean up intercept_motion_from_move_to_cancel flag" into main

parents 28197484 ed7e0def
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@ import static android.view.flags.Flags.FLAG_TOOLKIT_VIEWGROUP_SET_REQUESTED_FRAM
import static android.view.flags.Flags.scrollCaptureTargetZOrderFix;
import static android.view.flags.Flags.toolkitViewgroupSetRequestedFrameRateApi;

import static com.android.window.flags.Flags.interceptMotionFromMoveToCancel;

import android.animation.LayoutTransition;
import android.annotation.CallSuper;
import android.annotation.FlaggedApi;
@@ -2675,10 +2673,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
            ViewRootImpl viewRootImpl = getViewRootImpl();
            if (actionMasked == MotionEvent.ACTION_DOWN || mFirstTouchTarget != null) {
                final boolean disallowIntercept = (mGroupFlags & FLAG_DISALLOW_INTERCEPT) != 0;
                final boolean isBackGestureInProgress = !interceptMotionFromMoveToCancel()
                        && (viewRootImpl != null
                        && viewRootImpl.getOnBackInvokedDispatcher().isBackGestureInProgress());
                if (!disallowIntercept || isBackGestureInProgress) {
                if (!disallowIntercept) {
                    // Allow back to intercept touch
                    intercepted = onInterceptTouchEvent(ev);
                    ev.setAction(action); // restore action in case it was changed
+0 −11
Original line number Diff line number Diff line
@@ -407,17 +407,6 @@ flag {
    }
}

flag {
    name: "intercept_motion_from_move_to_cancel"
    namespace: "windowing_frontend"
    description: "Ensure that the client receives ACTION_CANCEL when the back gesture is intercepted."
    bug: "404173501"
    is_fixed_read_only: true
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "exclude_non_main_window_from_snapshot"
    namespace: "windowing_frontend"
+0 −14
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ import static android.window.DesktopModeFlags.ENABLE_CAPTION_COMPAT_INSET_FORCE_
import static android.window.DesktopModeFlags.ENABLE_CAPTION_COMPAT_INSET_FORCE_CONSUMPTION_ALWAYS;

import static com.android.internal.policy.PhoneWindow.FEATURE_OPTIONS_PANEL;
import static com.android.window.flags.Flags.interceptMotionFromMoveToCancel;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -446,9 +445,6 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
    }

    private boolean interceptBackProgress(MotionEvent ev) {
        if (!interceptMotionFromMoveToCancel()) {
            return false;
        }
        final ViewRootImpl viewRootImpl = getViewRootImpl();
        if (viewRootImpl == null) {
            return false;
@@ -547,16 +543,6 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
        }

        ViewRootImpl viewRootImpl = getViewRootImpl();
        if (!interceptMotionFromMoveToCancel()) {
            if (viewRootImpl != null) {
                viewRootImpl.getOnBackInvokedDispatcher().onMotionEvent(event);
                // Intercept touch if back gesture is in progress.
                if (viewRootImpl.getOnBackInvokedDispatcher().isBackGestureInProgress()) {
                    return true;
                }
            }
        }

        if (viewRootImpl != null && mWearGestureInterceptionDetector != null) {
            boolean wasIntercepting = mWearGestureInterceptionDetector.isIntercepting();
            boolean intercepting = mWearGestureInterceptionDetector