blob: 1ded8d40c727d81cca1d28fd0d01b2d235fe99d2 [file] [log] [blame]
Winson01e38f42020-01-24 11:50:11 -08001/*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.content.pm.parsing;
18
19import android.annotation.NonNull;
20import android.annotation.Nullable;
21import android.content.Intent;
22import android.content.pm.ActivityInfo;
23import android.content.pm.ApplicationInfo;
24import android.content.pm.ConfigurationInfo;
25import android.content.pm.FeatureGroupInfo;
26import android.content.pm.FeatureInfo;
27import android.content.pm.PackageInfo;
28import android.content.pm.PackageParser;
29import android.content.pm.ServiceInfo;
Winsonf00c7552020-01-28 12:52:01 -080030import android.content.pm.parsing.component.ParsedActivity;
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -080031import android.content.pm.parsing.component.ParsedAttribution;
Winsonf00c7552020-01-28 12:52:01 -080032import android.content.pm.parsing.component.ParsedInstrumentation;
33import android.content.pm.parsing.component.ParsedIntentInfo;
34import android.content.pm.parsing.component.ParsedPermission;
35import android.content.pm.parsing.component.ParsedPermissionGroup;
36import android.content.pm.parsing.component.ParsedProcess;
37import android.content.pm.parsing.component.ParsedProvider;
38import android.content.pm.parsing.component.ParsedService;
Winson01e38f42020-01-24 11:50:11 -080039import android.os.Bundle;
40import android.os.Parcelable;
41import android.util.ArraySet;
Winsonf00c7552020-01-28 12:52:01 -080042import android.util.Pair;
Winson01e38f42020-01-24 11:50:11 -080043import android.util.SparseArray;
Oli Lan72ae4472020-04-14 16:50:41 +010044import android.util.SparseIntArray;
Winson01e38f42020-01-24 11:50:11 -080045
46import com.android.internal.R;
47
48import java.security.PublicKey;
49import java.util.List;
50import java.util.Map;
51import java.util.Set;
52
53/**
54 * Everything written by {@link ParsingPackage} and readable back.
55 *
56 * @hide
57 */
58@SuppressWarnings("UnusedReturnValue")
59public interface ParsingPackageRead extends Parcelable {
60
61 /**
62 * @see ActivityInfo
63 * @see PackageInfo#activities
64 */
65 @NonNull
66 List<ParsedActivity> getActivities();
67
68 /**
69 * The names of packages to adopt ownership of permissions from, parsed under
70 * {@link PackageParser#TAG_ADOPT_PERMISSIONS}.
71 * @see R.styleable#AndroidManifestOriginalPackage_name
72 */
73 @NonNull
74 List<String> getAdoptPermissions();
75
76 /**
77 * @see PackageInfo#configPreferences
78 * @see R.styleable#AndroidManifestUsesConfiguration
79 */
80 @NonNull
81 List<ConfigurationInfo> getConfigPreferences();
82
83 @NonNull
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -080084 List<ParsedAttribution> getAttributions();
Winson01e38f42020-01-24 11:50:11 -080085
86 /**
87 * @see PackageInfo#featureGroups
88 * @see R.styleable#AndroidManifestUsesFeature
89 */
90 @NonNull
91 List<FeatureGroupInfo> getFeatureGroups();
92
93 /**
94 * Permissions requested but not in the manifest. These may have been split or migrated from
95 * previous versions/definitions.
96 */
97 @NonNull
98 List<String> getImplicitPermissions();
99
100 /**
101 * @see android.content.pm.InstrumentationInfo
102 * @see PackageInfo#instrumentation
103 */
104 @NonNull
105 List<ParsedInstrumentation> getInstrumentations();
106
107 /**
108 * For use with {@link com.android.server.pm.KeySetManagerService}. Parsed in
109 * {@link PackageParser#TAG_KEY_SETS}.
110 * @see R.styleable#AndroidManifestKeySet
111 * @see R.styleable#AndroidManifestPublicKey
112 */
113 @NonNull
114 Map<String, ArraySet<PublicKey>> getKeySetMapping();
115
116 /**
117 * Library names this package is declared as, for use by other packages with "uses-library".
118 * @see R.styleable#AndroidManifestLibrary
119 */
120 @NonNull
121 List<String> getLibraryNames();
122
123 /**
124 * For system use to migrate from an old package name to a new one, moving over data
125 * if available.
126 * @see R.styleable#AndroidManifestOriginalPackage}
127 */
128 @NonNull
129 List<String> getOriginalPackages();
130
131 /**
132 * Map of overlayable name to actor name.
133 */
134 @NonNull
135 Map<String, String> getOverlayables();
136
137 /**
138 * @see android.content.pm.PermissionInfo
139 * @see PackageInfo#permissions
140 */
141 @NonNull
142 List<ParsedPermission> getPermissions();
143
144 /**
145 * @see android.content.pm.PermissionGroupInfo
146 */
147 @NonNull
148 List<ParsedPermissionGroup> getPermissionGroups();
149
150 /**
151 * Used to determine the default preferred handler of an {@link Intent}.
152 *
153 * Map of component className to intent info inside that component.
154 * TODO(b/135203078): Is this actually used/working?
155 */
156 @NonNull
Winsonf00c7552020-01-28 12:52:01 -0800157 List<Pair<String, ParsedIntentInfo>> getPreferredActivityFilters();
Winson01e38f42020-01-24 11:50:11 -0800158
159 /**
160 * System protected broadcasts.
161 * @see R.styleable#AndroidManifestProtectedBroadcast
162 */
163 @NonNull
164 List<String> getProtectedBroadcasts();
165
166 /**
167 * @see android.content.pm.ProviderInfo
168 * @see PackageInfo#providers
169 */
170 @NonNull
171 List<ParsedProvider> getProviders();
172
173 /**
174 * @see android.content.pm.ProcessInfo
175 */
176 @NonNull
177 Map<String, ParsedProcess> getProcesses();
178
179 /**
180 * Since they share several attributes, receivers are parsed as {@link ParsedActivity}, even
181 * though they represent different functionality.
182 * TODO(b/135203078): Reconsider this and maybe make ParsedReceiver so it's not so confusing
183 * @see ActivityInfo
184 * @see PackageInfo#receivers
185 */
186 @NonNull
187 List<ParsedActivity> getReceivers();
188
189 /**
190 * @see PackageInfo#reqFeatures
191 * @see R.styleable#AndroidManifestUsesFeature
192 */
193 @NonNull
194 List<FeatureInfo> getReqFeatures();
195
196 /**
197 * All the permissions declared. This is an effective set, and may include permissions
198 * transformed from split/migrated permissions from previous versions, so may not be exactly
199 * what the package declares in its manifest.
200 * @see PackageInfo#requestedPermissions
201 * @see R.styleable#AndroidManifestUsesPermission
202 */
203 @NonNull
204 List<String> getRequestedPermissions();
205
206 /**
207 * Whether or not the app requested explicitly resizeable Activities.
208 * A null value means nothing was explicitly requested.
209 */
210 @Nullable
211 Boolean getResizeableActivity();
212
213 /**
214 * @see ServiceInfo
215 * @see PackageInfo#services
216 */
217 @NonNull
218 List<ParsedService> getServices();
219
220 /** @see R.styleable#AndroidManifestUsesLibrary */
221 @NonNull
222 List<String> getUsesLibraries();
223
224 /**
225 * Like {@link #getUsesLibraries()}, but marked optional by setting
226 * {@link R.styleable#AndroidManifestUsesLibrary_required} to false . Application is expected
227 * to handle absence manually.
228 * @see R.styleable#AndroidManifestUsesLibrary
229 */
230 @NonNull
231 List<String> getUsesOptionalLibraries();
232
233 /**
234 * TODO(b/135203078): Move static library stuff to an inner data class
235 * @see R.styleable#AndroidManifestUsesStaticLibrary
236 */
237 @NonNull
238 List<String> getUsesStaticLibraries();
239
240 /** @see R.styleable#AndroidManifestUsesStaticLibrary_certDigest */
241 @Nullable
242 String[][] getUsesStaticLibrariesCertDigests();
243
244 /** @see R.styleable#AndroidManifestUsesStaticLibrary_version */
245 @Nullable
246 long[] getUsesStaticLibrariesVersions();
247
248 /**
249 * Intents that this package may query or require and thus requires visibility into.
250 * @see R.styleable#AndroidManifestQueriesIntent
251 */
252 @NonNull
253 List<Intent> getQueriesIntents();
254
255 /**
256 * Other packages that this package may query or require and thus requires visibility into.
257 * @see R.styleable#AndroidManifestQueriesPackage
258 */
259 @NonNull
260 List<String> getQueriesPackages();
261
262 /**
263 * Authorities that this package may query or require and thus requires visibility into.
264 * @see R.styleable#AndroidManifestQueriesProvider
265 */
266 @NonNull
267 Set<String> getQueriesProviders();
268
269 /**
270 * We store the application meta-data independently to avoid multiple unwanted references
271 * TODO(b/135203078): What does this comment mean?
272 * TODO(b/135203078): Make all the Bundles immutable (and non-null by shared empty reference?)
273 */
274 @Nullable
275 Bundle getMetaData();
276
277 /** @see R.styleable#AndroidManifestApplication_forceQueryable */
278 boolean isForceQueryable();
279
280 /**
281 * @see ApplicationInfo#maxAspectRatio
282 * @see R.styleable#AndroidManifestApplication_maxAspectRatio
283 */
284 float getMaxAspectRatio();
285
286 /**
287 * @see ApplicationInfo#minAspectRatio
288 * @see R.styleable#AndroidManifestApplication_minAspectRatio
289 */
290 float getMinAspectRatio();
291
292 /**
293 * @see ApplicationInfo#permission
294 * @see R.styleable#AndroidManifestApplication_permission
295 */
296 @Nullable
297 String getPermission();
298
299 /**
300 * @see ApplicationInfo#processName
301 * @see R.styleable#AndroidManifestApplication_process
302 */
303 @NonNull
304 String getProcessName();
305
306 /**
307 * @see PackageInfo#sharedUserId
308 * @see R.styleable#AndroidManifest_sharedUserId
309 */
310 @Deprecated
311 @Nullable
312 String getSharedUserId();
313
314 /** @see R.styleable#AndroidManifestStaticLibrary_name */
315 @Nullable
316 String getStaticSharedLibName();
317
318 /**
319 * @see ApplicationInfo#taskAffinity
320 * @see R.styleable#AndroidManifestApplication_taskAffinity
321 */
322 @Nullable
323 String getTaskAffinity();
324
325 /**
326 * @see ApplicationInfo#targetSdkVersion
327 * @see R.styleable#AndroidManifestUsesSdk_targetSdkVersion
328 */
329 int getTargetSdkVersion();
330
331 /**
332 * @see ApplicationInfo#uiOptions
333 * @see R.styleable#AndroidManifestApplication_uiOptions
334 */
335 int getUiOptions();
336
337 boolean isCrossProfile();
338
339 boolean isResizeableActivityViaSdkVersion();
340
341 /** @see ApplicationInfo#FLAG_HARDWARE_ACCELERATED */
342 boolean isBaseHardwareAccelerated();
343
344 /**
345 * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >=
346 * {@link android.os.Build.VERSION_CODES#DONUT}.
347 * @see R.styleable#AndroidManifestSupportsScreens_resizeable
348 * @see ApplicationInfo#FLAG_RESIZEABLE_FOR_SCREENS
349 */
350 boolean isResizeable();
351
352 /** @see ApplicationInfo#PRIVATE_FLAG_ALLOW_AUDIO_PLAYBACK_CAPTURE */
353 boolean isAllowAudioPlaybackCapture();
354
355 /** @see ApplicationInfo#FLAG_ALLOW_BACKUP */
356 boolean isAllowBackup();
357
358 /** @see ApplicationInfo#FLAG_ALLOW_CLEAR_USER_DATA */
359 boolean isAllowClearUserData();
360
361 /** @see ApplicationInfo#PRIVATE_FLAG_ALLOW_CLEAR_USER_DATA_ON_FAILED_RESTORE */
362 boolean isAllowClearUserDataOnFailedRestore();
363
364 /** @see ApplicationInfo#FLAG_ALLOW_TASK_REPARENTING */
365 boolean isAllowTaskReparenting();
366
367 /**
368 * @see ApplicationInfo#PRIVATE_FLAG_IS_RESOURCE_OVERLAY
369 * @see ApplicationInfo#isResourceOverlay()
370 */
371 boolean isOverlay();
372
373 /** @see ApplicationInfo#PRIVATE_FLAG_BACKUP_IN_FOREGROUND */
374 boolean isBackupInForeground();
375
376 /** @see ApplicationInfo#PRIVATE_FLAG_CANT_SAVE_STATE */
377 boolean isCantSaveState();
378
379 /** @see ApplicationInfo#FLAG_DEBUGGABLE */
380 boolean isDebuggable();
381
382 /** @see ApplicationInfo#PRIVATE_FLAG_DEFAULT_TO_DEVICE_PROTECTED_STORAGE */
383 boolean isDefaultToDeviceProtectedStorage();
384
385 /** @see ApplicationInfo#PRIVATE_FLAG_DIRECT_BOOT_AWARE */
386 boolean isDirectBootAware();
387
388 /** @see ApplicationInfo#FLAG_EXTERNAL_STORAGE */
389 boolean isExternalStorage();
390
391 /** @see ApplicationInfo#FLAG_EXTRACT_NATIVE_LIBS */
392 boolean isExtractNativeLibs();
393
394 /** @see ApplicationInfo#FLAG_FULL_BACKUP_ONLY */
395 boolean isFullBackupOnly();
396
397 /** @see ApplicationInfo#FLAG_HAS_CODE */
398 boolean isHasCode();
399
400 /** @see ApplicationInfo#PRIVATE_FLAG_HAS_FRAGILE_USER_DATA */
401 boolean isHasFragileUserData();
402
403 /** @see ApplicationInfo#FLAG_IS_GAME */
404 @Deprecated
405 boolean isGame();
406
407 /** @see ApplicationInfo#PRIVATE_FLAG_ISOLATED_SPLIT_LOADING */
408 boolean isIsolatedSplitLoading();
409
410 /** @see ApplicationInfo#FLAG_KILL_AFTER_RESTORE */
411 boolean isKillAfterRestore();
412
413 /** @see ApplicationInfo#FLAG_LARGE_HEAP */
414 boolean isLargeHeap();
415
416 /** @see ApplicationInfo#FLAG_MULTIARCH */
417 boolean isMultiArch();
418
419 /** @see ApplicationInfo#PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE */
420 boolean isPartiallyDirectBootAware();
421
422 /** @see ApplicationInfo#FLAG_PERSISTENT */
423 boolean isPersistent();
424
425 /** @see ApplicationInfo#PRIVATE_FLAG_PROFILEABLE_BY_SHELL */
426 boolean isProfileableByShell();
427
428 /** @see ApplicationInfo#PRIVATE_FLAG_REQUEST_LEGACY_EXTERNAL_STORAGE */
429 boolean isRequestLegacyExternalStorage();
430
431 /** @see ApplicationInfo#FLAG_RESTORE_ANY_VERSION */
432 boolean isRestoreAnyVersion();
433
434 // ParsingPackageRead setSplitHasCode(int splitIndex, boolean splitHasCode);
435
436 /** Flags of any split APKs; ordered by parsed splitName */
437 @Nullable
438 int[] getSplitFlags();
439
440 /** @see ApplicationInfo#splitSourceDirs */
441 @Nullable
442 String[] getSplitCodePaths();
443
444 /** @see ApplicationInfo#splitDependencies */
445 @Nullable
446 SparseArray<int[]> getSplitDependencies();
447
448 /**
449 * @see ApplicationInfo#splitNames
450 * @see PackageInfo#splitNames
451 */
452 @Nullable
453 String[] getSplitNames();
454
455 /** @see PackageInfo#splitRevisionCodes */
456 int[] getSplitRevisionCodes();
457
458 /** @see ApplicationInfo#PRIVATE_FLAG_STATIC_SHARED_LIBRARY */
459 boolean isStaticSharedLibrary();
460
461 /** @see ApplicationInfo#FLAG_SUPPORTS_RTL */
462 boolean isSupportsRtl();
463
464 /** @see ApplicationInfo#FLAG_TEST_ONLY */
465 boolean isTestOnly();
466
467 /** @see ApplicationInfo#PRIVATE_FLAG_USE_EMBEDDED_DEX */
468 boolean isUseEmbeddedDex();
469
470 /** @see ApplicationInfo#FLAG_USES_CLEARTEXT_TRAFFIC */
471 boolean isUsesCleartextTraffic();
472
473 /** @see ApplicationInfo#PRIVATE_FLAG_USES_NON_SDK_API */
474 boolean isUsesNonSdkApi();
475
476 /**
477 * Set if the any of components are visible to instant applications.
478 * @see R.styleable#AndroidManifestActivity_visibleToInstantApps
479 * @see R.styleable#AndroidManifestProvider_visibleToInstantApps
480 * @see R.styleable#AndroidManifestService_visibleToInstantApps
481 */
482 boolean isVisibleToInstantApps();
483
484 /** @see ApplicationInfo#FLAG_VM_SAFE_MODE */
485 boolean isVmSafeMode();
486
487 /**
488 * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >=
489 * {@link android.os.Build.VERSION_CODES#DONUT}.
490 * @see R.styleable#AndroidManifestSupportsScreens_anyDensity
491 * @see ApplicationInfo#FLAG_SUPPORTS_SCREEN_DENSITIES
492 */
493 boolean isAnyDensity();
494
495 /**
496 * @see ApplicationInfo#appComponentFactory
497 * @see R.styleable#AndroidManifestApplication_appComponentFactory
498 */
499 @Nullable
500 String getAppComponentFactory();
501
502 /**
503 * @see ApplicationInfo#backupAgentName
504 * @see R.styleable#AndroidManifestApplication_backupAgent
505 */
506 @Nullable
507 String getBackupAgentName();
508
509 /**
510 * @see ApplicationInfo#banner
511 * @see R.styleable#AndroidManifestApplication_banner
512 */
513 int getBanner();
514
515 /**
516 * @see ApplicationInfo#category
517 * @see R.styleable#AndroidManifestApplication_appCategory
518 */
519 int getCategory();
520
521 /**
522 * @see ApplicationInfo#classLoaderName
523 * @see R.styleable#AndroidManifestApplication_classLoader
524 */
525 @Nullable
526 String getClassLoaderName();
527
528 /**
529 * @see ApplicationInfo#className
530 * @see R.styleable#AndroidManifestApplication_name
531 */
532 @Nullable
533 String getClassName();
534
535 String getPackageName();
536
537 /** Path of base APK */
538 String getBaseCodePath();
539
540 /**
541 * Path where this package was found on disk. For monolithic packages
542 * this is path to single base APK file; for cluster packages this is
543 * path to the cluster directory.
544 */
545 @NonNull
546 String getCodePath();
547
548 /**
549 * @see ApplicationInfo#compatibleWidthLimitDp
550 * @see R.styleable#AndroidManifestSupportsScreens_compatibleWidthLimitDp
551 */
552 int getCompatibleWidthLimitDp();
553
554 /**
555 * @see ApplicationInfo#descriptionRes
556 * @see R.styleable#AndroidManifestApplication_description
557 */
558 int getDescriptionRes();
559
560 /**
561 * @see ApplicationInfo#enabled
562 * @see R.styleable#AndroidManifestApplication_enabled
563 */
564 boolean isEnabled();
565
566 /**
567 * @see ApplicationInfo#fullBackupContent
568 * @see R.styleable#AndroidManifestApplication_fullBackupContent
569 */
570 int getFullBackupContent();
571
572 /** @see ApplicationInfo#PRIVATE_FLAG_HAS_DOMAIN_URLS */
573 boolean isHasDomainUrls();
574
575 /**
576 * @see ApplicationInfo#iconRes
577 * @see R.styleable#AndroidManifestApplication_icon
578 */
579 int getIconRes();
580
581 /**
582 * @see ApplicationInfo#installLocation
583 * @see R.styleable#AndroidManifest_installLocation
584 */
585 int getInstallLocation();
586
587 /**
588 * @see ApplicationInfo#labelRes
589 * @see R.styleable#AndroidManifestApplication_label
590 */
591 int getLabelRes();
592
593 /**
594 * @see ApplicationInfo#largestWidthLimitDp
595 * @see R.styleable#AndroidManifestSupportsScreens_largestWidthLimitDp
596 */
597 int getLargestWidthLimitDp();
598
599 /**
600 * @see ApplicationInfo#logo
601 * @see R.styleable#AndroidManifestApplication_logo
602 */
603 int getLogo();
604
605 /**
606 * @see ApplicationInfo#manageSpaceActivityName
607 * @see R.styleable#AndroidManifestApplication_manageSpaceActivity
608 */
609 @Nullable
610 String getManageSpaceActivityName();
611
612 /**
Oli Lan72ae4472020-04-14 16:50:41 +0100613 * @see ApplicationInfo#minExtensionVersions
614 * @see R.styleable#AndroidManifestExtensionSdk
615 */
616 @Nullable
617 SparseIntArray getMinExtensionVersions();
618
619 /**
Winson01e38f42020-01-24 11:50:11 -0800620 * @see ApplicationInfo#minSdkVersion
621 * @see R.styleable#AndroidManifestUsesSdk_minSdkVersion
622 */
623 int getMinSdkVersion();
624
625 /**
626 * @see ApplicationInfo#networkSecurityConfigRes
627 * @see R.styleable#AndroidManifestApplication_networkSecurityConfig
628 */
629 int getNetworkSecurityConfigRes();
630
631 /**
632 * If {@link R.styleable#AndroidManifestApplication_label} is a string literal, this is it.
633 * Otherwise, it's stored as {@link #getLabelRes()}.
634 * @see ApplicationInfo#nonLocalizedLabel
635 * @see R.styleable#AndroidManifestApplication_label
636 */
637 @Nullable
638 CharSequence getNonLocalizedLabel();
639
640 /**
641 * @see PackageInfo#overlayCategory
642 * @see R.styleable#AndroidManifestResourceOverlay_category
643 */
644 @Nullable
645 String getOverlayCategory();
646
647 /** @see PackageInfo#mOverlayIsStatic */
648 boolean isOverlayIsStatic();
649
650 /**
651 * @see PackageInfo#overlayPriority
652 * @see R.styleable#AndroidManifestResourceOverlay_priority
653 */
654 int getOverlayPriority();
655
656 /**
657 * @see PackageInfo#overlayTarget
658 * @see R.styleable#AndroidManifestResourceOverlay_targetPackage
659 */
660 @Nullable
661 String getOverlayTarget();
662
663 /**
664 * @see PackageInfo#targetOverlayableName
665 * @see R.styleable#AndroidManifestResourceOverlay_targetName
666 */
667 @Nullable
668 String getOverlayTargetName();
669
670 /**
671 * If a system app declares {@link #getOriginalPackages()}, and the app was previously installed
672 * under one of those original package names, the {@link #getPackageName()} system identifier
673 * will be changed to that previously installed name. This will then be non-null, set to the
674 * manifest package name, for tracking the package under its true name.
675 *
676 * TODO(b/135203078): Remove this in favor of checking originalPackages.isEmpty and
677 * getManifestPackageName
678 */
679 @Nullable
680 String getRealPackage();
681
682 /**
683 * The required account type without which this application will not function.
684 *
685 * @see PackageInfo#requiredAccountType
686 * @see R.styleable#AndroidManifestApplication_requiredAccountType
687 */
688 @Nullable
689 String getRequiredAccountType();
690
691 /**
692 * @see PackageInfo#requiredForAllUsers
693 * @see R.styleable#AndroidManifestApplication_requiredForAllUsers
694 */
695 boolean isRequiredForAllUsers();
696
697 /**
698 * @see ApplicationInfo#requiresSmallestWidthDp
699 * @see R.styleable#AndroidManifestSupportsScreens_requiresSmallestWidthDp
700 */
701 int getRequiresSmallestWidthDp();
702
703 /**
704 * SHA-512 hash of the only APK that can be used to update a system package.
705 * @see R.styleable#AndroidManifestRestrictUpdate
706 */
707 @Nullable
708 byte[] getRestrictUpdateHash();
709
710 /**
711 * The restricted account authenticator type that is used by this application
712 *
713 * @see PackageInfo#restrictedAccountType
714 * @see R.styleable#AndroidManifestApplication_restrictedAccountType
715 */
716 @Nullable
717 String getRestrictedAccountType();
718
719 /**
720 * @see ApplicationInfo#roundIconRes
721 * @see R.styleable#AndroidManifestApplication_roundIcon
722 */
723 int getRoundIconRes();
724
725 /**
726 * @see PackageInfo#sharedUserLabel
727 * @see R.styleable#AndroidManifest_sharedUserLabel
728 */
729 @Deprecated
730 int getSharedUserLabel();
731
732 /**
733 * The signature data of all APKs in this package, which must be exactly the same across the
734 * base and splits.
735 */
736 PackageParser.SigningDetails getSigningDetails();
737
738 /**
739 * @see ApplicationInfo#splitClassLoaderNames
740 * @see R.styleable#AndroidManifestApplication_classLoader
741 */
742 @Nullable
743 String[] getSplitClassLoaderNames();
744
745 /** @see R.styleable#AndroidManifestStaticLibrary_version */
746 long getStaticSharedLibVersion();
747
748 /**
749 * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >=
750 * {@link android.os.Build.VERSION_CODES#DONUT}.
751 * @see R.styleable#AndroidManifestSupportsScreens_largeScreens
752 * @see ApplicationInfo#FLAG_SUPPORTS_LARGE_SCREENS
753 */
754 boolean isSupportsLargeScreens();
755
756 /**
757 * If omitted from manifest, returns true.
758 * @see R.styleable#AndroidManifestSupportsScreens_normalScreens
759 * @see ApplicationInfo#FLAG_SUPPORTS_NORMAL_SCREENS
760 */
761 boolean isSupportsNormalScreens();
762
763 /**
764 * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >=
765 * {@link android.os.Build.VERSION_CODES#DONUT}.
766 * @see R.styleable#AndroidManifestSupportsScreens_smallScreens
767 * @see ApplicationInfo#FLAG_SUPPORTS_SMALL_SCREENS
768 */
769 boolean isSupportsSmallScreens();
770
771 /**
772 * If omitted from manifest, returns true if {@link #getTargetSdkVersion()} >=
773 * {@link android.os.Build.VERSION_CODES#GINGERBREAD}.
774 * @see R.styleable#AndroidManifestSupportsScreens_xlargeScreens
775 * @see ApplicationInfo#FLAG_SUPPORTS_XLARGE_SCREENS
776 */
777 boolean isSupportsExtraLargeScreens();
778
779 /** @see ApplicationInfo#PRIVATE_FLAG_ALLOW_NATIVE_HEAP_POINTER_TAGGING */
780 boolean isAllowNativeHeapPointerTagging();
781
Eugene Susla49b84c32020-03-23 15:19:29 -0700782 int getAutoRevokePermissions();
Eugene Susladb77bc12020-03-03 12:09:00 -0800783
Winson01e38f42020-01-24 11:50:11 -0800784 boolean hasPreserveLegacyExternalStorage();
785
786 /**
787 * @see ApplicationInfo#targetSandboxVersion
788 * @see R.styleable#AndroidManifest_targetSandboxVersion
789 */
790 @Deprecated
791 int getTargetSandboxVersion();
792
793 /**
794 * @see ApplicationInfo#theme
795 * @see R.styleable#AndroidManifestApplication_theme
796 */
797 int getTheme();
798
799 /**
800 * For use with {@link com.android.server.pm.KeySetManagerService}. Parsed in
801 * {@link PackageParser#TAG_KEY_SETS}.
802 * @see R.styleable#AndroidManifestUpgradeKeySet
803 */
804 @NonNull
805 Set<String> getUpgradeKeySets();
806
807 /**
808 * The install time abi override to choose 32bit abi's when multiple abi's
809 * are present. This is only meaningfull for multiarch applications.
810 * The use32bitAbi attribute is ignored if cpuAbiOverride is also set.
811 */
812 boolean isUse32BitAbi();
813
814 /** @see ApplicationInfo#volumeUuid */
815 @Nullable
816 String getVolumeUuid();
817
818 /** @see ApplicationInfo#zygotePreloadName */
819 @Nullable
820 String getZygotePreloadName();
821
822 /** Revision code of base APK */
823 int getBaseRevisionCode();
824
825 /** @see PackageInfo#versionName */
826 @Nullable
827 String getVersionName();
828
829 /** @see PackageInfo#versionCodeMajor */
830 @Nullable
831 int getVersionCode();
832
833 /** @see PackageInfo#versionCodeMajor */
834 @Nullable
835 int getVersionCodeMajor();
836
837 /**
838 * @see ApplicationInfo#compileSdkVersion
839 * @see R.styleable#AndroidManifest_compileSdkVersion
840 */
841 int getCompileSdkVersion();
842
843 /**
844 * @see ApplicationInfo#compileSdkVersionCodename
845 * @see R.styleable#AndroidManifest_compileSdkVersionCodename
846 */
847 @Nullable
848 String getCompileSdkVersionCodeName();
849
850 @Nullable
851 Set<String> getMimeGroups();
852
Evgenii Stepanov102d3d82020-02-12 16:48:14 -0800853 /**
Evgenii Stepanovd43d1092020-03-16 13:55:42 -0700854 * @see ApplicationInfo#gwpAsanMode
855 * @see R.styleable#AndroidManifest_gwpAsanMode
Evgenii Stepanov102d3d82020-02-12 16:48:14 -0800856 */
Evgenii Stepanovd43d1092020-03-16 13:55:42 -0700857 public int getGwpAsanMode();
Evgenii Stepanov102d3d82020-02-12 16:48:14 -0800858
Winson01e38f42020-01-24 11:50:11 -0800859 // TODO(b/135203078): Hide and enforce going through PackageInfoUtils
860 ApplicationInfo toAppInfoWithoutState();
861}