diff options
| author | 2019-05-16 01:19:29 -0700 | |
|---|---|---|
| committer | 2019-05-17 21:13:17 +0000 | |
| commit | 62058205790f7add7f48c755a1fcbc1ea4eabc8a (patch) | |
| tree | 8a2619768086a67d68c1e75af28ae4092afcc58a | |
| parent | 4f09b09f62d48b291b77cf09c207b6570bd88535 (diff) | |
Send subtree changed AccessibilityEvent for all alpha changes.
Changes to view.mtransformationInfo.mAlpha outside of View.java weren't triggering subtree AccessibilityEvents.
This is a problem, because that property helps determine a views visibility in accessibility, and AccessibilityServices wouldn't be informed of this change in visibility.
This results in UIs with certain animations not being accessible at all.
This seems like an oversight to begin with, so it's a pretty low risk change.
Test: Tested the reported instance of this bug in Permission Manager, CTSAccessibility*
Change-Id: I02526e5659cf95f1373811008e74954a73addd21
Fix: 127589394
| -rw-r--r-- | core/java/android/view/RenderNodeAnimator.java | 2 | ||||
| -rw-r--r-- | core/java/android/view/View.java | 4 | ||||
| -rw-r--r-- | core/java/android/view/ViewPropertyAnimator.java | 5 |
3 files changed, 5 insertions, 6 deletions
diff --git a/core/java/android/view/RenderNodeAnimator.java b/core/java/android/view/RenderNodeAnimator.java index c2f96013142b..93f52a04d626 100644 --- a/core/java/android/view/RenderNodeAnimator.java +++ b/core/java/android/view/RenderNodeAnimator.java @@ -213,7 +213,7 @@ public class RenderNodeAnimator extends Animator { // it with the final value here. if (mRenderProperty == RenderNodeAnimator.ALPHA) { mViewTarget.ensureTransformationInfo(); - mViewTarget.mTransformationInfo.mAlpha = mFinalValue; + mViewTarget.setAlphaInternal(mFinalValue); } moveToRunningState(); diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 921294a78e5e..87df4a368082 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -4123,7 +4123,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * completely transparent and 1 means completely opaque. */ @ViewDebug.ExportedProperty - float mAlpha = 1f; + private float mAlpha = 1f; /** * The opacity of the view as manipulated by the Fade transition. This is a @@ -16190,7 +16190,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, return false; } - private void setAlphaInternal(float alpha) { + void setAlphaInternal(float alpha) { float oldAlpha = mTransformationInfo.mAlpha; mTransformationInfo.mAlpha = alpha; // Report visibility changes, which can affect children, to accessibility diff --git a/core/java/android/view/ViewPropertyAnimator.java b/core/java/android/view/ViewPropertyAnimator.java index afee1e5cf7f4..957673dba133 100644 --- a/core/java/android/view/ViewPropertyAnimator.java +++ b/core/java/android/view/ViewPropertyAnimator.java @@ -972,7 +972,6 @@ public class ViewPropertyAnimator { * @param value The value to set the property to */ private void setValue(int propertyConstant, float value) { - final View.TransformationInfo info = mView.mTransformationInfo; final RenderNode renderNode = mView.mRenderNode; switch (propertyConstant) { case TRANSLATION_X: @@ -1009,7 +1008,7 @@ public class ViewPropertyAnimator { renderNode.setTranslationZ(value - renderNode.getElevation()); break; case ALPHA: - info.mAlpha = value; + mView.setAlphaInternal(value); renderNode.setAlpha(value); break; } @@ -1047,7 +1046,7 @@ public class ViewPropertyAnimator { case Z: return node.getElevation() + node.getTranslationZ(); case ALPHA: - return mView.mTransformationInfo.mAlpha; + return mView.getAlpha(); } return 0; } |