diff options
| author | 2020-10-16 13:12:48 -0700 | |
|---|---|---|
| committer | 2020-10-16 13:12:48 -0700 | |
| commit | 0d587ee61a12c4ad9729875128fc66a12516521c (patch) | |
| tree | 72af4a5f63aa4db5766115a411de6537759bdf9d | |
| parent | 4c361bbb477c57e8b8d413c8197b2417257c08eb (diff) | |
SurfaceView: Fix null check on RemoteAccessibilityController
ImporantForAccessibility can be called from the View constructor
in which case we may not have initialized RemoteAccessibilityController
yet.
Bug: 171015133
Test: Existing tests pass. Repro from bug.
Change-Id: Iedc29a9d4270ebe600648d6ce5e17c864a662396
| -rw-r--r-- | core/java/android/view/SurfaceView.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index 7b6a4f877d02..432d9279c48d 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -1849,7 +1849,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall // 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 (!mRemoteAccessibilityController.connected() + if ((mRemoteAccessibilityController!= null && !mRemoteAccessibilityController.connected()) || mode != IMPORTANT_FOR_ACCESSIBILITY_AUTO) { return mode; } |