|
| 1 | +namespace Android.Content.PM; |
| 2 | + |
| 3 | +#if ANDROID_34 |
| 4 | +public abstract partial class PackageManager |
| 5 | +{ |
| 6 | + public sealed partial class PackageInfoFlags |
| 7 | + { |
| 8 | + // Create overloads that accept PackageInfoFlagsLong |
| 9 | + [global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android33.0")] |
| 10 | + public static Android.Content.PM.PackageManager.PackageInfoFlags Of (PackageInfoFlagsLong value) |
| 11 | + => Of ((long) value); |
| 12 | + |
| 13 | + [global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android33.0")] |
| 14 | + public PackageInfoFlagsLong ValueAsFlags |
| 15 | + => (PackageInfoFlagsLong) Value; |
| 16 | + } |
| 17 | +} |
| 18 | + |
| 19 | +// Manually created "long" version of "PackageInfoFlags" enum, created from documentation: |
| 20 | +// https://developer.android.com/reference/android/content/pm/PackageManager.PackageInfoFlags#of(long) |
| 21 | +[System.Flags] |
| 22 | +public enum PackageInfoFlagsLong : long |
| 23 | +{ |
| 24 | + None = 0, |
| 25 | + |
| 26 | + GetActivities = PackageInfoFlags.Activities, |
| 27 | + |
| 28 | + GetReceivers = PackageInfoFlags.Receivers, |
| 29 | + |
| 30 | + GetServices = PackageInfoFlags.Services, |
| 31 | + |
| 32 | + GetProviders = PackageInfoFlags.Providers, |
| 33 | + |
| 34 | + GetInstrumentation = PackageInfoFlags.Instrumentation, |
| 35 | + |
| 36 | + [global::System.Runtime.Versioning.ObsoletedOSPlatformAttribute ("android31.0", "The platform does not support getting IntentFilters for the package.")] |
| 37 | + GetIntentFilters = PackageInfoFlags.IntentFilters, |
| 38 | + |
| 39 | + [global::System.Runtime.Versioning.ObsoletedOSPlatformAttribute ("android28.0", "Use GetSigningCertificates instead.")] |
| 40 | + GetSignatures = PackageInfoFlags.Signatures, |
| 41 | + |
| 42 | + GetMetaData = PackageInfoFlags.MetaData, |
| 43 | + |
| 44 | + GetGids = PackageInfoFlags.Gids, |
| 45 | + |
| 46 | + [global::System.Runtime.Versioning.ObsoletedOSPlatformAttribute ("android24.0", "Replaced with MatchDisabledComponents.")] |
| 47 | + GetDisabledComponents = PackageInfoFlags.DisabledComponents, |
| 48 | + |
| 49 | + [global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android24.0")] |
| 50 | + MatchDisabledComponents = PackageInfoFlags.MatchDisabledComponents, |
| 51 | + |
| 52 | + GetSharedLibraryFiles = PackageInfoFlags.SharedLibraryFiles, |
| 53 | + |
| 54 | + GetUriPermissionPatterns = PackageInfoFlags.UriPermissionPatterns, |
| 55 | + |
| 56 | + GetPermissions = PackageInfoFlags.Permissions, |
| 57 | + |
| 58 | + [global::System.Runtime.Versioning.ObsoletedOSPlatformAttribute ("android24.0", "Replaced with MatchUninstalledPackages.")] |
| 59 | + GetUninstalledPackages = PackageInfoFlags.UninstalledPackages, |
| 60 | + |
| 61 | + [global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android24.0")] |
| 62 | + MatchUninstalledPackages = PackageInfoFlags.MatchUninstalledPackages, |
| 63 | + |
| 64 | + GetConfigurations = PackageInfoFlags.Configurations, |
| 65 | + |
| 66 | + [global::System.Runtime.Versioning.ObsoletedOSPlatformAttribute ("android24.0", "Replaced with MatchDisabledUntilUsedComponents.")] |
| 67 | + GetDisabledUntilUsedComponents = PackageInfoFlags.DisabledUntilUsedComponents, |
| 68 | + |
| 69 | + [global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android24.0")] |
| 70 | + MatchDisabledUntilUsedComponents = PackageInfoFlags.MatchDisabledUntilUsedComponents, |
| 71 | + |
| 72 | + [global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android24.0")] |
| 73 | + MatchSystemOnly = PackageInfoFlags.MatchSystemOnly, |
| 74 | + |
| 75 | + [global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android28.0")] |
| 76 | + GetSigningCertificates = PackageInfoFlags.SigningCertificates, |
| 77 | + |
| 78 | + [global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android29.0")] |
| 79 | + MatchApex = 1073741824, |
| 80 | + |
| 81 | + [global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android31.0")] |
| 82 | + [global::System.Runtime.Versioning.ObsoletedOSPlatformAttribute ("android34.0", "Use GetAttributionsLong to avoid unintended sign extension.")] |
| 83 | + GetAttributions = PackageInfoFlags.Attributions, |
| 84 | + |
| 85 | + [global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android34.0")] |
| 86 | + GetAttributionsLong = 2147483648, |
| 87 | +} |
| 88 | +#endif // ANDROID_34 |
0 commit comments