Updated NanoAppBundleTest to skip when AddAccountSettings can't be found
Bug: 113527124
Bug: 146481698
Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.NanoAppBundleTest#testPoc_cve_2018_9471
Change-Id: I7dde7eb7485d080d4155aae45a934bbaf99b301a
diff --git a/tests/tests/security/src/android/security/cts/NanoAppBundleTest.java b/tests/tests/security/src/android/security/cts/NanoAppBundleTest.java
index 512ffb8..6db3f4d 100644
--- a/tests/tests/security/src/android/security/cts/NanoAppBundleTest.java
+++ b/tests/tests/security/src/android/security/cts/NanoAppBundleTest.java
@@ -131,7 +131,7 @@
ActivityInfo info = intent.resolveActivityInfo(
mContext.getPackageManager(), intent.getFlags());
// Will throw NullPointerException if activity not found.
- if (info.exported) {
+ if (info != null && info.exported) {
mContext.startActivity(intent);
} else {
Log.i(TAG, "Activity is not exported");