diff options
author | Eugene Susla <eugenesusla@google.com> | 2017-12-11 10:07:03 -0800 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-05-25 18:40:33 +0000 |
commit | fc7eb8e471bc255815a8240e57c22258d2fe653f (patch) | |
tree | 9361ff1ec6f2714da0a9f993015db9efff1a900b | |
parent | 5c23facbf802c9b4c88ceb60e1b782abcc55ddc9 (diff) | |
download | base-fc7eb8e471bc255815a8240e57c22258d2fe653f.tar.gz |
Nullcheck to fix Autofill CTS
Test: presubmit
Fixes: 70506475
Bug: 69981755
Change-Id: I187bed4889a4901a7137a2995178ea651ed09186
(cherry picked from commit 6c68a692880b7cc981e130aace0edb9f2fcffff6)
-rw-r--r-- | core/java/android/view/accessibility/AccessibilityInteractionClient.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/core/java/android/view/accessibility/AccessibilityInteractionClient.java b/core/java/android/view/accessibility/AccessibilityInteractionClient.java index be3b34d0ccf8..980a2c926c1a 100644 --- a/core/java/android/view/accessibility/AccessibilityInteractionClient.java +++ b/core/java/android/view/accessibility/AccessibilityInteractionClient.java @@ -734,11 +734,14 @@ public final class AccessibilityInteractionClient if (info != null) { info.setConnectionId(connectionId); // Empty array means any package name is Okay - if (!ArrayUtils.isEmpty(packageNames) - && !ArrayUtils.contains(packageNames, info.getPackageName().toString())) { - // If the node package not one of the valid ones, pick the top one - this - // is one of the packages running in the introspected UID. - info.setPackageName(packageNames[0]); + if (!ArrayUtils.isEmpty(packageNames)) { + CharSequence packageName = info.getPackageName(); + if (packageName == null + || !ArrayUtils.contains(packageNames, packageName.toString())) { + // If the node package not one of the valid ones, pick the top one - this + // is one of the packages running in the introspected UID. + info.setPackageName(packageNames[0]); + } } info.setSealed(true); if (!bypassCache) { |