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

Commit f546b865 authored by Phil Weaver's avatar Phil Weaver Committed by android-build-merger
Browse files

Reduce extra a11y events when alpha changes. am: 9937f81a am: 2dd6ce7a

am: fc5164a6

Change-Id: If23ebf9b114d1d9f7fcf3c76e1f39dede082dc67
parents d70dc452 fc5164a6
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -12363,6 +12363,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    public void setAlpha(@FloatRange(from=0.0, to=1.0) float alpha) {
        ensureTransformationInfo();
        if (mTransformationInfo.mAlpha != alpha) {
            // Report visibility changes, which can affect children, to accessibility
            if ((alpha == 0) ^ (mTransformationInfo.mAlpha == 0)) {
                notifySubtreeAccessibilityStateChangedIfNeeded();
            }
            mTransformationInfo.mAlpha = alpha;
            if (onSetAlpha((int) (alpha * 255))) {
                mPrivateFlags |= PFLAG_ALPHA_SET;
@@ -12373,8 +12377,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                mPrivateFlags &= ~PFLAG_ALPHA_SET;
                invalidateViewProperty(true, false);
                mRenderNode.setAlpha(getFinalAlpha());
                notifyViewAccessibilityStateChangedIfNeeded(
                        AccessibilityEvent.CONTENT_CHANGE_TYPE_UNDEFINED);
            }
        }
    }