field public static final java.lang.String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct";
field public static final int GET_ACTIVITIES = 1; // 0x1
field public static final int GET_CONFIGURATIONS = 16384; // 0x4000
- field public static final int GET_DISABLED_COMPONENTS = 512; // 0x200
- field public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
+ field public static final deprecated int GET_DISABLED_COMPONENTS = 512; // 0x200
+ field public static final deprecated int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
field public static final int GET_GIDS = 256; // 0x100
field public static final int GET_INSTRUMENTATION = 16; // 0x10
field public static final int GET_INTENT_FILTERS = 32; // 0x20
field public static final int GET_SERVICES = 4; // 0x4
field public static final int GET_SHARED_LIBRARY_FILES = 1024; // 0x400
field public static final int GET_SIGNATURES = 64; // 0x40
- field public static final int GET_UNINSTALLED_PACKAGES = 8192; // 0x2000
+ field public static final deprecated int GET_UNINSTALLED_PACKAGES = 8192; // 0x2000
field public static final int GET_URI_PERMISSION_PATTERNS = 2048; // 0x800
field public static final int MATCH_ALL = 131072; // 0x20000
field public static final int MATCH_DEFAULT_ONLY = 65536; // 0x10000
+ field public static final int MATCH_DISABLED_COMPONENTS = 512; // 0x200
+ field public static final int MATCH_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
+ field public static final int MATCH_ENCRYPTION_AWARE = 524288; // 0x80000
field public static final int MATCH_ENCRYPTION_AWARE_AND_UNAWARE = 786432; // 0xc0000
- field public static final int MATCH_ENCRYPTION_AWARE_ONLY = 524288; // 0x80000
- field public static final int MATCH_ENCRYPTION_UNAWARE_ONLY = 262144; // 0x40000
+ field public static final int MATCH_ENCRYPTION_UNAWARE = 262144; // 0x40000
+ field public static final int MATCH_SYSTEM_ONLY = 1048576; // 0x100000
+ field public static final int MATCH_UNINSTALLED_PACKAGES = 8192; // 0x2000
field public static final long MAXIMUM_VERIFICATION_TIMEOUT = 3600000L; // 0x36ee80L
field public static final int PERMISSION_DENIED = -1; // 0xffffffff
field public static final int PERMISSION_GRANTED = 0; // 0x0
field public static final java.lang.String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct";
field public static final int GET_ACTIVITIES = 1; // 0x1
field public static final int GET_CONFIGURATIONS = 16384; // 0x4000
- field public static final int GET_DISABLED_COMPONENTS = 512; // 0x200
- field public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
+ field public static final deprecated int GET_DISABLED_COMPONENTS = 512; // 0x200
+ field public static final deprecated int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
field public static final int GET_GIDS = 256; // 0x100
field public static final int GET_INSTRUMENTATION = 16; // 0x10
field public static final int GET_INTENT_FILTERS = 32; // 0x20
field public static final int GET_SERVICES = 4; // 0x4
field public static final int GET_SHARED_LIBRARY_FILES = 1024; // 0x400
field public static final int GET_SIGNATURES = 64; // 0x40
- field public static final int GET_UNINSTALLED_PACKAGES = 8192; // 0x2000
+ field public static final deprecated int GET_UNINSTALLED_PACKAGES = 8192; // 0x2000
field public static final int GET_URI_PERMISSION_PATTERNS = 2048; // 0x800
field public static final int INSTALL_FAILED_ALREADY_EXISTS = -1; // 0xffffffff
field public static final int INSTALL_FAILED_CONFLICTING_PROVIDER = -13; // 0xfffffff3
field public static final int MASK_PERMISSION_FLAGS = 255; // 0xff
field public static final int MATCH_ALL = 131072; // 0x20000
field public static final int MATCH_DEFAULT_ONLY = 65536; // 0x10000
+ field public static final int MATCH_DISABLED_COMPONENTS = 512; // 0x200
+ field public static final int MATCH_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
+ field public static final int MATCH_ENCRYPTION_AWARE = 524288; // 0x80000
field public static final int MATCH_ENCRYPTION_AWARE_AND_UNAWARE = 786432; // 0xc0000
- field public static final int MATCH_ENCRYPTION_AWARE_ONLY = 524288; // 0x80000
- field public static final int MATCH_ENCRYPTION_UNAWARE_ONLY = 262144; // 0x40000
+ field public static final int MATCH_ENCRYPTION_UNAWARE = 262144; // 0x40000
+ field public static final int MATCH_SYSTEM_ONLY = 1048576; // 0x100000
+ field public static final int MATCH_UNINSTALLED_PACKAGES = 8192; // 0x2000
field public static final long MAXIMUM_VERIFICATION_TIMEOUT = 3600000L; // 0x36ee80L
field public static final int PERMISSION_DENIED = -1; // 0xffffffff
field public static final int PERMISSION_GRANTED = 0; // 0x0
field public static final java.lang.String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct";
field public static final int GET_ACTIVITIES = 1; // 0x1
field public static final int GET_CONFIGURATIONS = 16384; // 0x4000
- field public static final int GET_DISABLED_COMPONENTS = 512; // 0x200
- field public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
+ field public static final deprecated int GET_DISABLED_COMPONENTS = 512; // 0x200
+ field public static final deprecated int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
field public static final int GET_GIDS = 256; // 0x100
field public static final int GET_INSTRUMENTATION = 16; // 0x10
field public static final int GET_INTENT_FILTERS = 32; // 0x20
field public static final int GET_SERVICES = 4; // 0x4
field public static final int GET_SHARED_LIBRARY_FILES = 1024; // 0x400
field public static final int GET_SIGNATURES = 64; // 0x40
- field public static final int GET_UNINSTALLED_PACKAGES = 8192; // 0x2000
+ field public static final deprecated int GET_UNINSTALLED_PACKAGES = 8192; // 0x2000
field public static final int GET_URI_PERMISSION_PATTERNS = 2048; // 0x800
field public static final int MATCH_ALL = 131072; // 0x20000
field public static final int MATCH_DEFAULT_ONLY = 65536; // 0x10000
+ field public static final int MATCH_DISABLED_COMPONENTS = 512; // 0x200
+ field public static final int MATCH_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
+ field public static final int MATCH_ENCRYPTION_AWARE = 524288; // 0x80000
field public static final int MATCH_ENCRYPTION_AWARE_AND_UNAWARE = 786432; // 0xc0000
- field public static final int MATCH_ENCRYPTION_AWARE_ONLY = 524288; // 0x80000
- field public static final int MATCH_ENCRYPTION_UNAWARE_ONLY = 262144; // 0x40000
+ field public static final int MATCH_ENCRYPTION_UNAWARE = 262144; // 0x40000
+ field public static final int MATCH_SYSTEM_ONLY = 1048576; // 0x100000
+ field public static final int MATCH_UNINSTALLED_PACKAGES = 8192; // 0x2000
field public static final long MAXIMUM_VERIFICATION_TIMEOUT = 3600000L; // 0x36ee80L
field public static final int PERMISSION_DENIED = -1; // 0xffffffff
field public static final int PERMISSION_GRANTED = 0; // 0x0
/**
* Internal flag used to indicate that a system component has done their
- * homework and verified their encryption-aware behavior.
+ * homework and verified that they correctly handle packages and components
+ * that come and go over time. In particular:
+ * <ul>
+ * <li>Apps installed on external storage, which will appear to be
+ * uninstalled while the the device is ejected.
+ * <li>Apps with encryption unaware components, which will appear to not
+ * exist while the device is locked.
+ * </ul>
*
* @hide
*/
- public static final int FLAG_DEBUG_ENCRYPTION_TRIAGED = 0x00000100;
+ public static final int FLAG_DEBUG_TRIAGED_MISSING = 0x00000100;
/**
* If set, the new activity is not kept in the history stack. As soon as
}
/**
+ * As a guiding principle:
+ * <p>
+ * {@code GET_} flags are used to request additional data that may have been
+ * elided to save wire space.
+ * <p>
+ * {@code MATCH_} flags are used to include components or packages that
+ * would have otherwise been omitted from a result set by current system
+ * state.
+ */
+
+ /** @hide */
+ @IntDef(flag = true, value = {
+ GET_ACTIVITIES,
+ GET_RECEIVERS,
+ GET_SERVICES,
+ GET_PROVIDERS,
+ GET_INSTRUMENTATION,
+ GET_INTENT_FILTERS,
+ GET_SIGNATURES,
+ GET_META_DATA,
+ GET_GIDS,
+ GET_SHARED_LIBRARY_FILES,
+ GET_URI_PERMISSION_PATTERNS,
+ GET_PERMISSIONS,
+ GET_CONFIGURATIONS,
+ MATCH_UNINSTALLED_PACKAGES,
+ MATCH_DISABLED_COMPONENTS,
+ MATCH_DISABLED_UNTIL_USED_COMPONENTS,
+ MATCH_DEBUG_TRIAGED_MISSING,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface PackageInfoFlags {}
+
+ /** @hide */
+ @IntDef(flag = true, value = {
+ GET_META_DATA,
+ GET_SHARED_LIBRARY_FILES,
+ MATCH_UNINSTALLED_PACKAGES,
+ MATCH_SYSTEM_ONLY,
+ MATCH_DEBUG_TRIAGED_MISSING,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface ApplicationInfoFlags {}
+
+ /** @hide */
+ @IntDef(flag = true, value = {
+ GET_META_DATA,
+ GET_SHARED_LIBRARY_FILES,
+ MATCH_UNINSTALLED_PACKAGES,
+ MATCH_DISABLED_COMPONENTS,
+ MATCH_DISABLED_UNTIL_USED_COMPONENTS,
+ MATCH_ALL,
+ MATCH_DEFAULT_ONLY,
+ MATCH_ENCRYPTION_AWARE,
+ MATCH_ENCRYPTION_AWARE_AND_UNAWARE,
+ MATCH_ENCRYPTION_UNAWARE,
+ MATCH_SYSTEM_ONLY,
+ MATCH_DEBUG_TRIAGED_MISSING,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface ComponentInfoFlags {}
+
+ /** @hide */
+ @IntDef(flag = true, value = {
+ GET_META_DATA,
+ GET_SHARED_LIBRARY_FILES,
+ GET_RESOLVED_FILTER,
+ MATCH_UNINSTALLED_PACKAGES,
+ MATCH_DISABLED_COMPONENTS,
+ MATCH_DISABLED_UNTIL_USED_COMPONENTS,
+ MATCH_ALL,
+ MATCH_DEFAULT_ONLY,
+ MATCH_ENCRYPTION_AWARE,
+ MATCH_ENCRYPTION_AWARE_AND_UNAWARE,
+ MATCH_ENCRYPTION_UNAWARE,
+ MATCH_SYSTEM_ONLY,
+ MATCH_DEBUG_TRIAGED_MISSING,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface ResolveInfoFlags {}
+
+ /** @hide */
+ @IntDef(flag = true, value = {
+ GET_META_DATA,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface PermissionInfoFlags {}
+
+ /** @hide */
+ @IntDef(flag = true, value = {
+ GET_META_DATA,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface PermissionGroupInfoFlags {}
+
+ /** @hide */
+ @IntDef(flag = true, value = {
+ GET_META_DATA,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface InstrumentationInfoFlags {}
+
+ /**
* {@link PackageInfo} flag: return information about
* activities in the package in {@link PackageInfo#activities}.
*/
public static final int GET_GIDS = 0x00000100;
/**
+ * @deprecated replaced with {@link #MATCH_DISABLED_COMPONENTS}
+ */
+ @Deprecated
+ public static final int GET_DISABLED_COMPONENTS = 0x00000200;
+
+ /**
* {@link PackageInfo} flag: include disabled components in the returned info.
*/
- public static final int GET_DISABLED_COMPONENTS = 0x00000200;
+ public static final int MATCH_DISABLED_COMPONENTS = 0x00000200;
/**
* {@link ApplicationInfo} flag: return the
public static final int GET_PERMISSIONS = 0x00001000;
/**
+ * @deprecated replaced with {@link #MATCH_UNINSTALLED_PACKAGES}
+ */
+ @Deprecated
+ public static final int GET_UNINSTALLED_PACKAGES = 0x00002000;
+
+ /**
* Flag parameter to retrieve some information about all applications (even
* uninstalled ones) which have data directories. This state could have
* resulted if applications have been deleted with flag
* Note: this flag may cause less information about currently installed
* applications to be returned.
*/
- public static final int GET_UNINSTALLED_PACKAGES = 0x00002000;
+ public static final int MATCH_UNINSTALLED_PACKAGES = 0x00002000;
/**
* {@link PackageInfo} flag: return information about
public static final int GET_CONFIGURATIONS = 0x00004000;
/**
+ * @deprecated replaced with {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}.
+ */
+ @Deprecated
+ public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000;
+
+ /**
* {@link PackageInfo} flag: include disabled components which are in
* that state only because of {@link #COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED}
* in the returned info. Note that if you set this flag, applications
* that are in this disabled state will be reported as enabled.
*/
- public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000;
+ public static final int MATCH_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000;
/**
* Resolution and querying flag: if set, only filters that support the
public static final int MATCH_DEFAULT_ONLY = 0x00010000;
/**
- * Querying flag: if set and if the platform is doing any filtering of the results, then
- * the filtering will not happen. This is a synonym for saying that all results should
- * be returned.
+ * Querying flag: if set and if the platform is doing any filtering of the
+ * results, then the filtering will not happen. This is a synonym for saying
+ * that all results should be returned.
+ * <p>
+ * <em>This flag should be used with extreme care.</em>
*/
public static final int MATCH_ALL = 0x00020000;
/**
- * {@link PackageInfo} flag: include only components which are encryption
- * unaware in the returned info, regardless of the current user state.
+ * Querying flag: include only components which are encryption unaware in
+ * the returned info, regardless of the current user state.
*/
- public static final int MATCH_ENCRYPTION_UNAWARE_ONLY = 0x00040000;
+ public static final int MATCH_ENCRYPTION_UNAWARE = 0x00040000;
/**
- * {@link PackageInfo} flag: include only components which are encryption
- * aware in the returned info, regardless of the current user state.
+ * Querying flag: include only components which are encryption aware in the
+ * returned info, regardless of the current user state.
*/
- public static final int MATCH_ENCRYPTION_AWARE_ONLY = 0x00080000;
+ public static final int MATCH_ENCRYPTION_AWARE = 0x00080000;
/**
- * {@link PackageInfo} flag: include both encryption aware and unaware
- * components in the returned info, regardless of the current user state.
+ * Querying flag: include both encryption aware and unaware components in
+ * the returned info, regardless of the current user state.
*/
- public static final int MATCH_ENCRYPTION_AWARE_AND_UNAWARE = MATCH_ENCRYPTION_AWARE_ONLY
- | MATCH_ENCRYPTION_UNAWARE_ONLY;
+ public static final int MATCH_ENCRYPTION_AWARE_AND_UNAWARE = MATCH_ENCRYPTION_AWARE
+ | MATCH_ENCRYPTION_UNAWARE;
/**
- * {@link PackageInfo} flag: include only components from applications that
- * are marked with {@link ApplicationInfo#FLAG_SYSTEM}.
- *
- * @hide
+ * Querying flag: include only components from applications that are marked
+ * with {@link ApplicationInfo#FLAG_SYSTEM}.
*/
public static final int MATCH_SYSTEM_ONLY = 0x00100000;
/**
- * {@link PackageInfo} flag: use the default encryption matching behavior
- * based on user state. Internal flag used to indicate that a system
- * component has done their homework and verified their encryption-aware
- * behavior.
+ * Internal flag used to indicate that a system component has done their
+ * homework and verified that they correctly handle packages and components
+ * that come and go over time. In particular:
+ * <ul>
+ * <li>Apps installed on external storage, which will appear to be
+ * uninstalled while the the device is ejected.
+ * <li>Apps with encryption unaware components, which will appear to not
+ * exist while the device is locked.
+ * </ul>
*
+ * @see #MATCH_UNINSTALLED_PACKAGES
+ * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE
* @hide
*/
- public static final int MATCH_ENCRYPTION_DEFAULT = 0x10000000;
+ public static final int MATCH_DEBUG_TRIAGED_MISSING = 0x10000000;
/**
* Flag for {@link addCrossProfileIntentFilter}: if this flag is set:
* @see #GET_SIGNATURES
* @see #GET_UNINSTALLED_PACKAGES
*/
- public abstract PackageInfo getPackageInfo(String packageName, int flags)
+ public abstract PackageInfo getPackageInfo(String packageName, @PackageInfoFlags int flags)
throws NameNotFoundException;
/**
* @see #GET_UNINSTALLED_PACKAGES
*/
@RequiresPermission(Manifest.permission.INTERACT_ACROSS_USERS)
- public abstract PackageInfo getPackageInfoAsUser(String packageName, int flags, int userId)
- throws NameNotFoundException;
+ public abstract PackageInfo getPackageInfoAsUser(String packageName,
+ @PackageInfoFlags int flags, int userId) throws NameNotFoundException;
/**
* Map from the current package names in use on the device to whatever
* @return Returns a {@link PermissionInfo} containing information about the
* permission.
*/
- public abstract PermissionInfo getPermissionInfo(String name, int flags)
+ public abstract PermissionInfo getPermissionInfo(String name, @PermissionInfoFlags int flags)
throws NameNotFoundException;
/**
* about all of the permissions in the given group.
*/
public abstract List<PermissionInfo> queryPermissionsByGroup(String group,
- int flags) throws NameNotFoundException;
+ @PermissionInfoFlags int flags) throws NameNotFoundException;
/**
* Retrieve all of the information we know about a particular group of
* about the permission.
*/
public abstract PermissionGroupInfo getPermissionGroupInfo(String name,
- int flags) throws NameNotFoundException;
+ @PermissionGroupInfoFlags int flags) throws NameNotFoundException;
/**
* Retrieve all of the known permission groups in the system.
* @return Returns a list of {@link PermissionGroupInfo} containing
* information about all of the known permission groups.
*/
- public abstract List<PermissionGroupInfo> getAllPermissionGroups(int flags);
+ public abstract List<PermissionGroupInfo> getAllPermissionGroups(
+ @PermissionGroupInfoFlags int flags);
/**
* Retrieve all of the information we know about a particular
* @see #GET_UNINSTALLED_PACKAGES
*/
public abstract ApplicationInfo getApplicationInfo(String packageName,
- int flags) throws NameNotFoundException;
+ @ApplicationInfoFlags int flags) throws NameNotFoundException;
/**
* Retrieve all of the information we know about a particular activity
* @see #GET_SHARED_LIBRARY_FILES
*/
public abstract ActivityInfo getActivityInfo(ComponentName component,
- int flags) throws NameNotFoundException;
+ @ComponentInfoFlags int flags) throws NameNotFoundException;
/**
* Retrieve all of the information we know about a particular receiver
* @see #GET_SHARED_LIBRARY_FILES
*/
public abstract ActivityInfo getReceiverInfo(ComponentName component,
- int flags) throws NameNotFoundException;
+ @ComponentInfoFlags int flags) throws NameNotFoundException;
/**
* Retrieve all of the information we know about a particular service
* @see #GET_SHARED_LIBRARY_FILES
*/
public abstract ServiceInfo getServiceInfo(ComponentName component,
- int flags) throws NameNotFoundException;
+ @ComponentInfoFlags int flags) throws NameNotFoundException;
/**
* Retrieve all of the information we know about a particular content
* @see #GET_SHARED_LIBRARY_FILES
*/
public abstract ProviderInfo getProviderInfo(ComponentName component,
- int flags) throws NameNotFoundException;
+ @ComponentInfoFlags int flags) throws NameNotFoundException;
/**
* Return a List of all packages that are installed
* @see #GET_SIGNATURES
* @see #GET_UNINSTALLED_PACKAGES
*/
- public abstract List<PackageInfo> getInstalledPackages(int flags);
+ public abstract List<PackageInfo> getInstalledPackages(@PackageInfoFlags int flags);
/**
* Return a List of all installed packages that are currently
* @see #GET_UNINSTALLED_PACKAGES
*/
public abstract List<PackageInfo> getPackagesHoldingPermissions(
- String[] permissions, int flags);
+ String[] permissions, @PackageInfoFlags int flags);
/**
* Return a List of all packages that are installed on the device, for a specific user.
*
* @hide
*/
- public abstract List<PackageInfo> getInstalledPackages(int flags, int userId);
+ public abstract List<PackageInfo> getInstalledPackages(@PackageInfoFlags int flags, int userId);
/**
* Check whether a particular package has been granted a particular
* @see #GET_SHARED_LIBRARY_FILES
* @see #GET_UNINSTALLED_PACKAGES
*/
- public abstract List<ApplicationInfo> getInstalledApplications(int flags);
+ public abstract List<ApplicationInfo> getInstalledApplications(@ApplicationInfoFlags int flags);
/**
* Gets the ephemeral applications the user recently used. Requires
* @see #GET_INTENT_FILTERS
* @see #GET_RESOLVED_FILTER
*/
- public abstract ResolveInfo resolveActivity(Intent intent, int flags);
+ public abstract ResolveInfo resolveActivity(Intent intent, @ResolveInfoFlags int flags);
/**
* Determine the best action to perform for a given Intent for a given user. This
*
* @hide
*/
- public abstract ResolveInfo resolveActivityAsUser(Intent intent, int flags, int userId);
+ public abstract ResolveInfo resolveActivityAsUser(Intent intent, @ResolveInfoFlags int flags,
+ int userId);
/**
* Retrieve all activities that can be performed for the given intent.
* @see #GET_RESOLVED_FILTER
*/
public abstract List<ResolveInfo> queryIntentActivities(Intent intent,
- int flags);
+ @ResolveInfoFlags int flags);
/**
* Retrieve all activities that can be performed for the given intent, for a specific user.
* @hide
*/
public abstract List<ResolveInfo> queryIntentActivitiesAsUser(Intent intent,
- int flags, int userId);
-
+ @ResolveInfoFlags int flags, int userId);
/**
* Retrieve a set of activities that should be presented to the user as
* @see #GET_RESOLVED_FILTER
*/
public abstract List<ResolveInfo> queryIntentActivityOptions(
- ComponentName caller, Intent[] specifics, Intent intent, int flags);
+ ComponentName caller, Intent[] specifics, Intent intent, @ResolveInfoFlags int flags);
/**
* Retrieve all receivers that can handle a broadcast of the given intent.
* @see #GET_RESOLVED_FILTER
*/
public abstract List<ResolveInfo> queryBroadcastReceivers(Intent intent,
- int flags);
+ @ResolveInfoFlags int flags);
/**
* Retrieve all receivers that can handle a broadcast of the given intent, for a specific
* @hide
*/
public abstract List<ResolveInfo> queryBroadcastReceivers(Intent intent,
- int flags, int userId);
+ @ResolveInfoFlags int flags, int userId);
/**
* Determine the best service to handle for a given Intent.
* @see #GET_INTENT_FILTERS
* @see #GET_RESOLVED_FILTER
*/
- public abstract ResolveInfo resolveService(Intent intent, int flags);
+ public abstract ResolveInfo resolveService(Intent intent, @ResolveInfoFlags int flags);
/**
* Retrieve all services that can match the given intent.
* @see #GET_RESOLVED_FILTER
*/
public abstract List<ResolveInfo> queryIntentServices(Intent intent,
- int flags);
+ @ResolveInfoFlags int flags);
/**
* Retrieve all services that can match the given intent for a given user.
* @hide
*/
public abstract List<ResolveInfo> queryIntentServicesAsUser(Intent intent,
- int flags, int userId);
+ @ResolveInfoFlags int flags, int userId);
/** {@hide} */
public abstract List<ResolveInfo> queryIntentContentProvidersAsUser(
- Intent intent, int flags, int userId);
+ Intent intent, @ResolveInfoFlags int flags, int userId);
/**
* Retrieve all providers that can match the given intent.
* @see #GET_INTENT_FILTERS
* @see #GET_RESOLVED_FILTER
*/
- public abstract List<ResolveInfo> queryIntentContentProviders(Intent intent, int flags);
+ public abstract List<ResolveInfo> queryIntentContentProviders(Intent intent,
+ @ResolveInfoFlags int flags);
/**
* Find a single content provider by its base path name.
* else null.
*/
public abstract ProviderInfo resolveContentProvider(String name,
- int flags);
+ @ComponentInfoFlags int flags);
/**
* Find a single content provider by its base path name.
* else null.
* @hide
*/
- public abstract ProviderInfo resolveContentProviderAsUser(String name, int flags, int userId);
+ public abstract ProviderInfo resolveContentProviderAsUser(String name,
+ @ComponentInfoFlags int flags, int userId);
/**
* Retrieve content provider information.
* <em>If there are no matching providers, null is returned.</em>
*/
public abstract List<ProviderInfo> queryContentProviders(
- String processName, int uid, int flags);
+ String processName, int uid, @ComponentInfoFlags int flags);
/**
* Retrieve all of the information we know about a particular
* @return InstrumentationInfo containing information about the
* instrumentation.
*/
- public abstract InstrumentationInfo getInstrumentationInfo(
- ComponentName className, int flags) throws NameNotFoundException;
+ public abstract InstrumentationInfo getInstrumentationInfo(ComponentName className,
+ @InstrumentationInfoFlags int flags) throws NameNotFoundException;
/**
* Retrieve information about available instrumentation code. May be used
* matching available Instrumentation. Returns an empty list if
* there is no instrumentation available for the given package.
*/
- public abstract List<InstrumentationInfo> queryInstrumentation(
- String targetPackage, int flags);
+ public abstract List<InstrumentationInfo> queryInstrumentation(String targetPackage,
+ @InstrumentationInfoFlags int flags);
/**
* Retrieve an image from a package. This is a low-level API used by
* @see #GET_SIGNATURES
*
*/
- public PackageInfo getPackageArchiveInfo(String archiveFilePath, int flags) {
+ public PackageInfo getPackageArchiveInfo(String archiveFilePath, @PackageInfoFlags int flags) {
final PackageParser parser = new PackageParser();
final File apkFile = new File(archiveFilePath);
try {
* @see #GET_SERVICES
* @see #GET_SIGNATURES
*/
- public abstract List<PackageInfo> getPreferredPackages(int flags);
+ public abstract List<PackageInfo> getPreferredPackages(@PackageInfoFlags int flags);
/**
* @deprecated This is a protected API that should not have been available
import android.util.Log;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
private final List<T> mList;
+ public static <T extends Parcelable> ParceledListSlice<T> emptyList() {
+ return new ParceledListSlice<T>(Collections.<T> emptyList());
+ }
+
public ParceledListSlice(List<T> list) {
mList = list;
}
Intent getHomeIntent() {
Intent intent = new Intent(mTopAction, mTopData != null ? Uri.parse(mTopData) : null);
intent.setComponent(mTopComponent);
- intent.addFlags(Intent.FLAG_DEBUG_ENCRYPTION_TRIAGED);
+ intent.addFlags(Intent.FLAG_DEBUG_TRIAGED_MISSING);
if (mFactoryTest != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
intent.addCategory(Intent.CATEGORY_HOME);
}
ParceledListSlice<ProviderInfo> slice = AppGlobals.getPackageManager()
.queryContentProviders(app.processName, app.uid,
STOCK_PM_FLAGS | PackageManager.GET_URI_PERMISSION_PATTERNS
- | PackageManager.MATCH_ENCRYPTION_DEFAULT);
+ | PackageManager.MATCH_DEBUG_TRIAGED_MISSING);
providers = slice != null ? slice.getList() : null;
} catch (RemoteException ex) {
}
private List<ResolveInfo> collectReceiverComponents(Intent intent, String resolvedType,
int callingUid, int[] users) {
// TODO: come back and remove this assumption to triage all broadcasts
- int pmFlags = STOCK_PM_FLAGS | PackageManager.MATCH_ENCRYPTION_DEFAULT;
+ int pmFlags = STOCK_PM_FLAGS | PackageManager.MATCH_DEBUG_TRIAGED_MISSING;
List<ResolveInfo> receivers = null;
try {
private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
- Slog.d(TAG, "Receieved: " + intent.getAction());
- if (Intent.ACTION_PACKAGE_REMOVED.equals(intent.getAction())) {
+ final String action = intent.getAction();
+ Slog.d(TAG, "Receieved: " + action);
+ if (Intent.ACTION_PACKAGE_REMOVED.equals(action)) {
// If this is an outright uninstall rather than the first half of an
// app update sequence, cancel the jobs associated with the app.
if (!intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {
}
cancelJobsForUid(uidRemoved, true);
}
- } else if (Intent.ACTION_USER_REMOVED.equals(intent.getAction())) {
+ } else if (Intent.ACTION_USER_REMOVED.equals(action)) {
final int userId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0);
if (DEBUG) {
Slog.d(TAG, "Removing jobs for user: " + userId);
}
cancelJobsForUser(userId);
- } else if (PowerManager.ACTION_LIGHT_DEVICE_IDLE_MODE_CHANGED.equals(intent.getAction())
- || PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED.equals(intent.getAction())) {
+ } else if (PowerManager.ACTION_LIGHT_DEVICE_IDLE_MODE_CHANGED.equals(action)
+ || PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED.equals(action)) {
updateIdleMode(mPowerManager != null
? (mPowerManager.isDeviceIdleMode()
|| mPowerManager.isLightDeviceIdleMode())
: false);
+ } else if (Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(action)) {
+ // Kick off pending jobs for any apps that re-appeared
+ mHandler.obtainMessage(MSG_CHECK_JOB).sendToTarget();
}
}
};
@Override
public void onBootPhase(int phase) {
if (PHASE_SYSTEM_SERVICES_READY == phase) {
- // Register br for package removals and user removals.
+ // Register for package removals and user removals.
final IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_REMOVED);
filter.addDataScheme("package");
getContext().registerReceiverAsUser(
mBroadcastReceiver, UserHandle.ALL, filter, null, null);
+
final IntentFilter userFilter = new IntentFilter(Intent.ACTION_USER_REMOVED);
userFilter.addAction(PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED);
userFilter.addAction(PowerManager.ACTION_LIGHT_DEVICE_IDLE_MODE_CHANGED);
getContext().registerReceiverAsUser(
mBroadcastReceiver, UserHandle.ALL, userFilter, null, null);
- mPowerManager = (PowerManager)getContext().getSystemService(Context.POWER_SERVICE);
+
+ final IntentFilter storageFilter = new IntentFilter();
+ storageFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE);
+ getContext().registerReceiverAsUser(
+ mBroadcastReceiver, UserHandle.ALL, storageFilter, null, null);
+
+ mPowerManager = getContext().getSystemService(PowerManager.class);
try {
ActivityManagerNative.getDefault().registerUidObserver(mUidObserver,
ActivityManager.UID_OBSERVER_IDLE);
final boolean componentPresent;
try {
componentPresent = (AppGlobals.getPackageManager().getServiceInfo(
- job.getServiceComponent(), PackageManager.MATCH_ENCRYPTION_DEFAULT,
+ job.getServiceComponent(), PackageManager.MATCH_DEBUG_TRIAGED_MISSING,
userId) != null);
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
final IPackageManager pm = AppGlobals.getPackageManager();
final ComponentName service = job.getService();
try {
- ServiceInfo si = pm.getServiceInfo(service, PackageManager.MATCH_ENCRYPTION_DEFAULT,
- UserHandle.getUserId(uid));
+ ServiceInfo si = pm.getServiceInfo(service,
+ PackageManager.MATCH_DEBUG_TRIAGED_MISSING, UserHandle.getUserId(uid));
if (si == null) {
throw new IllegalArgumentException("No such service " + service);
}
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.AppsQueryHelper;
+import android.content.pm.ComponentInfo;
import android.content.pm.EphemeralApplicationInfo;
import android.content.pm.EphemeralResolveInfo;
import android.content.pm.EphemeralResolveInfo.EphemeralResolveIntentInfo;
import com.android.internal.R;
import com.android.internal.annotations.GuardedBy;
-import com.android.internal.annotations.GuardedBy;
import com.android.internal.app.IMediaContainerService;
import com.android.internal.app.ResolverActivity;
import com.android.internal.content.NativeLibraryHelper;
private static final boolean DEBUG_DEXOPT = false;
private static final boolean DEBUG_ABI_SELECTION = false;
private static final boolean DEBUG_EPHEMERAL = false;
- private static final boolean DEBUG_ENCRYPTION_AWARE = false;
+ private static final boolean DEBUG_TRIAGED_MISSING = false;
static final boolean CLEAR_RUNTIME_PERMISSIONS_ON_UPGRADE = false;
@Override
public PackageInfo getPackageInfo(String packageName, int flags, int userId) {
if (!sUserManager.exists(userId)) return null;
+ flags = updateFlagsForPackage(flags, userId, packageName);
enforceCrossUserPermission(Binder.getCallingUid(), userId, false, false, "get package info");
// reader
synchronized (mPackages) {
@Override
public int getPackageUidEtc(String packageName, int flags, int userId) {
if (!sUserManager.exists(userId)) return -1;
+ flags = updateFlagsForPackage(flags, userId, packageName);
enforceCrossUserPermission(Binder.getCallingUid(), userId, false, false, "get package uid");
// reader
@Override
public int[] getPackageGidsEtc(String packageName, int flags, int userId) {
- if (!sUserManager.exists(userId)) {
- return null;
- }
-
+ if (!sUserManager.exists(userId)) return null;
+ flags = updateFlagsForPackage(flags, userId, packageName);
enforceCrossUserPermission(Binder.getCallingUid(), userId, false, false,
"getPackageGids");
return null;
}
- static PermissionInfo generatePermissionInfo(
- BasePermission bp, int flags) {
+ static PermissionInfo generatePermissionInfo(BasePermission bp, int flags) {
if (bp.perm != null) {
return PackageParser.generatePermissionInfo(bp.perm, flags);
}
@Override
public ApplicationInfo getApplicationInfo(String packageName, int flags, int userId) {
if (!sUserManager.exists(userId)) return null;
+ flags = updateFlagsForApplication(flags, userId, packageName);
enforceCrossUserPermission(Binder.getCallingUid(), userId, false, false, "get application info");
// writer
synchronized (mPackages) {
}
/**
- * Augment the given flags depending on current user running state. This is
- * purposefully done before acquiring {@link #mPackages} lock.
+ * Update given flags based on encryption status of current user.
*/
- private int augmentFlagsForUser(int flags, int userId, Object cookie) {
- if (cookie instanceof Intent) {
- // If intent claims to be triaged, then we're fine with default
- // matching behavior below
- final Intent intent = (Intent) cookie;
- if ((intent.getFlags() & Intent.FLAG_DEBUG_ENCRYPTION_TRIAGED) != 0) {
- flags |= PackageManager.MATCH_ENCRYPTION_DEFAULT;
- }
- }
-
- if ((flags & (PackageManager.MATCH_ENCRYPTION_UNAWARE_ONLY
- | PackageManager.MATCH_ENCRYPTION_AWARE_ONLY)) != 0) {
- // Caller expressed an opinion about what components they want to
- // see, so fall through and give them what they want
+ private int updateFlagsForEncryption(int flags, int userId) {
+ if ((flags & (PackageManager.MATCH_ENCRYPTION_UNAWARE
+ | PackageManager.MATCH_ENCRYPTION_AWARE)) != 0) {
+ // Caller expressed an explicit opinion about what encryption
+ // aware/unaware components they want to see, so fall through and
+ // give them what they want
} else {
// Caller expressed no opinion, so match based on user state
if (isUserKeyUnlocked(userId)) {
flags |= PackageManager.MATCH_ENCRYPTION_AWARE_AND_UNAWARE;
} else {
- flags |= PackageManager.MATCH_ENCRYPTION_AWARE_ONLY;
-
- // If we have a system caller that hasn't done their homework to
- // decide they want this default behavior, yell at them
- if (DEBUG_ENCRYPTION_AWARE && (Binder.getCallingUid() == Process.SYSTEM_UID)
- && ((flags & PackageManager.MATCH_ENCRYPTION_DEFAULT) == 0)) {
- Log.v(TAG, "Caller hasn't been triaged for FBE; they asked about " + cookie,
- new Throwable());
- }
+ flags |= PackageManager.MATCH_ENCRYPTION_AWARE;
}
}
return flags;
}
+ /**
+ * Update given flags when being used to request {@link PackageInfo}.
+ */
+ private int updateFlagsForPackage(int flags, int userId, Object cookie) {
+ boolean triaged = true;
+ if ((flags & PackageManager.GET_ACTIVITIES | PackageManager.GET_RECEIVERS
+ | PackageManager.GET_SERVICES | PackageManager.GET_PROVIDERS) != 0) {
+ // Caller is asking for component details, so they'd better be
+ // asking for specific encryption matching behavior, or be triaged
+ if ((flags & (PackageManager.MATCH_ENCRYPTION_UNAWARE
+ | PackageManager.MATCH_ENCRYPTION_AWARE
+ | PackageManager.MATCH_DEBUG_TRIAGED_MISSING)) == 0) {
+ triaged = false;
+ }
+ }
+ if ((flags & (PackageManager.MATCH_UNINSTALLED_PACKAGES
+ | PackageManager.MATCH_DEBUG_TRIAGED_MISSING)) == 0) {
+ triaged = false;
+ }
+ if (DEBUG_TRIAGED_MISSING && (Binder.getCallingUid() == Process.SYSTEM_UID) && !triaged) {
+ Log.w(TAG, "Caller hasn't been triaged for missing apps; they asked about " + cookie,
+ new Throwable());
+ }
+ return updateFlagsForEncryption(flags, userId);
+ }
+
+ /**
+ * Update given flags when being used to request {@link ApplicationInfo}.
+ */
+ private int updateFlagsForApplication(int flags, int userId, Object cookie) {
+ return updateFlagsForPackage(flags, userId, cookie);
+ }
+
+ /**
+ * Update given flags when being used to request {@link ComponentInfo}.
+ */
+ private int updateFlagsForComponent(int flags, int userId, Object cookie) {
+ boolean triaged = true;
+ // Caller is asking for component details, so they'd better be
+ // asking for specific encryption matching behavior, or be triaged
+ if ((flags & (PackageManager.MATCH_ENCRYPTION_UNAWARE
+ | PackageManager.MATCH_ENCRYPTION_AWARE
+ | PackageManager.MATCH_DEBUG_TRIAGED_MISSING)) == 0) {
+ triaged = false;
+ }
+ if (DEBUG_TRIAGED_MISSING && (Binder.getCallingUid() == Process.SYSTEM_UID) && !triaged) {
+ Log.w(TAG, "Caller hasn't been triaged for missing apps; they asked about " + cookie,
+ new Throwable());
+ }
+ return updateFlagsForEncryption(flags, userId);
+ }
+
+ /**
+ * Update given flags when being used to request {@link ResolveInfo}.
+ */
+ private int updateFlagsForResolve(int flags, int userId, Object cookie) {
+ return updateFlagsForComponent(flags, userId, cookie);
+ }
+
@Override
public ActivityInfo getActivityInfo(ComponentName component, int flags, int userId) {
if (!sUserManager.exists(userId)) return null;
- flags = augmentFlagsForUser(flags, userId, component);
+ flags = updateFlagsForComponent(flags, userId, component);
enforceCrossUserPermission(Binder.getCallingUid(), userId, false, false, "get activity info");
synchronized (mPackages) {
PackageParser.Activity a = mActivities.mActivities.get(component);
@Override
public ActivityInfo getReceiverInfo(ComponentName component, int flags, int userId) {
if (!sUserManager.exists(userId)) return null;
- flags = augmentFlagsForUser(flags, userId, component);
+ flags = updateFlagsForComponent(flags, userId, component);
enforceCrossUserPermission(Binder.getCallingUid(), userId, false, false, "get receiver info");
synchronized (mPackages) {
PackageParser.Activity a = mReceivers.mActivities.get(component);
@Override
public ServiceInfo getServiceInfo(ComponentName component, int flags, int userId) {
if (!sUserManager.exists(userId)) return null;
- flags = augmentFlagsForUser(flags, userId, component);
+ flags = updateFlagsForComponent(flags, userId, component);
enforceCrossUserPermission(Binder.getCallingUid(), userId, false, false, "get service info");
synchronized (mPackages) {
PackageParser.Service s = mServices.mServices.get(component);
@Override
public ProviderInfo getProviderInfo(ComponentName component, int flags, int userId) {
if (!sUserManager.exists(userId)) return null;
- flags = augmentFlagsForUser(flags, userId, component);
+ flags = updateFlagsForComponent(flags, userId, component);
enforceCrossUserPermission(Binder.getCallingUid(), userId, false, false, "get provider info");
synchronized (mPackages) {
PackageParser.Provider p = mProviders.mProviders.get(component);
public ResolveInfo resolveIntent(Intent intent, String resolvedType,
int flags, int userId) {
if (!sUserManager.exists(userId)) return null;
- flags = augmentFlagsForUser(flags, userId, intent);
+ flags = updateFlagsForResolve(flags, userId, intent);
enforceCrossUserPermission(Binder.getCallingUid(), userId, false, false, "resolve intent");
List<ResolveInfo> query = queryIntentActivities(intent, resolvedType, flags, userId);
final ResolveInfo bestChoice =
List<ResolveInfo> query, int priority, boolean always,
boolean removeMatches, boolean debug, int userId) {
if (!sUserManager.exists(userId)) return null;
- flags = augmentFlagsForUser(flags, userId, intent);
+ flags = updateFlagsForResolve(flags, userId, intent);
// writer
synchronized (mPackages) {
if (intent.getSelector() != null) {
public List<ResolveInfo> queryIntentActivities(Intent intent,
String resolvedType, int flags, int userId) {
if (!sUserManager.exists(userId)) return Collections.emptyList();
- flags = augmentFlagsForUser(flags, userId, intent);
+ flags = updateFlagsForResolve(flags, userId, intent);
enforceCrossUserPermission(Binder.getCallingUid(), userId, false, false, "query intent activities");
ComponentName comp = intent.getComponent();
if (comp == null) {
Intent[] specifics, String[] specificTypes, Intent intent,
String resolvedType, int flags, int userId) {
if (!sUserManager.exists(userId)) return Collections.emptyList();
- flags = augmentFlagsForUser(flags, userId, intent);
+ flags = updateFlagsForResolve(flags, userId, intent);
enforceCrossUserPermission(Binder.getCallingUid(), userId, false,
false, "query intent activity options");
final String resultsAction = intent.getAction();
public List<ResolveInfo> queryIntentReceivers(Intent intent, String resolvedType, int flags,
int userId) {
if (!sUserManager.exists(userId)) return Collections.emptyList();
- flags = augmentFlagsForUser(flags, userId, intent);
+ flags = updateFlagsForResolve(flags, userId, intent);
ComponentName comp = intent.getComponent();
if (comp == null) {
if (intent.getSelector() != null) {
@Override
public ResolveInfo resolveService(Intent intent, String resolvedType, int flags, int userId) {
if (!sUserManager.exists(userId)) return null;
- flags = augmentFlagsForUser(flags, userId, intent);
+ flags = updateFlagsForResolve(flags, userId, intent);
List<ResolveInfo> query = queryIntentServices(intent, resolvedType, flags, userId);
if (query != null) {
if (query.size() >= 1) {
public List<ResolveInfo> queryIntentServices(Intent intent, String resolvedType, int flags,
int userId) {
if (!sUserManager.exists(userId)) return Collections.emptyList();
- flags = augmentFlagsForUser(flags, userId, intent);
+ flags = updateFlagsForResolve(flags, userId, intent);
ComponentName comp = intent.getComponent();
if (comp == null) {
if (intent.getSelector() != null) {
public List<ResolveInfo> queryIntentContentProviders(
Intent intent, String resolvedType, int flags, int userId) {
if (!sUserManager.exists(userId)) return Collections.emptyList();
- flags = augmentFlagsForUser(flags, userId, intent);
+ flags = updateFlagsForResolve(flags, userId, intent);
ComponentName comp = intent.getComponent();
if (comp == null) {
if (intent.getSelector() != null) {
@Override
public ParceledListSlice<PackageInfo> getInstalledPackages(int flags, int userId) {
+ if (!sUserManager.exists(userId)) return ParceledListSlice.emptyList();
+ flags = updateFlagsForPackage(flags, userId, null);
final boolean listUninstalled = (flags & PackageManager.GET_UNINSTALLED_PACKAGES) != 0;
-
enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false, "get installed packages");
// writer
@Override
public ParceledListSlice<PackageInfo> getPackagesHoldingPermissions(
String[] permissions, int flags, int userId) {
- if (!sUserManager.exists(userId)) return null;
+ if (!sUserManager.exists(userId)) return ParceledListSlice.emptyList();
+ flags = updateFlagsForPackage(flags, userId, permissions);
final boolean listUninstalled = (flags & PackageManager.GET_UNINSTALLED_PACKAGES) != 0;
// writer
@Override
public ParceledListSlice<ApplicationInfo> getInstalledApplications(int flags, int userId) {
- if (!sUserManager.exists(userId)) return null;
+ if (!sUserManager.exists(userId)) return ParceledListSlice.emptyList();
+ flags = updateFlagsForApplication(flags, userId, null);
final boolean listUninstalled = (flags & PackageManager.GET_UNINSTALLED_PACKAGES) != 0;
// writer
@Override
public ProviderInfo resolveContentProvider(String name, int flags, int userId) {
if (!sUserManager.exists(userId)) return null;
- flags = augmentFlagsForUser(flags, userId, name);
+ flags = updateFlagsForComponent(flags, userId, name);
// reader
synchronized (mPackages) {
final PackageParser.Provider provider = mProvidersByAuthority.get(name);
final int userId = processName != null ? UserHandle.getUserId(uid)
: UserHandle.getCallingUserId();
if (!sUserManager.exists(userId)) return null;
- flags = augmentFlagsForUser(flags, userId, processName);
+ flags = updateFlagsForComponent(flags, userId, processName);
ArrayList<ProviderInfo> finalList = null;
// reader
}
@Override
- public InstrumentationInfo getInstrumentationInfo(ComponentName name,
- int flags) {
+ public InstrumentationInfo getInstrumentationInfo(ComponentName name, int flags) {
// reader
synchronized (mPackages) {
final PackageParser.Instrumentation i = mInstrumentation.get(name);
}
}
- final boolean matchesUnaware = ((flags & PackageManager.MATCH_ENCRYPTION_UNAWARE_ONLY) != 0)
+ final boolean matchesUnaware = ((flags & PackageManager.MATCH_ENCRYPTION_UNAWARE) != 0)
&& !componentInfo.encryptionAware;
- final boolean matchesAware = ((flags & PackageManager.MATCH_ENCRYPTION_AWARE_ONLY) != 0)
+ final boolean matchesAware = ((flags & PackageManager.MATCH_ENCRYPTION_AWARE) != 0)
&& componentInfo.encryptionAware;
return matchesUnaware || matchesAware;
}
final ComponentName keyguardComponent = ComponentName.unflattenFromString(
resources.getString(com.android.internal.R.string.config_keyguardComponent));
- intent.addFlags(Intent.FLAG_DEBUG_ENCRYPTION_TRIAGED);
+ intent.addFlags(Intent.FLAG_DEBUG_TRIAGED_MISSING);
intent.setComponent(keyguardComponent);
if (!context.bindServiceAsUser(intent, mKeyguardConnection,
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.android.systemui",
"com.android.systemui.SystemUIService"));
- intent.addFlags(Intent.FLAG_DEBUG_ENCRYPTION_TRIAGED);
+ intent.addFlags(Intent.FLAG_DEBUG_TRIAGED_MISSING);
//Slog.d(TAG, "Starting service: " + intent);
context.startServiceAsUser(intent, UserHandle.SYSTEM);
}
// Get the list of apps registered for the DIAL intent with empty scheme
Intent intent = new Intent(Intent.ACTION_DIAL);
- List<ResolveInfo> resolveInfoList = packageManager.queryIntentActivities(intent,
- PackageManager.MATCH_ENCRYPTION_DEFAULT);
+ List<ResolveInfo> resolveInfoList = packageManager.queryIntentActivities(intent, 0);
List<String> packageNames = new ArrayList<>();
final List<String> result = new ArrayList<>();
final List<ResolveInfo> resolveInfoList = context.getPackageManager()
- .queryIntentActivities(intent, PackageManager.MATCH_ENCRYPTION_DEFAULT);
+ .queryIntentActivities(intent, 0);
final int length = resolveInfoList.size();
for (int i = 0; i < length; i++) {
final ActivityInfo info = resolveInfoList.get(i).activityInfo;