Throw error when no intent can be found

bug: 17396762

Change-Id: I10502d5d1e2332d9e6820ee645234c125e937b7a
This commit is contained in:
wsmlby
2014-10-01 12:47:25 -07:00
committed by Bingyan Liu
parent 9cf01b63cb
commit 6bd30ee1a2

View File

@@ -155,16 +155,12 @@ public class AppCompatibility extends InstrumentationTestCase {
homeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Intent intent;
if (isleanback) {
Log.d(TAG, "Leanback and relax!");
Log.d(TAG, "Leanback and relax! " + packageName);
intent = mPackageManager.getLeanbackLaunchIntentForPackage(packageName);
} else {
intent = mPackageManager.getLaunchIntentForPackage(packageName);
}
// Skip if the apk does not have a launch intent.
if (intent == null) {
Log.d(TAG, "Skipping " + packageName + "; missing launch intent");
return null;
}
assertNotNull("Skipping " + packageName + "; missing launch intent", intent);
String processName = getProcessName(packageName);