public class AppsQueryHelper extends Object
Modifier and Type | Field and Description |
---|---|
static int |
GET_APPS_WITH_INTERACT_ACROSS_USERS_PERM
Return apps with
Manifest.permission#INTERACT_ACROSS_USERS permission |
static int |
GET_IMES
Return all input methods available for the current user.
|
static int |
GET_NON_LAUNCHABLE_APPS
Return apps without launcher icon
|
static int |
GET_REQUIRED_FOR_SYSTEM_USER
Return all apps that are flagged as required for the system user.
|
Constructor and Description |
---|
AppsQueryHelper() |
AppsQueryHelper(IPackageManager packageManager) |
Modifier and Type | Method and Description |
---|---|
protected List<ApplicationInfo> |
getAllApps(int userId) |
protected List<PackageInfo> |
getPackagesHoldingPermission(String perm,
int userId) |
List<String> |
queryApps(int flags,
boolean systemAppsOnly,
UserHandle user)
Return a List of all packages that satisfy a specified criteria.
|
protected List<ResolveInfo> |
queryIntentActivitiesAsUser(Intent intent,
int userId) |
protected List<ResolveInfo> |
queryIntentServicesAsUser(Intent intent,
int userId) |
public static int GET_NON_LAUNCHABLE_APPS
public static int GET_APPS_WITH_INTERACT_ACROSS_USERS_PERM
Manifest.permission#INTERACT_ACROSS_USERS
permissionpublic static int GET_IMES
public static int GET_REQUIRED_FOR_SYSTEM_USER
public AppsQueryHelper(IPackageManager packageManager)
public AppsQueryHelper()
public List<String> queryApps(int flags, boolean systemAppsOnly, UserHandle user)
flags
- search flags. Use any combination of GET_NON_LAUNCHABLE_APPS
,
GET_APPS_WITH_INTERACT_ACROSS_USERS_PERM
or GET_IMES
.systemAppsOnly
- if true, only system apps will be returneduser
- user, whose apps are queriedprotected List<ApplicationInfo> getAllApps(int userId)
protected List<ResolveInfo> queryIntentActivitiesAsUser(Intent intent, int userId)
protected List<ResolveInfo> queryIntentServicesAsUser(Intent intent, int userId)
protected List<PackageInfo> getPackagesHoldingPermission(String perm, int userId)