@@ -1468,6 +1468,45 @@ public abstract ProviderInfo getProviderInfo(ComponentName component,
14681468 */
14691469 public abstract List <PackageInfo > getInstalledPackages (int flags );
14701470
1471+ /**
1472+ * Return a List of all packages that are installed on the device, for a specific user.
1473+ * Requesting a list of installed packages for another user
1474+ * will require the permission INTERACT_ACROSS_USERS_FULL.
1475+ * @param flags Additional option flags. Use any combination of
1476+ * {@link #GET_ACTIVITIES},
1477+ * {@link #GET_GIDS},
1478+ * {@link #GET_CONFIGURATIONS},
1479+ * {@link #GET_INSTRUMENTATION},
1480+ * {@link #GET_PERMISSIONS},
1481+ * {@link #GET_PROVIDERS},
1482+ * {@link #GET_RECEIVERS},
1483+ * {@link #GET_SERVICES},
1484+ * {@link #GET_SIGNATURES},
1485+ * {@link #GET_UNINSTALLED_PACKAGES} to modify the data returned.
1486+ * @param userId The user for whom the installed packages are to be listed
1487+ *
1488+ * @return A List of PackageInfo objects, one for each package that is
1489+ * installed on the device. In the unlikely case of there being no
1490+ * installed packages, an empty list is returned.
1491+ * If flag GET_UNINSTALLED_PACKAGES is set, a list of all
1492+ * applications including those deleted with DONT_DELETE_DATA
1493+ * (partially installed apps with data directory) will be returned.
1494+ *
1495+ * @see #GET_ACTIVITIES
1496+ * @see #GET_GIDS
1497+ * @see #GET_CONFIGURATIONS
1498+ * @see #GET_INSTRUMENTATION
1499+ * @see #GET_PERMISSIONS
1500+ * @see #GET_PROVIDERS
1501+ * @see #GET_RECEIVERS
1502+ * @see #GET_SERVICES
1503+ * @see #GET_SIGNATURES
1504+ * @see #GET_UNINSTALLED_PACKAGES
1505+ *
1506+ * @hide
1507+ */
1508+ public abstract List <PackageInfo > getInstalledPackages (int flags , int userId );
1509+
14711510 /**
14721511 * Check whether a particular package has been granted a particular
14731512 * permission.
@@ -1754,6 +1793,29 @@ public abstract int getUidForSharedUser(String sharedUserName)
17541793 public abstract List <ResolveInfo > queryIntentActivities (Intent intent ,
17551794 int flags );
17561795
1796+ /**
1797+ * Retrieve all activities that can be performed for the given intent, for a specific user.
1798+ *
1799+ * @param intent The desired intent as per resolveActivity().
1800+ * @param flags Additional option flags. The most important is
1801+ * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only
1802+ * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}.
1803+ *
1804+ * @return A List<ResolveInfo> containing one entry for each matching
1805+ * Activity. These are ordered from best to worst match -- that
1806+ * is, the first item in the list is what is returned by
1807+ * {@link #resolveActivity}. If there are no matching activities, an empty
1808+ * list is returned.
1809+ *
1810+ * @see #MATCH_DEFAULT_ONLY
1811+ * @see #GET_INTENT_FILTERS
1812+ * @see #GET_RESOLVED_FILTER
1813+ * @hide
1814+ */
1815+ public abstract List <ResolveInfo > queryIntentActivitiesForUser (Intent intent ,
1816+ int flags , int userId );
1817+
1818+
17571819 /**
17581820 * Retrieve a set of activities that should be presented to the user as
17591821 * similar options. This is like {@link #queryIntentActivities}, except it
0 commit comments