Skip apps without launch intent.

If an app from the apk cannot be launched then skip it in compatibility
test, rather than generate a null pointer exception.

Change-Id: I252031f249bfe25282b10394889ab8c5506cabcf
This commit is contained in:
Maxim Siniavine
2013-04-10 11:57:57 -07:00
parent d9621f8670
commit 85478b5972

View File

@@ -127,6 +127,10 @@ public class AppCompatibility extends InstrumentationTestCase {
homeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Intent intent = mPackageManager.getLaunchIntentForPackage(packageName);
// Skip if the apk does not have a launch intent.
if (intent == null) {
return null;
}
// We check for any Crash or ANR dialogs that are already up, and we ignore them. This is
// so that we don't report crashes that were caused by prior apps (which those particular