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

Commit e38c1ddd authored by Hiroki Sato's avatar Hiroki Sato
Browse files

Move a11y content change event throttle reduction behind a flag

We found that without throttle some apps become non-responsive.
For now, let's add a new flag and put the behavior behind it.

Bug: 297499858
Bug: 277305460
Test: With flag disabled, Facebook dispatches events every 100 ms.
Change-Id: I4542b33046edc6f2adb5167dc40021cf5108ef0f
parent 9a964b91
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ import static android.view.WindowManagerGlobal.RELAYOUT_RES_CANCEL_AND_REDRAW;
import static android.view.WindowManagerGlobal.RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS;
import static android.view.WindowManagerGlobal.RELAYOUT_RES_SURFACE_CHANGED;
import static android.view.accessibility.Flags.forceInvertColor;
import static android.view.accessibility.Flags.reduceWindowContentChangedEventThrottle;
import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.IME_FOCUS_CONTROLLER;
import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.INSETS_CONTROLLER;
import static android.view.flags.Flags.toolkitSetFrameRateReadOnly;
@@ -11355,6 +11356,10 @@ public final class ViewRootImpl implements ViewParent,
        }

        private boolean canContinueThrottle(View source, int changeType) {
            if (!reduceWindowContentChangedEventThrottle()) {
                // Old behavior. Always throttle.
                return true;
            }
            if (mSource == null) {
                // We don't have a pending event.
                return true;
+7 −0
Original line number Diff line number Diff line
@@ -51,6 +51,13 @@ flag {
    bug: "302376158"
}

flag {
    namespace: "accessibility"
    name: "reduce_window_content_changed_event_throttle"
    description: "Reduces the throttle of AccessibilityEvent of TYPE_WINDOW_CONTENT_CHANGED"
    bug: "277305460"
}

flag {
    namespace: "accessibility"
    name: "update_always_on_a11y_service"