Also, update javadoc for LauncherApps.getActivityList()
Bug:
119789943
Test: atest android.content.pm.cts.PackageManagerTest#testGetPackageInfo
Change-Id: I1a183207e6eb880a68811d4c2a5cf77d3f71f0b0
/**
* Retrieves a list of launchable activities that match {@link Intent#ACTION_MAIN} and
- * {@link Intent#CATEGORY_LAUNCHER}, for a specified user.
+ * {@link Intent#CATEGORY_LAUNCHER}, for a specified user. Result may include
+ * synthesized activities like app details Activity injected by system.
*
* @param packageName The specific package to query. If null, it checks all installed packages
* in the profile.
for (int i = 0; i < N; i++) {
final Activity a = p.activities.get(i);
if (state.isMatch(a.info, flags)) {
+ if (PackageManager.APP_DETAILS_ACTIVITY_CLASS_NAME.equals(a.className)) {
+ continue;
+ }
res[num++] = generateActivityInfo(a, flags, state, userId);
}
}