[automerger] Nullcheck to fix Autofill CTS am: 6c68a69288 am: 743abb939a

Change-Id: Ia89ea1adb47be3b70f5db292677c4c19194a04db
This commit is contained in:
Android Build Merger (Role)
2018-05-09 17:19:07 +00:00

View File

@@ -738,11 +738,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) {