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

Commit afefe675 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Clear the messages and callbacks in the...

Merge "Clear the messages and callbacks in the AccessibilityInteractionController when the ViewRootImpl is detached from the window." into main
parents a551007e e3c63100
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import android.view.accessibility.AccessibilityNodeInfo;
import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
import android.view.accessibility.AccessibilityNodeProvider;
import android.view.accessibility.AccessibilityRequestPreparer;
import android.view.accessibility.Flags;
import android.view.accessibility.IAccessibilityInteractionConnectionCallback;
import android.window.ScreenCapture;

@@ -1285,6 +1286,15 @@ public final class AccessibilityInteractionController {
                (int) (sourceRectF.right + 0.5), (int) (sourceRectF.bottom + 0.5));
    }

    /**
     * Destroy {@link AccessibilityInteractionController} and clean up the pending actions.
     */
    public void destroy() {
        if (Flags.preventLeakingViewrootimpl()) {
            mHandler.removeCallbacksAndMessages(null);
        }
    }

    /**
     * This class encapsulates a prefetching strategy for the accessibility APIs for
     * querying window content. It is responsible to prefetch a batch of
+5 −0
Original line number Diff line number Diff line
@@ -6088,6 +6088,11 @@ public final class ViewRootImpl implements ViewParent,
        mAccessibilityInteractionConnectionManager.ensureNoConnection();
        mAccessibilityInteractionConnectionManager.ensureNoDirectConnection();
        removeSendWindowContentChangedCallback();
        if (android.view.accessibility.Flags.preventLeakingViewrootimpl()
                && mAccessibilityInteractionController != null) {
            mAccessibilityInteractionController.destroy();
            mAccessibilityInteractionController = null;
        }
        destroyHardwareRenderer();
+10 −0
Original line number Diff line number Diff line
@@ -141,6 +141,16 @@ flag {
    bug: "283323770"
}

flag {
    name: "prevent_leaking_viewrootimpl"
    namespace: "accessibility"
    description: "Clear pending messages and callbacks of the handler in AccessibilityInteractionController when the ViewRootImpl is detached from Window to prevent leaking ViewRootImpl"
    bug: "320701910"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "support_system_pinch_zoom_opt_out_apis"
    namespace: "accessibility"