diff options
| author | Jackal Guo <jackalguo@google.com> | 2020-02-20 01:23:14 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-02-20 01:23:14 +0000 |
| commit | bc67dc3f219fdc5cfb548c8957d43fc4172101e5 (patch) | |
| tree | c5e80f6d9778e631d0e4c9a94077829c7dffefd5 /core/java/android/view/SurfaceView.java | |
| parent | 1040a5c1435dc23040bf40957b20e62ac33fe0d0 (diff) | |
| parent | a88ee6f588271b0ebc06284cc9a276ebc2ad214c (diff) | |
Merge "Adjust the logic of isImportantForAccessibility"
Diffstat (limited to 'core/java/android/view/SurfaceView.java')
| -rw-r--r-- | core/java/android/view/SurfaceView.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index deff79d5486a..73707ca889dd 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -1586,6 +1586,19 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall info.addChild(wrapper.getLeashToken()); } + @Override + public int getImportantForAccessibility() { + final int mode = super.getImportantForAccessibility(); + // If developers explicitly set the important mode for it, don't change the mode. + // Only change the mode to important when this SurfaceView isn't explicitly set and has + // an embedded hierarchy. + if (mRemoteAccessibilityEmbeddedConnection == null + || mode != IMPORTANT_FOR_ACCESSIBILITY_AUTO) { + return mode; + } + return IMPORTANT_FOR_ACCESSIBILITY_YES; + } + private void initEmbeddedHierarchyForAccessibility(SurfaceControlViewHost.SurfacePackage p) { final IAccessibilityEmbeddedConnection connection = p.getAccessibilityEmbeddedConnection(); final RemoteAccessibilityEmbeddedConnection wrapper = |
