Add null checks to NotificationListenerVerifierActivity.
Bug: 17580657
Change-Id: I365988c4a290c3fb67e0d59ecdf6d63593ce9cde
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/nls/NotificationListenerVerifierActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/nls/NotificationListenerVerifierActivity.java
index 842c024..5e9db53 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/nls/NotificationListenerVerifierActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/nls/NotificationListenerVerifierActivity.java
@@ -425,7 +425,7 @@
new MockListener.StringListResultCatcher() {
@Override
public void accept(List<String> result) {
- if (result.size() > 0 && result.contains(mTag1)) {
+ if (result != null && result.size() > 0 && result.contains(mTag1)) {
mStatus[i] = PASS;
} else {
logWithStack("failed testNotificationRecieved");
@@ -444,7 +444,7 @@
public void accept(List<String> result) {
boolean pass = false;
Set<String> found = new HashSet<String>();
- if (result.size() > 0) {
+ if (result != null && result.size() > 0) {
pass = true;
for(String payloadData : result) {
try {
@@ -513,7 +513,7 @@
new MockListener.StringListResultCatcher() {
@Override
public void accept(List<String> result) {
- if (result.size() > 0 && result.contains(mTag1)) {
+ if (result != null && result.size() > 0 && result.contains(mTag1)) {
mStatus[i] = PASS;
next();
} else {
@@ -546,7 +546,8 @@
new MockListener.StringListResultCatcher() {
@Override
public void accept(List<String> result) {
- if (result.size() == 2 && result.contains(mTag2) && result.contains(mTag3)) {
+ if (result != null && result.size() == 2
+ && result.contains(mTag2) && result.contains(mTag3)) {
mStatus[i] = PASS;
next();
} else {