Loading core/java/android/app/ApplicationPackageManager.java +6 −7 Original line number Diff line number Diff line Loading @@ -101,24 +101,23 @@ final class ApplicationPackageManager extends PackageManager { Intent intentToResolve = new Intent(Intent.ACTION_MAIN); intentToResolve.addCategory(Intent.CATEGORY_INFO); intentToResolve.setPackage(packageName); ResolveInfo resolveInfo = resolveActivity(intentToResolve, 0); List<ResolveInfo> ris = queryIntentActivities(intentToResolve, 0); // Otherwise, try to find a main launcher activity. if (resolveInfo == null) { if (ris == null || ris.size() <= 0) { // reuse the intent instance intentToResolve.removeCategory(Intent.CATEGORY_INFO); intentToResolve.addCategory(Intent.CATEGORY_LAUNCHER); intentToResolve.setPackage(packageName); resolveInfo = resolveActivity(intentToResolve, 0); ris = queryIntentActivities(intentToResolve, 0); } if (resolveInfo == null) { if (ris == null || ris.size() <= 0) { return null; } Intent intent = new Intent(intentToResolve); // Note: we do NOT fill in the component name; we'll leave the // Intent unspecified, so if there are multiple matches within the // package something reasonable will happen. intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setClassName(ris.get(0).activityInfo.packageName, ris.get(0).activityInfo.name); return intent; } Loading core/java/android/content/pm/PackageManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -926,7 +926,7 @@ public abstract class PackageManager { * * @param packageName The name of the package to inspect. * * @return Returns either an Intent that can be used to * @return Returns either a fully-qualified Intent that can be used to * launch the main activity in the package, or null if the package does * not contain such an activity. */ Loading Loading
core/java/android/app/ApplicationPackageManager.java +6 −7 Original line number Diff line number Diff line Loading @@ -101,24 +101,23 @@ final class ApplicationPackageManager extends PackageManager { Intent intentToResolve = new Intent(Intent.ACTION_MAIN); intentToResolve.addCategory(Intent.CATEGORY_INFO); intentToResolve.setPackage(packageName); ResolveInfo resolveInfo = resolveActivity(intentToResolve, 0); List<ResolveInfo> ris = queryIntentActivities(intentToResolve, 0); // Otherwise, try to find a main launcher activity. if (resolveInfo == null) { if (ris == null || ris.size() <= 0) { // reuse the intent instance intentToResolve.removeCategory(Intent.CATEGORY_INFO); intentToResolve.addCategory(Intent.CATEGORY_LAUNCHER); intentToResolve.setPackage(packageName); resolveInfo = resolveActivity(intentToResolve, 0); ris = queryIntentActivities(intentToResolve, 0); } if (resolveInfo == null) { if (ris == null || ris.size() <= 0) { return null; } Intent intent = new Intent(intentToResolve); // Note: we do NOT fill in the component name; we'll leave the // Intent unspecified, so if there are multiple matches within the // package something reasonable will happen. intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setClassName(ris.get(0).activityInfo.packageName, ris.get(0).activityInfo.name); return intent; } Loading
core/java/android/content/pm/PackageManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -926,7 +926,7 @@ public abstract class PackageManager { * * @param packageName The name of the package to inspect. * * @return Returns either an Intent that can be used to * @return Returns either a fully-qualified Intent that can be used to * launch the main activity in the package, or null if the package does * not contain such an activity. */ Loading