Loading boot/hiddenapi/hiddenapi-unsupported.txt +0 −2 Original line number Diff line number Diff line Loading @@ -124,10 +124,8 @@ Landroid/content/pm/IPackageInstallObserver2$Stub;->asInterface(Landroid/os/IBin Landroid/content/pm/IPackageManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V Landroid/content/pm/IPackageManager$Stub$Proxy;->checkUidPermission(Ljava/lang/String;I)I Landroid/content/pm/IPackageManager$Stub$Proxy;->getAppOpPermissionPackages(Ljava/lang/String;)[Ljava/lang/String; Landroid/content/pm/IPackageManager$Stub$Proxy;->getInstalledPackages(II)Landroid/content/pm/ParceledListSlice; Landroid/content/pm/IPackageManager$Stub$Proxy;->getInstallLocation()I Landroid/content/pm/IPackageManager$Stub$Proxy;->getLastChosenActivity(Landroid/content/Intent;Ljava/lang/String;I)Landroid/content/pm/ResolveInfo; Landroid/content/pm/IPackageManager$Stub$Proxy;->getPackageInfo(Ljava/lang/String;II)Landroid/content/pm/PackageInfo; Landroid/content/pm/IPackageManager$Stub$Proxy;->getPackagesForUid(I)[Ljava/lang/String; Landroid/content/pm/IPackageManager$Stub$Proxy;->getSystemSharedLibraryNames()[Ljava/lang/String; Landroid/content/pm/IPackageManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageManager; Loading core/java/android/content/pm/IPackageManager.aidl +24 −35 Original line number Diff line number Diff line Loading @@ -69,41 +69,34 @@ interface IPackageManager { void checkPackageStartable(String packageName, int userId); @UnsupportedAppUsage(trackingBug = 171933273) boolean isPackageAvailable(String packageName, int userId); @UnsupportedAppUsage PackageInfo getPackageInfo(String packageName, int flags, int userId); PackageInfo getPackageInfo(String packageName, long flags, int userId); PackageInfo getPackageInfoVersioned(in VersionedPackage versionedPackage, int flags, int userId); @UnsupportedAppUsage int getPackageUid(String packageName, int flags, int userId); int[] getPackageGids(String packageName, int flags, int userId); long flags, int userId); int getPackageUid(String packageName, long flags, int userId); int[] getPackageGids(String packageName, long flags, int userId); @UnsupportedAppUsage String[] currentToCanonicalPackageNames(in String[] names); @UnsupportedAppUsage String[] canonicalToCurrentPackageNames(in String[] names); @UnsupportedAppUsage ApplicationInfo getApplicationInfo(String packageName, int flags ,int userId); ApplicationInfo getApplicationInfo(String packageName, long flags, int userId); /** * @return the target SDK for the given package name, or -1 if it cannot be retrieved */ int getTargetSdkVersion(String packageName); @UnsupportedAppUsage ActivityInfo getActivityInfo(in ComponentName className, int flags, int userId); ActivityInfo getActivityInfo(in ComponentName className, long flags, int userId); boolean activitySupportsIntent(in ComponentName className, in Intent intent, String resolvedType); @UnsupportedAppUsage ActivityInfo getReceiverInfo(in ComponentName className, int flags, int userId); ActivityInfo getReceiverInfo(in ComponentName className, long flags, int userId); @UnsupportedAppUsage ServiceInfo getServiceInfo(in ComponentName className, int flags, int userId); ServiceInfo getServiceInfo(in ComponentName className, long flags, int userId); @UnsupportedAppUsage ProviderInfo getProviderInfo(in ComponentName className, int flags, int userId); ProviderInfo getProviderInfo(in ComponentName className, long flags, int userId); boolean isProtectedBroadcast(String actionName); Loading Loading @@ -133,33 +126,31 @@ interface IPackageManager { @UnsupportedAppUsage boolean isUidPrivileged(int uid); @UnsupportedAppUsage ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags, int userId); ResolveInfo resolveIntent(in Intent intent, String resolvedType, long flags, int userId); ResolveInfo findPersistentPreferredActivity(in Intent intent, int userId); boolean canForwardTo(in Intent intent, String resolvedType, int sourceUserId, int targetUserId); @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) ParceledListSlice queryIntentActivities(in Intent intent, String resolvedType, int flags, int userId); String resolvedType, long flags, int userId); ParceledListSlice queryIntentActivityOptions( in ComponentName caller, in Intent[] specifics, in String[] specificTypes, in Intent intent, String resolvedType, int flags, int userId); String resolvedType, long flags, int userId); ParceledListSlice queryIntentReceivers(in Intent intent, String resolvedType, int flags, int userId); String resolvedType, long flags, int userId); ResolveInfo resolveService(in Intent intent, String resolvedType, int flags, int userId); String resolvedType, long flags, int userId); ParceledListSlice queryIntentServices(in Intent intent, String resolvedType, int flags, int userId); String resolvedType, long flags, int userId); ParceledListSlice queryIntentContentProviders(in Intent intent, String resolvedType, int flags, int userId); String resolvedType, long flags, int userId); /** * This implements getInstalledPackages via a "last returned row" Loading @@ -167,8 +158,7 @@ interface IPackageManager { * limit that kicks in when flags are included that bloat up the data * returned. */ @UnsupportedAppUsage ParceledListSlice getInstalledPackages(int flags, in int userId); ParceledListSlice getInstalledPackages(long flags, in int userId); /** * This implements getPackagesHoldingPermissions via a "last returned row" Loading @@ -177,7 +167,7 @@ interface IPackageManager { * returned. */ ParceledListSlice getPackagesHoldingPermissions(in String[] permissions, int flags, int userId); long flags, int userId); /** * This implements getInstalledApplications via a "last returned row" Loading @@ -185,18 +175,17 @@ interface IPackageManager { * limit that kicks in when flags are included that bloat up the data * returned. */ @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) ParceledListSlice getInstalledApplications(int flags, int userId); ParceledListSlice getInstalledApplications(long flags, int userId); /** * Retrieve all applications that are marked as persistent. * * @return A List<applicationInfo> containing one entry for each persistent * @return A List<ApplicationInfo> containing one entry for each persistent * application. */ ParceledListSlice getPersistentApplications(int flags); ProviderInfo resolveContentProvider(String name, int flags, int userId); ProviderInfo resolveContentProvider(String name, long flags, int userId); /** * Retrieve sync information for all content providers. Loading @@ -211,7 +200,7 @@ interface IPackageManager { inout List<ProviderInfo> outInfo); ParceledListSlice queryContentProviders( String processName, int uid, int flags, String metaDataKey); String processName, int uid, long flags, String metaDataKey); @UnsupportedAppUsage InstrumentationInfo getInstrumentationInfo( Loading Loading @@ -690,9 +679,9 @@ interface IPackageManager { int getInstallReason(String packageName, int userId); ParceledListSlice getSharedLibraries(in String packageName, int flags, int userId); ParceledListSlice getSharedLibraries(in String packageName, long flags, int userId); ParceledListSlice getDeclaredSharedLibraries(in String packageName, int flags, int userId); ParceledListSlice getDeclaredSharedLibraries(in String packageName, long flags, int userId); boolean canRequestPackageInstalls(String packageName, int userId); Loading core/java/android/content/pm/parsing/PackageInfoWithoutStateUtils.java +39 −35 Original line number Diff line number Diff line Loading @@ -76,7 +76,7 @@ public class PackageInfoWithoutStateUtils { @Nullable public static PackageInfo generate(ParsingPackageRead pkg, int[] gids, @PackageManager.PackageInfoFlags int flags, long firstInstallTime, long lastUpdateTime, @PackageManager.PackageInfoFlags long flags, long firstInstallTime, long lastUpdateTime, Set<String> grantedPermissions, FrameworkPackageUserState state, int userId) { return generateWithComponents(pkg, gids, flags, firstInstallTime, lastUpdateTime, grantedPermissions, state, userId, null); Loading @@ -90,7 +90,7 @@ public class PackageInfoWithoutStateUtils { @Nullable private static PackageInfo generateWithComponents(ParsingPackageRead pkg, int[] gids, @PackageManager.PackageInfoFlags int flags, long firstInstallTime, long lastUpdateTime, @PackageManager.PackageInfoFlags long flags, long firstInstallTime, long lastUpdateTime, Set<String> grantedPermissions, FrameworkPackageUserState state, int userId, @Nullable ApexInfo apexInfo) { ApplicationInfo applicationInfo = generateApplicationInfo(pkg, flags, state, userId); Loading Loading @@ -190,7 +190,7 @@ public class PackageInfoWithoutStateUtils { @Nullable public static PackageInfo generateWithoutComponents(ParsingPackageRead pkg, int[] gids, @PackageManager.PackageInfoFlags int flags, long firstInstallTime, long lastUpdateTime, @PackageManager.PackageInfoFlags long flags, long firstInstallTime, long lastUpdateTime, Set<String> grantedPermissions, FrameworkPackageUserState state, int userId, @Nullable ApexInfo apexInfo, @NonNull ApplicationInfo applicationInfo) { if (!checkUseInstalled(pkg, state, flags)) { Loading @@ -210,9 +210,9 @@ public class PackageInfoWithoutStateUtils { */ @NonNull public static PackageInfo generateWithoutComponentsUnchecked(ParsingPackageRead pkg, int[] gids, @PackageManager.PackageInfoFlags int flags, long firstInstallTime, long lastUpdateTime, Set<String> grantedPermissions, FrameworkPackageUserState state, int userId, @Nullable ApexInfo apexInfo, @NonNull ApplicationInfo applicationInfo) { @PackageManager.PackageInfoFlags long flags, long firstInstallTime, long lastUpdateTime, Set<String> grantedPermissions, FrameworkPackageUserState state, int userId, @Nullable ApexInfo apexInfo, @NonNull ApplicationInfo applicationInfo) { PackageInfo pi = new PackageInfo(); pi.packageName = pkg.getPackageName(); pi.splitNames = pkg.getSplitNames(); Loading Loading @@ -365,7 +365,8 @@ public class PackageInfoWithoutStateUtils { @Nullable public static ApplicationInfo generateApplicationInfo(ParsingPackageRead pkg, @PackageManager.ApplicationInfoFlags int flags, FrameworkPackageUserState state, int userId) { @PackageManager.ApplicationInfoFlags long flags, FrameworkPackageUserState state, int userId) { if (pkg == null) { return null; } Loading @@ -392,8 +393,8 @@ public class PackageInfoWithoutStateUtils { */ @NonNull public static ApplicationInfo generateApplicationInfoUnchecked(@NonNull ParsingPackageRead pkg, @PackageManager.ApplicationInfoFlags int flags, @NonNull FrameworkPackageUserState state, int userId, boolean assignUserFields) { @PackageManager.ApplicationInfoFlags long flags, @NonNull FrameworkPackageUserState state, int userId, boolean assignUserFields) { // Make shallow copy so we can store the metadata/libraries safely ApplicationInfo ai = ((ParsingPackageHidden) pkg).toAppInfoWithoutState(); Loading @@ -406,7 +407,7 @@ public class PackageInfoWithoutStateUtils { return ai; } private static void updateApplicationInfo(ApplicationInfo ai, int flags, private static void updateApplicationInfo(ApplicationInfo ai, long flags, FrameworkPackageUserState state) { if ((flags & PackageManager.GET_META_DATA) == 0) { ai.metaData = null; Loading Loading @@ -452,8 +453,8 @@ public class PackageInfoWithoutStateUtils { @Nullable public static ApplicationInfo generateDelegateApplicationInfo(@Nullable ApplicationInfo ai, @PackageManager.ApplicationInfoFlags int flags, @NonNull FrameworkPackageUserState state, int userId) { @PackageManager.ApplicationInfoFlags long flags, @NonNull FrameworkPackageUserState state, int userId) { if (ai == null || !checkUseInstalledOrHidden(flags, state, ai)) { return null; } Loading @@ -469,7 +470,7 @@ public class PackageInfoWithoutStateUtils { @Nullable public static ActivityInfo generateDelegateActivityInfo(@Nullable ActivityInfo a, @PackageManager.ComponentInfoFlags int flags, @NonNull FrameworkPackageUserState state, @PackageManager.ComponentInfoFlags long flags, @NonNull FrameworkPackageUserState state, int userId) { if (a == null || !checkUseInstalledOrHidden(flags, state, a.applicationInfo)) { return null; Loading @@ -484,7 +485,7 @@ public class PackageInfoWithoutStateUtils { @Nullable public static ActivityInfo generateActivityInfo(ParsingPackageRead pkg, ParsedActivity a, @PackageManager.ComponentInfoFlags int flags, FrameworkPackageUserState state, @PackageManager.ComponentInfoFlags long flags, FrameworkPackageUserState state, @Nullable ApplicationInfo applicationInfo, int userId) { if (a == null) return null; if (!checkUseInstalled(pkg, state, flags)) { Loading @@ -504,12 +505,12 @@ public class PackageInfoWithoutStateUtils { * This bypasses critical checks that are necessary for usage with data passed outside of system * server. * <p> * Prefer {@link #generateActivityInfo(ParsingPackageRead, ParsedActivity, int, * Prefer {@link #generateActivityInfo(ParsingPackageRead, ParsedActivity, long, * FrameworkPackageUserState, ApplicationInfo, int)}. */ @NonNull public static ActivityInfo generateActivityInfoUnchecked(@NonNull ParsedActivity a, @PackageManager.ComponentInfoFlags int flags, @PackageManager.ComponentInfoFlags long flags, @NonNull ApplicationInfo applicationInfo) { // Make shallow copies so we can store the metadata safely ActivityInfo ai = new ActivityInfo(); Loading Loading @@ -550,13 +551,14 @@ public class PackageInfoWithoutStateUtils { @Nullable public static ActivityInfo generateActivityInfo(ParsingPackageRead pkg, ParsedActivity a, @PackageManager.ComponentInfoFlags int flags, FrameworkPackageUserState state, int userId) { @PackageManager.ComponentInfoFlags long flags, FrameworkPackageUserState state, int userId) { return generateActivityInfo(pkg, a, flags, state, null, userId); } @Nullable public static ServiceInfo generateServiceInfo(ParsingPackageRead pkg, ParsedService s, @PackageManager.ComponentInfoFlags int flags, FrameworkPackageUserState state, @PackageManager.ComponentInfoFlags long flags, FrameworkPackageUserState state, @Nullable ApplicationInfo applicationInfo, int userId) { if (s == null) return null; if (!checkUseInstalled(pkg, state, flags)) { Loading @@ -576,12 +578,12 @@ public class PackageInfoWithoutStateUtils { * This bypasses critical checks that are necessary for usage with data passed outside of system * server. * <p> * Prefer {@link #generateServiceInfo(ParsingPackageRead, ParsedService, int, FrameworkPackageUserState, * ApplicationInfo, int)}. * Prefer {@link #generateServiceInfo(ParsingPackageRead, ParsedService, long, * FrameworkPackageUserState, ApplicationInfo, int)}. */ @NonNull public static ServiceInfo generateServiceInfoUnchecked(@NonNull ParsedService s, @PackageManager.ComponentInfoFlags int flags, @PackageManager.ComponentInfoFlags long flags, @NonNull ApplicationInfo applicationInfo) { // Make shallow copies so we can store the metadata safely ServiceInfo si = new ServiceInfo(); Loading @@ -600,13 +602,14 @@ public class PackageInfoWithoutStateUtils { @Nullable public static ServiceInfo generateServiceInfo(ParsingPackageRead pkg, ParsedService s, @PackageManager.ComponentInfoFlags int flags, FrameworkPackageUserState state, int userId) { @PackageManager.ComponentInfoFlags long flags, FrameworkPackageUserState state, int userId) { return generateServiceInfo(pkg, s, flags, state, null, userId); } @Nullable public static ProviderInfo generateProviderInfo(ParsingPackageRead pkg, ParsedProvider p, @PackageManager.ComponentInfoFlags int flags, FrameworkPackageUserState state, @PackageManager.ComponentInfoFlags long flags, FrameworkPackageUserState state, @Nullable ApplicationInfo applicationInfo, int userId) { if (p == null) return null; if (!checkUseInstalled(pkg, state, flags)) { Loading @@ -626,12 +629,12 @@ public class PackageInfoWithoutStateUtils { * This bypasses critical checks that are necessary for usage with data passed outside of system * server. * <p> * Prefer {@link #generateProviderInfo(ParsingPackageRead, ParsedProvider, int, * Prefer {@link #generateProviderInfo(ParsingPackageRead, ParsedProvider, long, * FrameworkPackageUserState, ApplicationInfo, int)}. */ @NonNull public static ProviderInfo generateProviderInfoUnchecked(@NonNull ParsedProvider p, @PackageManager.ComponentInfoFlags int flags, @PackageManager.ComponentInfoFlags long flags, @NonNull ApplicationInfo applicationInfo) { // Make shallow copies so we can store the metadata safely ProviderInfo pi = new ProviderInfo(); Loading Loading @@ -661,17 +664,18 @@ public class PackageInfoWithoutStateUtils { @Nullable public static ProviderInfo generateProviderInfo(ParsingPackageRead pkg, ParsedProvider p, @PackageManager.ComponentInfoFlags int flags, FrameworkPackageUserState state, int userId) { @PackageManager.ComponentInfoFlags long flags, FrameworkPackageUserState state, int userId) { return generateProviderInfo(pkg, p, flags, state, null, userId); } /** * @param assignUserFields see {@link #generateApplicationInfoUnchecked(ParsingPackageRead, int, * FrameworkPackageUserState, int, boolean)} * @param assignUserFields see {@link #generateApplicationInfoUnchecked(ParsingPackageRead, * long, FrameworkPackageUserState, int, boolean)} */ @Nullable public static InstrumentationInfo generateInstrumentationInfo(ParsedInstrumentation i, ParsingPackageRead pkg, @PackageManager.ComponentInfoFlags int flags, int userId, ParsingPackageRead pkg, @PackageManager.ComponentInfoFlags long flags, int userId, boolean assignUserFields) { if (i == null) return null; Loading Loading @@ -702,7 +706,7 @@ public class PackageInfoWithoutStateUtils { @Nullable public static PermissionInfo generatePermissionInfo(ParsedPermission p, @PackageManager.ComponentInfoFlags int flags) { @PackageManager.ComponentInfoFlags long flags) { if (p == null) return null; PermissionInfo pi = new PermissionInfo(p.getBackgroundPermission()); Loading @@ -725,7 +729,7 @@ public class PackageInfoWithoutStateUtils { @Nullable public static PermissionGroupInfo generatePermissionGroupInfo(ParsedPermissionGroup pg, @PackageManager.ComponentInfoFlags int flags) { @PackageManager.ComponentInfoFlags long flags) { if (pg == null) return null; PermissionGroupInfo pgi = new PermissionGroupInfo( Loading Loading @@ -753,8 +757,8 @@ public class PackageInfoWithoutStateUtils { return new Attribution(pa.getTag(), pa.getLabel()); } private static boolean checkUseInstalledOrHidden(int flags, @NonNull FrameworkPackageUserState state, @Nullable ApplicationInfo appInfo) { private static boolean checkUseInstalledOrHidden(long flags, @NonNull FrameworkPackageUserState state, @Nullable ApplicationInfo appInfo) { // Returns false if the package is hidden system app until installed. if ((flags & PackageManager.MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS) == 0 && !state.isInstalled() Loading Loading @@ -882,8 +886,8 @@ public class PackageInfoWithoutStateUtils { return privateFlagsExt; } private static boolean checkUseInstalled(ParsingPackageRead pkg, FrameworkPackageUserState state, @PackageManager.PackageInfoFlags int flags) { private static boolean checkUseInstalled(ParsingPackageRead pkg, FrameworkPackageUserState state, @PackageManager.PackageInfoFlags long flags) { // If available for the target user return PackageUserStateUtils.isAvailable(state, flags); } Loading core/java/android/content/pm/parsing/component/ComponentParseUtils.java +2 −2 Original line number Diff line number Diff line Loading @@ -170,13 +170,13 @@ public class ComponentParseUtils { } public static boolean isMatch(FrameworkPackageUserState state, boolean isSystem, boolean isPackageEnabled, ParsedMainComponent component, int flags) { boolean isPackageEnabled, ParsedMainComponent component, long flags) { return PackageUserStateUtils.isMatch(state, isSystem, isPackageEnabled, component.isEnabled(), component.isDirectBootAware(), component.getName(), flags); } public static boolean isEnabled(FrameworkPackageUserState state, boolean isPackageEnabled, ParsedMainComponent parsedComponent, int flags) { ParsedMainComponent parsedComponent, long flags) { return PackageUserStateUtils.isEnabled(state, isPackageEnabled, parsedComponent.isEnabled(), parsedComponent.getName(), flags); } Loading core/java/android/content/pm/pkg/PackageUserStateUtils.java +11 −10 Original line number Diff line number Diff line Loading @@ -34,15 +34,15 @@ public class PackageUserStateUtils { private static final boolean DEBUG = false; private static final String TAG = "PackageUserStateUtils"; public static boolean isMatch(@NonNull FrameworkPackageUserState state, ComponentInfo componentInfo, int flags) { public static boolean isMatch(@NonNull FrameworkPackageUserState state, ComponentInfo componentInfo, long flags) { return isMatch(state, componentInfo.applicationInfo.isSystemApp(), componentInfo.applicationInfo.enabled, componentInfo.enabled, componentInfo.directBootAware, componentInfo.name, flags); } public static boolean isMatch(@NonNull FrameworkPackageUserState state, boolean isSystem, boolean isPackageEnabled, ParsedMainComponent component, int flags) { boolean isPackageEnabled, ParsedMainComponent component, long flags) { return isMatch(state, isSystem, isPackageEnabled, component.isEnabled(), component.isDirectBootAware(), component.getName(), flags); } Loading @@ -58,7 +58,7 @@ public class PackageUserStateUtils { */ public static boolean isMatch(@NonNull FrameworkPackageUserState state, boolean isSystem, boolean isPackageEnabled, boolean isComponentEnabled, boolean isComponentDirectBootAware, String componentName, int flags) { boolean isComponentDirectBootAware, String componentName, long flags) { final boolean matchUninstalled = (flags & PackageManager.MATCH_KNOWN_PACKAGES) != 0; if (!isAvailable(state, flags) && !(isSystem && matchUninstalled)) { return reportIfDebug(false, flags); Loading @@ -81,7 +81,7 @@ public class PackageUserStateUtils { return reportIfDebug(matchesUnaware || matchesAware, flags); } public static boolean isAvailable(@NonNull FrameworkPackageUserState state, int flags) { public static boolean isAvailable(@NonNull FrameworkPackageUserState state, long flags) { // True if it is installed for this user and it is not hidden. If it is hidden, // still return true if the caller requested MATCH_UNINSTALLED_PACKAGES final boolean matchAnyUser = (flags & PackageManager.MATCH_ANY_USER) != 0; Loading @@ -91,7 +91,7 @@ public class PackageUserStateUtils { && (!state.isHidden() || matchUninstalled)); } public static boolean reportIfDebug(boolean result, int flags) { public static boolean reportIfDebug(boolean result, long flags) { if (DEBUG && !result) { Slog.i(TAG, "No match!; flags: " + DebugUtils.flagsToString(PackageManager.class, "MATCH_", flags) + " " Loading @@ -101,13 +101,13 @@ public class PackageUserStateUtils { } public static boolean isEnabled(@NonNull FrameworkPackageUserState state, ComponentInfo componentInfo, int flags) { long flags) { return isEnabled(state, componentInfo.applicationInfo.enabled, componentInfo.enabled, componentInfo.name, flags); } public static boolean isEnabled(@NonNull FrameworkPackageUserState state, boolean isPackageEnabled, ParsedMainComponent parsedComponent, int flags) { ParsedMainComponent parsedComponent, long flags) { return isEnabled(state, isPackageEnabled, parsedComponent.isEnabled(), parsedComponent.getName(), flags); } Loading @@ -115,8 +115,9 @@ public class PackageUserStateUtils { /** * Test if the given component is considered enabled. */ public static boolean isEnabled(@NonNull FrameworkPackageUserState state, boolean isPackageEnabled, boolean isComponentEnabled, String componentName, int flags) { public static boolean isEnabled(@NonNull FrameworkPackageUserState state, boolean isPackageEnabled, boolean isComponentEnabled, String componentName, long flags) { if ((flags & MATCH_DISABLED_COMPONENTS) != 0) { return true; } Loading Loading
boot/hiddenapi/hiddenapi-unsupported.txt +0 −2 Original line number Diff line number Diff line Loading @@ -124,10 +124,8 @@ Landroid/content/pm/IPackageInstallObserver2$Stub;->asInterface(Landroid/os/IBin Landroid/content/pm/IPackageManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V Landroid/content/pm/IPackageManager$Stub$Proxy;->checkUidPermission(Ljava/lang/String;I)I Landroid/content/pm/IPackageManager$Stub$Proxy;->getAppOpPermissionPackages(Ljava/lang/String;)[Ljava/lang/String; Landroid/content/pm/IPackageManager$Stub$Proxy;->getInstalledPackages(II)Landroid/content/pm/ParceledListSlice; Landroid/content/pm/IPackageManager$Stub$Proxy;->getInstallLocation()I Landroid/content/pm/IPackageManager$Stub$Proxy;->getLastChosenActivity(Landroid/content/Intent;Ljava/lang/String;I)Landroid/content/pm/ResolveInfo; Landroid/content/pm/IPackageManager$Stub$Proxy;->getPackageInfo(Ljava/lang/String;II)Landroid/content/pm/PackageInfo; Landroid/content/pm/IPackageManager$Stub$Proxy;->getPackagesForUid(I)[Ljava/lang/String; Landroid/content/pm/IPackageManager$Stub$Proxy;->getSystemSharedLibraryNames()[Ljava/lang/String; Landroid/content/pm/IPackageManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageManager; Loading
core/java/android/content/pm/IPackageManager.aidl +24 −35 Original line number Diff line number Diff line Loading @@ -69,41 +69,34 @@ interface IPackageManager { void checkPackageStartable(String packageName, int userId); @UnsupportedAppUsage(trackingBug = 171933273) boolean isPackageAvailable(String packageName, int userId); @UnsupportedAppUsage PackageInfo getPackageInfo(String packageName, int flags, int userId); PackageInfo getPackageInfo(String packageName, long flags, int userId); PackageInfo getPackageInfoVersioned(in VersionedPackage versionedPackage, int flags, int userId); @UnsupportedAppUsage int getPackageUid(String packageName, int flags, int userId); int[] getPackageGids(String packageName, int flags, int userId); long flags, int userId); int getPackageUid(String packageName, long flags, int userId); int[] getPackageGids(String packageName, long flags, int userId); @UnsupportedAppUsage String[] currentToCanonicalPackageNames(in String[] names); @UnsupportedAppUsage String[] canonicalToCurrentPackageNames(in String[] names); @UnsupportedAppUsage ApplicationInfo getApplicationInfo(String packageName, int flags ,int userId); ApplicationInfo getApplicationInfo(String packageName, long flags, int userId); /** * @return the target SDK for the given package name, or -1 if it cannot be retrieved */ int getTargetSdkVersion(String packageName); @UnsupportedAppUsage ActivityInfo getActivityInfo(in ComponentName className, int flags, int userId); ActivityInfo getActivityInfo(in ComponentName className, long flags, int userId); boolean activitySupportsIntent(in ComponentName className, in Intent intent, String resolvedType); @UnsupportedAppUsage ActivityInfo getReceiverInfo(in ComponentName className, int flags, int userId); ActivityInfo getReceiverInfo(in ComponentName className, long flags, int userId); @UnsupportedAppUsage ServiceInfo getServiceInfo(in ComponentName className, int flags, int userId); ServiceInfo getServiceInfo(in ComponentName className, long flags, int userId); @UnsupportedAppUsage ProviderInfo getProviderInfo(in ComponentName className, int flags, int userId); ProviderInfo getProviderInfo(in ComponentName className, long flags, int userId); boolean isProtectedBroadcast(String actionName); Loading Loading @@ -133,33 +126,31 @@ interface IPackageManager { @UnsupportedAppUsage boolean isUidPrivileged(int uid); @UnsupportedAppUsage ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags, int userId); ResolveInfo resolveIntent(in Intent intent, String resolvedType, long flags, int userId); ResolveInfo findPersistentPreferredActivity(in Intent intent, int userId); boolean canForwardTo(in Intent intent, String resolvedType, int sourceUserId, int targetUserId); @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) ParceledListSlice queryIntentActivities(in Intent intent, String resolvedType, int flags, int userId); String resolvedType, long flags, int userId); ParceledListSlice queryIntentActivityOptions( in ComponentName caller, in Intent[] specifics, in String[] specificTypes, in Intent intent, String resolvedType, int flags, int userId); String resolvedType, long flags, int userId); ParceledListSlice queryIntentReceivers(in Intent intent, String resolvedType, int flags, int userId); String resolvedType, long flags, int userId); ResolveInfo resolveService(in Intent intent, String resolvedType, int flags, int userId); String resolvedType, long flags, int userId); ParceledListSlice queryIntentServices(in Intent intent, String resolvedType, int flags, int userId); String resolvedType, long flags, int userId); ParceledListSlice queryIntentContentProviders(in Intent intent, String resolvedType, int flags, int userId); String resolvedType, long flags, int userId); /** * This implements getInstalledPackages via a "last returned row" Loading @@ -167,8 +158,7 @@ interface IPackageManager { * limit that kicks in when flags are included that bloat up the data * returned. */ @UnsupportedAppUsage ParceledListSlice getInstalledPackages(int flags, in int userId); ParceledListSlice getInstalledPackages(long flags, in int userId); /** * This implements getPackagesHoldingPermissions via a "last returned row" Loading @@ -177,7 +167,7 @@ interface IPackageManager { * returned. */ ParceledListSlice getPackagesHoldingPermissions(in String[] permissions, int flags, int userId); long flags, int userId); /** * This implements getInstalledApplications via a "last returned row" Loading @@ -185,18 +175,17 @@ interface IPackageManager { * limit that kicks in when flags are included that bloat up the data * returned. */ @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) ParceledListSlice getInstalledApplications(int flags, int userId); ParceledListSlice getInstalledApplications(long flags, int userId); /** * Retrieve all applications that are marked as persistent. * * @return A List<applicationInfo> containing one entry for each persistent * @return A List<ApplicationInfo> containing one entry for each persistent * application. */ ParceledListSlice getPersistentApplications(int flags); ProviderInfo resolveContentProvider(String name, int flags, int userId); ProviderInfo resolveContentProvider(String name, long flags, int userId); /** * Retrieve sync information for all content providers. Loading @@ -211,7 +200,7 @@ interface IPackageManager { inout List<ProviderInfo> outInfo); ParceledListSlice queryContentProviders( String processName, int uid, int flags, String metaDataKey); String processName, int uid, long flags, String metaDataKey); @UnsupportedAppUsage InstrumentationInfo getInstrumentationInfo( Loading Loading @@ -690,9 +679,9 @@ interface IPackageManager { int getInstallReason(String packageName, int userId); ParceledListSlice getSharedLibraries(in String packageName, int flags, int userId); ParceledListSlice getSharedLibraries(in String packageName, long flags, int userId); ParceledListSlice getDeclaredSharedLibraries(in String packageName, int flags, int userId); ParceledListSlice getDeclaredSharedLibraries(in String packageName, long flags, int userId); boolean canRequestPackageInstalls(String packageName, int userId); Loading
core/java/android/content/pm/parsing/PackageInfoWithoutStateUtils.java +39 −35 Original line number Diff line number Diff line Loading @@ -76,7 +76,7 @@ public class PackageInfoWithoutStateUtils { @Nullable public static PackageInfo generate(ParsingPackageRead pkg, int[] gids, @PackageManager.PackageInfoFlags int flags, long firstInstallTime, long lastUpdateTime, @PackageManager.PackageInfoFlags long flags, long firstInstallTime, long lastUpdateTime, Set<String> grantedPermissions, FrameworkPackageUserState state, int userId) { return generateWithComponents(pkg, gids, flags, firstInstallTime, lastUpdateTime, grantedPermissions, state, userId, null); Loading @@ -90,7 +90,7 @@ public class PackageInfoWithoutStateUtils { @Nullable private static PackageInfo generateWithComponents(ParsingPackageRead pkg, int[] gids, @PackageManager.PackageInfoFlags int flags, long firstInstallTime, long lastUpdateTime, @PackageManager.PackageInfoFlags long flags, long firstInstallTime, long lastUpdateTime, Set<String> grantedPermissions, FrameworkPackageUserState state, int userId, @Nullable ApexInfo apexInfo) { ApplicationInfo applicationInfo = generateApplicationInfo(pkg, flags, state, userId); Loading Loading @@ -190,7 +190,7 @@ public class PackageInfoWithoutStateUtils { @Nullable public static PackageInfo generateWithoutComponents(ParsingPackageRead pkg, int[] gids, @PackageManager.PackageInfoFlags int flags, long firstInstallTime, long lastUpdateTime, @PackageManager.PackageInfoFlags long flags, long firstInstallTime, long lastUpdateTime, Set<String> grantedPermissions, FrameworkPackageUserState state, int userId, @Nullable ApexInfo apexInfo, @NonNull ApplicationInfo applicationInfo) { if (!checkUseInstalled(pkg, state, flags)) { Loading @@ -210,9 +210,9 @@ public class PackageInfoWithoutStateUtils { */ @NonNull public static PackageInfo generateWithoutComponentsUnchecked(ParsingPackageRead pkg, int[] gids, @PackageManager.PackageInfoFlags int flags, long firstInstallTime, long lastUpdateTime, Set<String> grantedPermissions, FrameworkPackageUserState state, int userId, @Nullable ApexInfo apexInfo, @NonNull ApplicationInfo applicationInfo) { @PackageManager.PackageInfoFlags long flags, long firstInstallTime, long lastUpdateTime, Set<String> grantedPermissions, FrameworkPackageUserState state, int userId, @Nullable ApexInfo apexInfo, @NonNull ApplicationInfo applicationInfo) { PackageInfo pi = new PackageInfo(); pi.packageName = pkg.getPackageName(); pi.splitNames = pkg.getSplitNames(); Loading Loading @@ -365,7 +365,8 @@ public class PackageInfoWithoutStateUtils { @Nullable public static ApplicationInfo generateApplicationInfo(ParsingPackageRead pkg, @PackageManager.ApplicationInfoFlags int flags, FrameworkPackageUserState state, int userId) { @PackageManager.ApplicationInfoFlags long flags, FrameworkPackageUserState state, int userId) { if (pkg == null) { return null; } Loading @@ -392,8 +393,8 @@ public class PackageInfoWithoutStateUtils { */ @NonNull public static ApplicationInfo generateApplicationInfoUnchecked(@NonNull ParsingPackageRead pkg, @PackageManager.ApplicationInfoFlags int flags, @NonNull FrameworkPackageUserState state, int userId, boolean assignUserFields) { @PackageManager.ApplicationInfoFlags long flags, @NonNull FrameworkPackageUserState state, int userId, boolean assignUserFields) { // Make shallow copy so we can store the metadata/libraries safely ApplicationInfo ai = ((ParsingPackageHidden) pkg).toAppInfoWithoutState(); Loading @@ -406,7 +407,7 @@ public class PackageInfoWithoutStateUtils { return ai; } private static void updateApplicationInfo(ApplicationInfo ai, int flags, private static void updateApplicationInfo(ApplicationInfo ai, long flags, FrameworkPackageUserState state) { if ((flags & PackageManager.GET_META_DATA) == 0) { ai.metaData = null; Loading Loading @@ -452,8 +453,8 @@ public class PackageInfoWithoutStateUtils { @Nullable public static ApplicationInfo generateDelegateApplicationInfo(@Nullable ApplicationInfo ai, @PackageManager.ApplicationInfoFlags int flags, @NonNull FrameworkPackageUserState state, int userId) { @PackageManager.ApplicationInfoFlags long flags, @NonNull FrameworkPackageUserState state, int userId) { if (ai == null || !checkUseInstalledOrHidden(flags, state, ai)) { return null; } Loading @@ -469,7 +470,7 @@ public class PackageInfoWithoutStateUtils { @Nullable public static ActivityInfo generateDelegateActivityInfo(@Nullable ActivityInfo a, @PackageManager.ComponentInfoFlags int flags, @NonNull FrameworkPackageUserState state, @PackageManager.ComponentInfoFlags long flags, @NonNull FrameworkPackageUserState state, int userId) { if (a == null || !checkUseInstalledOrHidden(flags, state, a.applicationInfo)) { return null; Loading @@ -484,7 +485,7 @@ public class PackageInfoWithoutStateUtils { @Nullable public static ActivityInfo generateActivityInfo(ParsingPackageRead pkg, ParsedActivity a, @PackageManager.ComponentInfoFlags int flags, FrameworkPackageUserState state, @PackageManager.ComponentInfoFlags long flags, FrameworkPackageUserState state, @Nullable ApplicationInfo applicationInfo, int userId) { if (a == null) return null; if (!checkUseInstalled(pkg, state, flags)) { Loading @@ -504,12 +505,12 @@ public class PackageInfoWithoutStateUtils { * This bypasses critical checks that are necessary for usage with data passed outside of system * server. * <p> * Prefer {@link #generateActivityInfo(ParsingPackageRead, ParsedActivity, int, * Prefer {@link #generateActivityInfo(ParsingPackageRead, ParsedActivity, long, * FrameworkPackageUserState, ApplicationInfo, int)}. */ @NonNull public static ActivityInfo generateActivityInfoUnchecked(@NonNull ParsedActivity a, @PackageManager.ComponentInfoFlags int flags, @PackageManager.ComponentInfoFlags long flags, @NonNull ApplicationInfo applicationInfo) { // Make shallow copies so we can store the metadata safely ActivityInfo ai = new ActivityInfo(); Loading Loading @@ -550,13 +551,14 @@ public class PackageInfoWithoutStateUtils { @Nullable public static ActivityInfo generateActivityInfo(ParsingPackageRead pkg, ParsedActivity a, @PackageManager.ComponentInfoFlags int flags, FrameworkPackageUserState state, int userId) { @PackageManager.ComponentInfoFlags long flags, FrameworkPackageUserState state, int userId) { return generateActivityInfo(pkg, a, flags, state, null, userId); } @Nullable public static ServiceInfo generateServiceInfo(ParsingPackageRead pkg, ParsedService s, @PackageManager.ComponentInfoFlags int flags, FrameworkPackageUserState state, @PackageManager.ComponentInfoFlags long flags, FrameworkPackageUserState state, @Nullable ApplicationInfo applicationInfo, int userId) { if (s == null) return null; if (!checkUseInstalled(pkg, state, flags)) { Loading @@ -576,12 +578,12 @@ public class PackageInfoWithoutStateUtils { * This bypasses critical checks that are necessary for usage with data passed outside of system * server. * <p> * Prefer {@link #generateServiceInfo(ParsingPackageRead, ParsedService, int, FrameworkPackageUserState, * ApplicationInfo, int)}. * Prefer {@link #generateServiceInfo(ParsingPackageRead, ParsedService, long, * FrameworkPackageUserState, ApplicationInfo, int)}. */ @NonNull public static ServiceInfo generateServiceInfoUnchecked(@NonNull ParsedService s, @PackageManager.ComponentInfoFlags int flags, @PackageManager.ComponentInfoFlags long flags, @NonNull ApplicationInfo applicationInfo) { // Make shallow copies so we can store the metadata safely ServiceInfo si = new ServiceInfo(); Loading @@ -600,13 +602,14 @@ public class PackageInfoWithoutStateUtils { @Nullable public static ServiceInfo generateServiceInfo(ParsingPackageRead pkg, ParsedService s, @PackageManager.ComponentInfoFlags int flags, FrameworkPackageUserState state, int userId) { @PackageManager.ComponentInfoFlags long flags, FrameworkPackageUserState state, int userId) { return generateServiceInfo(pkg, s, flags, state, null, userId); } @Nullable public static ProviderInfo generateProviderInfo(ParsingPackageRead pkg, ParsedProvider p, @PackageManager.ComponentInfoFlags int flags, FrameworkPackageUserState state, @PackageManager.ComponentInfoFlags long flags, FrameworkPackageUserState state, @Nullable ApplicationInfo applicationInfo, int userId) { if (p == null) return null; if (!checkUseInstalled(pkg, state, flags)) { Loading @@ -626,12 +629,12 @@ public class PackageInfoWithoutStateUtils { * This bypasses critical checks that are necessary for usage with data passed outside of system * server. * <p> * Prefer {@link #generateProviderInfo(ParsingPackageRead, ParsedProvider, int, * Prefer {@link #generateProviderInfo(ParsingPackageRead, ParsedProvider, long, * FrameworkPackageUserState, ApplicationInfo, int)}. */ @NonNull public static ProviderInfo generateProviderInfoUnchecked(@NonNull ParsedProvider p, @PackageManager.ComponentInfoFlags int flags, @PackageManager.ComponentInfoFlags long flags, @NonNull ApplicationInfo applicationInfo) { // Make shallow copies so we can store the metadata safely ProviderInfo pi = new ProviderInfo(); Loading Loading @@ -661,17 +664,18 @@ public class PackageInfoWithoutStateUtils { @Nullable public static ProviderInfo generateProviderInfo(ParsingPackageRead pkg, ParsedProvider p, @PackageManager.ComponentInfoFlags int flags, FrameworkPackageUserState state, int userId) { @PackageManager.ComponentInfoFlags long flags, FrameworkPackageUserState state, int userId) { return generateProviderInfo(pkg, p, flags, state, null, userId); } /** * @param assignUserFields see {@link #generateApplicationInfoUnchecked(ParsingPackageRead, int, * FrameworkPackageUserState, int, boolean)} * @param assignUserFields see {@link #generateApplicationInfoUnchecked(ParsingPackageRead, * long, FrameworkPackageUserState, int, boolean)} */ @Nullable public static InstrumentationInfo generateInstrumentationInfo(ParsedInstrumentation i, ParsingPackageRead pkg, @PackageManager.ComponentInfoFlags int flags, int userId, ParsingPackageRead pkg, @PackageManager.ComponentInfoFlags long flags, int userId, boolean assignUserFields) { if (i == null) return null; Loading Loading @@ -702,7 +706,7 @@ public class PackageInfoWithoutStateUtils { @Nullable public static PermissionInfo generatePermissionInfo(ParsedPermission p, @PackageManager.ComponentInfoFlags int flags) { @PackageManager.ComponentInfoFlags long flags) { if (p == null) return null; PermissionInfo pi = new PermissionInfo(p.getBackgroundPermission()); Loading @@ -725,7 +729,7 @@ public class PackageInfoWithoutStateUtils { @Nullable public static PermissionGroupInfo generatePermissionGroupInfo(ParsedPermissionGroup pg, @PackageManager.ComponentInfoFlags int flags) { @PackageManager.ComponentInfoFlags long flags) { if (pg == null) return null; PermissionGroupInfo pgi = new PermissionGroupInfo( Loading Loading @@ -753,8 +757,8 @@ public class PackageInfoWithoutStateUtils { return new Attribution(pa.getTag(), pa.getLabel()); } private static boolean checkUseInstalledOrHidden(int flags, @NonNull FrameworkPackageUserState state, @Nullable ApplicationInfo appInfo) { private static boolean checkUseInstalledOrHidden(long flags, @NonNull FrameworkPackageUserState state, @Nullable ApplicationInfo appInfo) { // Returns false if the package is hidden system app until installed. if ((flags & PackageManager.MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS) == 0 && !state.isInstalled() Loading Loading @@ -882,8 +886,8 @@ public class PackageInfoWithoutStateUtils { return privateFlagsExt; } private static boolean checkUseInstalled(ParsingPackageRead pkg, FrameworkPackageUserState state, @PackageManager.PackageInfoFlags int flags) { private static boolean checkUseInstalled(ParsingPackageRead pkg, FrameworkPackageUserState state, @PackageManager.PackageInfoFlags long flags) { // If available for the target user return PackageUserStateUtils.isAvailable(state, flags); } Loading
core/java/android/content/pm/parsing/component/ComponentParseUtils.java +2 −2 Original line number Diff line number Diff line Loading @@ -170,13 +170,13 @@ public class ComponentParseUtils { } public static boolean isMatch(FrameworkPackageUserState state, boolean isSystem, boolean isPackageEnabled, ParsedMainComponent component, int flags) { boolean isPackageEnabled, ParsedMainComponent component, long flags) { return PackageUserStateUtils.isMatch(state, isSystem, isPackageEnabled, component.isEnabled(), component.isDirectBootAware(), component.getName(), flags); } public static boolean isEnabled(FrameworkPackageUserState state, boolean isPackageEnabled, ParsedMainComponent parsedComponent, int flags) { ParsedMainComponent parsedComponent, long flags) { return PackageUserStateUtils.isEnabled(state, isPackageEnabled, parsedComponent.isEnabled(), parsedComponent.getName(), flags); } Loading
core/java/android/content/pm/pkg/PackageUserStateUtils.java +11 −10 Original line number Diff line number Diff line Loading @@ -34,15 +34,15 @@ public class PackageUserStateUtils { private static final boolean DEBUG = false; private static final String TAG = "PackageUserStateUtils"; public static boolean isMatch(@NonNull FrameworkPackageUserState state, ComponentInfo componentInfo, int flags) { public static boolean isMatch(@NonNull FrameworkPackageUserState state, ComponentInfo componentInfo, long flags) { return isMatch(state, componentInfo.applicationInfo.isSystemApp(), componentInfo.applicationInfo.enabled, componentInfo.enabled, componentInfo.directBootAware, componentInfo.name, flags); } public static boolean isMatch(@NonNull FrameworkPackageUserState state, boolean isSystem, boolean isPackageEnabled, ParsedMainComponent component, int flags) { boolean isPackageEnabled, ParsedMainComponent component, long flags) { return isMatch(state, isSystem, isPackageEnabled, component.isEnabled(), component.isDirectBootAware(), component.getName(), flags); } Loading @@ -58,7 +58,7 @@ public class PackageUserStateUtils { */ public static boolean isMatch(@NonNull FrameworkPackageUserState state, boolean isSystem, boolean isPackageEnabled, boolean isComponentEnabled, boolean isComponentDirectBootAware, String componentName, int flags) { boolean isComponentDirectBootAware, String componentName, long flags) { final boolean matchUninstalled = (flags & PackageManager.MATCH_KNOWN_PACKAGES) != 0; if (!isAvailable(state, flags) && !(isSystem && matchUninstalled)) { return reportIfDebug(false, flags); Loading @@ -81,7 +81,7 @@ public class PackageUserStateUtils { return reportIfDebug(matchesUnaware || matchesAware, flags); } public static boolean isAvailable(@NonNull FrameworkPackageUserState state, int flags) { public static boolean isAvailable(@NonNull FrameworkPackageUserState state, long flags) { // True if it is installed for this user and it is not hidden. If it is hidden, // still return true if the caller requested MATCH_UNINSTALLED_PACKAGES final boolean matchAnyUser = (flags & PackageManager.MATCH_ANY_USER) != 0; Loading @@ -91,7 +91,7 @@ public class PackageUserStateUtils { && (!state.isHidden() || matchUninstalled)); } public static boolean reportIfDebug(boolean result, int flags) { public static boolean reportIfDebug(boolean result, long flags) { if (DEBUG && !result) { Slog.i(TAG, "No match!; flags: " + DebugUtils.flagsToString(PackageManager.class, "MATCH_", flags) + " " Loading @@ -101,13 +101,13 @@ public class PackageUserStateUtils { } public static boolean isEnabled(@NonNull FrameworkPackageUserState state, ComponentInfo componentInfo, int flags) { long flags) { return isEnabled(state, componentInfo.applicationInfo.enabled, componentInfo.enabled, componentInfo.name, flags); } public static boolean isEnabled(@NonNull FrameworkPackageUserState state, boolean isPackageEnabled, ParsedMainComponent parsedComponent, int flags) { ParsedMainComponent parsedComponent, long flags) { return isEnabled(state, isPackageEnabled, parsedComponent.isEnabled(), parsedComponent.getName(), flags); } Loading @@ -115,8 +115,9 @@ public class PackageUserStateUtils { /** * Test if the given component is considered enabled. */ public static boolean isEnabled(@NonNull FrameworkPackageUserState state, boolean isPackageEnabled, boolean isComponentEnabled, String componentName, int flags) { public static boolean isEnabled(@NonNull FrameworkPackageUserState state, boolean isPackageEnabled, boolean isComponentEnabled, String componentName, long flags) { if ((flags & MATCH_DISABLED_COMPONENTS) != 0) { return true; } Loading