Loading services/core/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,7 @@ java_library_static { "service-permission.stubs.system_server", "service-sdksandbox.stubs.system_server", ], plugins: ["ImmutabilityAnnotationProcessor"], required: [ "default_television.xml", Loading Loading @@ -172,6 +173,7 @@ java_library_static { "overlayable_policy_aidl-java", "SurfaceFlingerProperties", "com.android.sysprop.watchdog", "ImmutabilityAnnotation", ], javac_shard_size: 50, } Loading services/core/java/com/android/server/pm/pkg/AndroidPackage.java +34 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.content.pm.ProviderInfo; import android.content.pm.ServiceInfo; import android.content.pm.SigningDetails; import android.os.Bundle; import android.processor.immutability.Immutable; import android.util.ArraySet; import android.util.Pair; import android.util.SparseArray; Loading Loading @@ -65,6 +66,7 @@ import java.util.Set; * @hide */ //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER) @Immutable public interface AndroidPackage { /** Loading @@ -86,6 +88,7 @@ public interface AndroidPackage { * @see ActivityInfo * @see PackageInfo#activities */ @Immutable.Ignore @NonNull List<ParsedActivity> getActivities(); Loading @@ -101,6 +104,7 @@ public interface AndroidPackage { /** * @see R.styleable#AndroidManifestApexSystemService */ @Immutable.Ignore @NonNull List<ParsedApexSystemService> getApexSystemServices(); Loading @@ -111,6 +115,7 @@ public interface AndroidPackage { @Nullable String getAppComponentFactory(); @Immutable.Ignore @NonNull List<ParsedAttribution> getAttributions(); Loading Loading @@ -189,6 +194,7 @@ public interface AndroidPackage { * @see PackageInfo#configPreferences * @see R.styleable#AndroidManifestUsesConfiguration */ @Immutable.Ignore @NonNull List<ConfigurationInfo> getConfigPreferences(); Loading @@ -208,6 +214,7 @@ public interface AndroidPackage { * @see PackageInfo#featureGroups * @see R.styleable#AndroidManifestUsesFeature */ @Immutable.Ignore @NonNull List<FeatureGroupInfo> getFeatureGroups(); Loading Loading @@ -247,6 +254,7 @@ public interface AndroidPackage { * @see InstrumentationInfo * @see PackageInfo#instrumentation */ @Immutable.Ignore @NonNull List<ParsedInstrumentation> getInstrumentations(); Loading @@ -257,6 +265,7 @@ public interface AndroidPackage { * @see R.styleable#AndroidManifestKeySet * @see R.styleable#AndroidManifestPublicKey */ @Immutable.Ignore @NonNull Map<String, ArraySet<PublicKey>> getKeySetMapping(); Loading Loading @@ -341,6 +350,7 @@ public interface AndroidPackage { /** * TODO(b/135203078): Make all the Bundles immutable (and non-null by shared empty reference?) */ @Immutable.Ignore @Nullable Bundle getMetaData(); Loading @@ -356,6 +366,7 @@ public interface AndroidPackage { /** * @see R.styleable#AndroidManifestExtensionSdk */ @Immutable.Ignore @Nullable SparseIntArray getMinExtensionVersions(); Loading Loading @@ -464,6 +475,7 @@ public interface AndroidPackage { /** * @see android.content.pm.PermissionGroupInfo */ @Immutable.Ignore @NonNull List<ParsedPermissionGroup> getPermissionGroups(); Loading @@ -471,6 +483,7 @@ public interface AndroidPackage { * @see PermissionInfo * @see PackageInfo#permissions */ @Immutable.Ignore @NonNull List<ParsedPermission> getPermissions(); Loading @@ -480,6 +493,7 @@ public interface AndroidPackage { * Map of component className to intent info inside that component. TODO(b/135203078): Is this * actually used/working? */ @Immutable.Ignore @NonNull List<Pair<String, ParsedIntentInfo>> getPreferredActivityFilters(); Loading @@ -493,12 +507,14 @@ public interface AndroidPackage { /** * @see android.content.pm.ProcessInfo */ @Immutable.Ignore @NonNull Map<String, ParsedProcess> getProcesses(); /** * Returns the properties set on the application */ @Immutable.Ignore @NonNull Map<String, PackageManager.Property> getProperties(); Loading @@ -522,6 +538,7 @@ public interface AndroidPackage { * @see ProviderInfo * @see PackageInfo#providers */ @Immutable.Ignore @NonNull List<ParsedProvider> getProviders(); Loading @@ -530,6 +547,7 @@ public interface AndroidPackage { * * @see R.styleable#AndroidManifestQueriesIntent */ @Immutable.Ignore @NonNull List<Intent> getQueriesIntents(); Loading Loading @@ -566,6 +584,7 @@ public interface AndroidPackage { * @see ActivityInfo * @see PackageInfo#receivers */ @Immutable.Ignore @NonNull List<ParsedActivity> getReceivers(); Loading @@ -573,6 +592,7 @@ public interface AndroidPackage { * @see PackageInfo#reqFeatures * @see R.styleable#AndroidManifestUsesFeature */ @Immutable.Ignore @NonNull List<FeatureInfo> getRequestedFeatures(); Loading Loading @@ -615,6 +635,7 @@ public interface AndroidPackage { * * @see R.styleable#AndroidManifestRestrictUpdate */ @Immutable.Ignore @Nullable byte[] getRestrictUpdateHash(); Loading Loading @@ -662,6 +683,7 @@ public interface AndroidPackage { * @see ServiceInfo * @see PackageInfo#services */ @Immutable.Ignore @NonNull List<ParsedService> getServices(); Loading @@ -682,6 +704,7 @@ public interface AndroidPackage { * The signature data of all APKs in this package, which must be exactly the same across the * base and splits. */ @Immutable.Ignore @NonNull SigningDetails getSigningDetails(); Loading @@ -689,6 +712,7 @@ public interface AndroidPackage { * @see ApplicationInfo#splitClassLoaderNames * @see R.styleable#AndroidManifestApplication_classLoader */ @Immutable.Ignore @Nullable String[] getSplitClassLoaderNames(); Loading @@ -696,18 +720,21 @@ public interface AndroidPackage { * @see ApplicationInfo#splitSourceDirs * @see ApplicationInfo#getSplitCodePaths */ @Immutable.Ignore @NonNull String[] getSplitCodePaths(); /** * @see ApplicationInfo#splitDependencies */ @Immutable.Ignore @NonNull SparseArray<int[]> getSplitDependencies(); /** * Flags of any split APKs; ordered by parsed splitName */ @Immutable.Ignore @Nullable int[] getSplitFlags(); Loading @@ -717,12 +744,14 @@ public interface AndroidPackage { * @see ApplicationInfo#splitNames * @see PackageInfo#splitNames */ @Immutable.Ignore @NonNull String[] getSplitNames(); /** * @see PackageInfo#splitRevisionCodes */ @Immutable.Ignore @NonNull int[] getSplitRevisionCodes(); Loading Loading @@ -818,6 +847,7 @@ public interface AndroidPackage { @NonNull List<String> getUsesOptionalNativeLibraries(); @Immutable.Ignore @NonNull List<ParsedUsesPermission> getUsesPermissions(); Loading @@ -832,12 +862,14 @@ public interface AndroidPackage { /** * @see R.styleable#AndroidManifestUsesSdkLibrary_certDigest */ @Immutable.Ignore @Nullable String[][] getUsesSdkLibrariesCertDigests(); /** * @see R.styleable#AndroidManifestUsesSdkLibrary_versionMajor */ @Immutable.Ignore @Nullable long[] getUsesSdkLibrariesVersionsMajor(); Loading @@ -852,12 +884,14 @@ public interface AndroidPackage { /** * @see R.styleable#AndroidManifestUsesStaticLibrary_certDigest */ @Immutable.Ignore @Nullable String[][] getUsesStaticLibrariesCertDigests(); /** * @see R.styleable#AndroidManifestUsesStaticLibrary_version */ @Immutable.Ignore @Nullable long[] getUsesStaticLibrariesVersions(); Loading services/core/java/com/android/server/pm/pkg/PackageState.java +10 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.SharedLibraryInfo; import android.content.pm.SigningInfo; import android.processor.immutability.Immutable; import android.util.SparseArray; import com.android.server.pm.PackageSetting; Loading Loading @@ -55,6 +56,7 @@ import java.util.Set; * @hide */ //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER) @Immutable public interface PackageState { /** Loading Loading @@ -109,6 +111,7 @@ public interface PackageState { * Keys are indexes into the array represented by {@link PackageManager.NotifyReason}, values * are in epoch milliseconds. */ @Immutable.Ignore @Size(PackageManager.NOTIFY_PACKAGE_USE_REASONS_COUNT) @NonNull long[] getLastPackageUsageTime(); Loading Loading @@ -172,9 +175,11 @@ public interface PackageState { */ int getSharedUserAppId(); @Immutable.Ignore @NonNull SigningInfo getSigningInfo(); @Immutable.Ignore @NonNull SparseArray<? extends PackageUserState> getUserStates(); Loading @@ -199,30 +204,35 @@ public interface PackageState { /** * @see R.styleable#AndroidManifestUsesLibrary */ @Immutable.Ignore @NonNull List<SharedLibraryInfo> getUsesLibraryInfos(); /** * @see R.styleable#AndroidManifestUsesSdkLibrary */ @Immutable.Ignore @NonNull String[] getUsesSdkLibraries(); /** * @see R.styleable#AndroidManifestUsesSdkLibrary_versionMajor */ @Immutable.Ignore @NonNull long[] getUsesSdkLibrariesVersionsMajor(); /** * @see R.styleable#AndroidManifestUsesStaticLibrary */ @Immutable.Ignore @NonNull String[] getUsesStaticLibraries(); /** * @see R.styleable#AndroidManifestUsesStaticLibrary_version */ @Immutable.Ignore @NonNull long[] getUsesStaticLibrariesVersions(); Loading services/core/java/com/android/server/pm/pkg/PackageUserState.java +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.content.pm.PackageManager; import android.content.pm.overlay.OverlayPaths; import android.os.UserHandle; import android.processor.immutability.Immutable; import android.util.ArraySet; import java.util.Map; Loading @@ -35,6 +36,7 @@ import java.util.Map; */ // TODO(b/173807334): Expose API //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER) @Immutable.Ignore(reason = "Exposed through PackageState pending refactor") public interface PackageUserState { /** @hide */ Loading services/core/java/com/android/server/pm/pkg/component/ParsedProvider.java +3 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.content.pm.PathPermission; import android.os.PatternMatcher; import android.processor.immutability.Immutable; import java.util.List; Loading @@ -34,12 +35,14 @@ public interface ParsedProvider extends ParsedMainComponent { boolean isMultiProcess(); @Immutable.Ignore @NonNull List<PathPermission> getPathPermissions(); @Nullable String getReadPermission(); @Immutable.Ignore @NonNull List<PatternMatcher> getUriPermissionPatterns(); Loading Loading
services/core/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,7 @@ java_library_static { "service-permission.stubs.system_server", "service-sdksandbox.stubs.system_server", ], plugins: ["ImmutabilityAnnotationProcessor"], required: [ "default_television.xml", Loading Loading @@ -172,6 +173,7 @@ java_library_static { "overlayable_policy_aidl-java", "SurfaceFlingerProperties", "com.android.sysprop.watchdog", "ImmutabilityAnnotation", ], javac_shard_size: 50, } Loading
services/core/java/com/android/server/pm/pkg/AndroidPackage.java +34 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.content.pm.ProviderInfo; import android.content.pm.ServiceInfo; import android.content.pm.SigningDetails; import android.os.Bundle; import android.processor.immutability.Immutable; import android.util.ArraySet; import android.util.Pair; import android.util.SparseArray; Loading Loading @@ -65,6 +66,7 @@ import java.util.Set; * @hide */ //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER) @Immutable public interface AndroidPackage { /** Loading @@ -86,6 +88,7 @@ public interface AndroidPackage { * @see ActivityInfo * @see PackageInfo#activities */ @Immutable.Ignore @NonNull List<ParsedActivity> getActivities(); Loading @@ -101,6 +104,7 @@ public interface AndroidPackage { /** * @see R.styleable#AndroidManifestApexSystemService */ @Immutable.Ignore @NonNull List<ParsedApexSystemService> getApexSystemServices(); Loading @@ -111,6 +115,7 @@ public interface AndroidPackage { @Nullable String getAppComponentFactory(); @Immutable.Ignore @NonNull List<ParsedAttribution> getAttributions(); Loading Loading @@ -189,6 +194,7 @@ public interface AndroidPackage { * @see PackageInfo#configPreferences * @see R.styleable#AndroidManifestUsesConfiguration */ @Immutable.Ignore @NonNull List<ConfigurationInfo> getConfigPreferences(); Loading @@ -208,6 +214,7 @@ public interface AndroidPackage { * @see PackageInfo#featureGroups * @see R.styleable#AndroidManifestUsesFeature */ @Immutable.Ignore @NonNull List<FeatureGroupInfo> getFeatureGroups(); Loading Loading @@ -247,6 +254,7 @@ public interface AndroidPackage { * @see InstrumentationInfo * @see PackageInfo#instrumentation */ @Immutable.Ignore @NonNull List<ParsedInstrumentation> getInstrumentations(); Loading @@ -257,6 +265,7 @@ public interface AndroidPackage { * @see R.styleable#AndroidManifestKeySet * @see R.styleable#AndroidManifestPublicKey */ @Immutable.Ignore @NonNull Map<String, ArraySet<PublicKey>> getKeySetMapping(); Loading Loading @@ -341,6 +350,7 @@ public interface AndroidPackage { /** * TODO(b/135203078): Make all the Bundles immutable (and non-null by shared empty reference?) */ @Immutable.Ignore @Nullable Bundle getMetaData(); Loading @@ -356,6 +366,7 @@ public interface AndroidPackage { /** * @see R.styleable#AndroidManifestExtensionSdk */ @Immutable.Ignore @Nullable SparseIntArray getMinExtensionVersions(); Loading Loading @@ -464,6 +475,7 @@ public interface AndroidPackage { /** * @see android.content.pm.PermissionGroupInfo */ @Immutable.Ignore @NonNull List<ParsedPermissionGroup> getPermissionGroups(); Loading @@ -471,6 +483,7 @@ public interface AndroidPackage { * @see PermissionInfo * @see PackageInfo#permissions */ @Immutable.Ignore @NonNull List<ParsedPermission> getPermissions(); Loading @@ -480,6 +493,7 @@ public interface AndroidPackage { * Map of component className to intent info inside that component. TODO(b/135203078): Is this * actually used/working? */ @Immutable.Ignore @NonNull List<Pair<String, ParsedIntentInfo>> getPreferredActivityFilters(); Loading @@ -493,12 +507,14 @@ public interface AndroidPackage { /** * @see android.content.pm.ProcessInfo */ @Immutable.Ignore @NonNull Map<String, ParsedProcess> getProcesses(); /** * Returns the properties set on the application */ @Immutable.Ignore @NonNull Map<String, PackageManager.Property> getProperties(); Loading @@ -522,6 +538,7 @@ public interface AndroidPackage { * @see ProviderInfo * @see PackageInfo#providers */ @Immutable.Ignore @NonNull List<ParsedProvider> getProviders(); Loading @@ -530,6 +547,7 @@ public interface AndroidPackage { * * @see R.styleable#AndroidManifestQueriesIntent */ @Immutable.Ignore @NonNull List<Intent> getQueriesIntents(); Loading Loading @@ -566,6 +584,7 @@ public interface AndroidPackage { * @see ActivityInfo * @see PackageInfo#receivers */ @Immutable.Ignore @NonNull List<ParsedActivity> getReceivers(); Loading @@ -573,6 +592,7 @@ public interface AndroidPackage { * @see PackageInfo#reqFeatures * @see R.styleable#AndroidManifestUsesFeature */ @Immutable.Ignore @NonNull List<FeatureInfo> getRequestedFeatures(); Loading Loading @@ -615,6 +635,7 @@ public interface AndroidPackage { * * @see R.styleable#AndroidManifestRestrictUpdate */ @Immutable.Ignore @Nullable byte[] getRestrictUpdateHash(); Loading Loading @@ -662,6 +683,7 @@ public interface AndroidPackage { * @see ServiceInfo * @see PackageInfo#services */ @Immutable.Ignore @NonNull List<ParsedService> getServices(); Loading @@ -682,6 +704,7 @@ public interface AndroidPackage { * The signature data of all APKs in this package, which must be exactly the same across the * base and splits. */ @Immutable.Ignore @NonNull SigningDetails getSigningDetails(); Loading @@ -689,6 +712,7 @@ public interface AndroidPackage { * @see ApplicationInfo#splitClassLoaderNames * @see R.styleable#AndroidManifestApplication_classLoader */ @Immutable.Ignore @Nullable String[] getSplitClassLoaderNames(); Loading @@ -696,18 +720,21 @@ public interface AndroidPackage { * @see ApplicationInfo#splitSourceDirs * @see ApplicationInfo#getSplitCodePaths */ @Immutable.Ignore @NonNull String[] getSplitCodePaths(); /** * @see ApplicationInfo#splitDependencies */ @Immutable.Ignore @NonNull SparseArray<int[]> getSplitDependencies(); /** * Flags of any split APKs; ordered by parsed splitName */ @Immutable.Ignore @Nullable int[] getSplitFlags(); Loading @@ -717,12 +744,14 @@ public interface AndroidPackage { * @see ApplicationInfo#splitNames * @see PackageInfo#splitNames */ @Immutable.Ignore @NonNull String[] getSplitNames(); /** * @see PackageInfo#splitRevisionCodes */ @Immutable.Ignore @NonNull int[] getSplitRevisionCodes(); Loading Loading @@ -818,6 +847,7 @@ public interface AndroidPackage { @NonNull List<String> getUsesOptionalNativeLibraries(); @Immutable.Ignore @NonNull List<ParsedUsesPermission> getUsesPermissions(); Loading @@ -832,12 +862,14 @@ public interface AndroidPackage { /** * @see R.styleable#AndroidManifestUsesSdkLibrary_certDigest */ @Immutable.Ignore @Nullable String[][] getUsesSdkLibrariesCertDigests(); /** * @see R.styleable#AndroidManifestUsesSdkLibrary_versionMajor */ @Immutable.Ignore @Nullable long[] getUsesSdkLibrariesVersionsMajor(); Loading @@ -852,12 +884,14 @@ public interface AndroidPackage { /** * @see R.styleable#AndroidManifestUsesStaticLibrary_certDigest */ @Immutable.Ignore @Nullable String[][] getUsesStaticLibrariesCertDigests(); /** * @see R.styleable#AndroidManifestUsesStaticLibrary_version */ @Immutable.Ignore @Nullable long[] getUsesStaticLibrariesVersions(); Loading
services/core/java/com/android/server/pm/pkg/PackageState.java +10 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.SharedLibraryInfo; import android.content.pm.SigningInfo; import android.processor.immutability.Immutable; import android.util.SparseArray; import com.android.server.pm.PackageSetting; Loading Loading @@ -55,6 +56,7 @@ import java.util.Set; * @hide */ //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER) @Immutable public interface PackageState { /** Loading Loading @@ -109,6 +111,7 @@ public interface PackageState { * Keys are indexes into the array represented by {@link PackageManager.NotifyReason}, values * are in epoch milliseconds. */ @Immutable.Ignore @Size(PackageManager.NOTIFY_PACKAGE_USE_REASONS_COUNT) @NonNull long[] getLastPackageUsageTime(); Loading Loading @@ -172,9 +175,11 @@ public interface PackageState { */ int getSharedUserAppId(); @Immutable.Ignore @NonNull SigningInfo getSigningInfo(); @Immutable.Ignore @NonNull SparseArray<? extends PackageUserState> getUserStates(); Loading @@ -199,30 +204,35 @@ public interface PackageState { /** * @see R.styleable#AndroidManifestUsesLibrary */ @Immutable.Ignore @NonNull List<SharedLibraryInfo> getUsesLibraryInfos(); /** * @see R.styleable#AndroidManifestUsesSdkLibrary */ @Immutable.Ignore @NonNull String[] getUsesSdkLibraries(); /** * @see R.styleable#AndroidManifestUsesSdkLibrary_versionMajor */ @Immutable.Ignore @NonNull long[] getUsesSdkLibrariesVersionsMajor(); /** * @see R.styleable#AndroidManifestUsesStaticLibrary */ @Immutable.Ignore @NonNull String[] getUsesStaticLibraries(); /** * @see R.styleable#AndroidManifestUsesStaticLibrary_version */ @Immutable.Ignore @NonNull long[] getUsesStaticLibrariesVersions(); Loading
services/core/java/com/android/server/pm/pkg/PackageUserState.java +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.content.pm.PackageManager; import android.content.pm.overlay.OverlayPaths; import android.os.UserHandle; import android.processor.immutability.Immutable; import android.util.ArraySet; import java.util.Map; Loading @@ -35,6 +36,7 @@ import java.util.Map; */ // TODO(b/173807334): Expose API //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER) @Immutable.Ignore(reason = "Exposed through PackageState pending refactor") public interface PackageUserState { /** @hide */ Loading
services/core/java/com/android/server/pm/pkg/component/ParsedProvider.java +3 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.content.pm.PathPermission; import android.os.PatternMatcher; import android.processor.immutability.Immutable; import java.util.List; Loading @@ -34,12 +35,14 @@ public interface ParsedProvider extends ParsedMainComponent { boolean isMultiProcess(); @Immutable.Ignore @NonNull List<PathPermission> getPathPermissions(); @Nullable String getReadPermission(); @Immutable.Ignore @NonNull List<PatternMatcher> getUriPermissionPatterns(); Loading