• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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 
17 package com.android.server.pm.pkg;
18 
19 import android.annotation.NonNull;
20 import android.annotation.Nullable;
21 import android.annotation.SuppressLint;
22 import android.annotation.SystemApi;
23 import android.content.pm.ConfigurationInfo;
24 import android.content.pm.FeatureGroupInfo;
25 import android.content.pm.FeatureInfo;
26 import android.util.SparseArray;
27 
28 import com.android.server.pm.parsing.pkg.AndroidPackage;
29 import com.android.server.pm.pkg.component.ParsedActivity;
30 import com.android.server.pm.pkg.component.ParsedAttribution;
31 import com.android.server.pm.pkg.component.ParsedInstrumentation;
32 import com.android.server.pm.pkg.component.ParsedPermission;
33 import com.android.server.pm.pkg.component.ParsedProvider;
34 import com.android.server.pm.pkg.component.ParsedService;
35 
36 import java.util.List;
37 
38 /**
39  * Explicit interface used for consumers like mainline who need a {@link SystemApi @SystemApi} form
40  * of {@link AndroidPackage}. *
41  * @hide
42  */
43 //@SystemApi(client = SystemApi.Client.SYSTEM_SERVER)
44 public interface AndroidPackageApi {
45 
areAttributionsUserVisible()46     boolean areAttributionsUserVisible();
47 
48     @Nullable
getAppComponentFactory()49     String getAppComponentFactory();
50 
getAutoRevokePermissions()51     int getAutoRevokePermissions();
52 
53     @Nullable
getBackupAgentName()54     String getBackupAgentName();
55 
getBanner()56     int getBanner();
57 
58     @NonNull
getBaseApkPath()59     String getBaseApkPath();
60 
getCategory()61     int getCategory();
62 
63     @Nullable
getClassLoaderName()64     String getClassLoaderName();
65 
66     @Nullable
getClassName()67     String getClassName();
68 
getCompatibleWidthLimitDp()69     int getCompatibleWidthLimitDp();
70 
getDataExtractionRules()71     int getDataExtractionRules();
72 
getDescriptionRes()73     int getDescriptionRes();
74 
getFullBackupContent()75     int getFullBackupContent();
76 
getGwpAsanMode()77     int getGwpAsanMode();
78 
getIconRes()79     int getIconRes();
80 
getInstallLocation()81     int getInstallLocation();
82 
getLabelRes()83     int getLabelRes();
84 
getLargestWidthLimitDp()85     int getLargestWidthLimitDp();
86 
getLogo()87     int getLogo();
88 
89     @Nullable
getManageSpaceActivityName()90     String getManageSpaceActivityName();
91 
getMaxAspectRatio()92     float getMaxAspectRatio();
93 
getMemtagMode()94     int getMemtagMode();
95 
getMinAspectRatio()96     float getMinAspectRatio();
97 
getMinSdkVersion()98     int getMinSdkVersion();
99 
getNativeHeapZeroInitialized()100     int getNativeHeapZeroInitialized();
101 
getNetworkSecurityConfigRes()102     int getNetworkSecurityConfigRes();
103 
104     @Nullable
getNonLocalizedLabel()105     CharSequence getNonLocalizedLabel();
106 
107     @NonNull
getPath()108     String getPath();
109 
110     @Nullable
getPermission()111     String getPermission();
112 
113     @NonNull
getProcessName()114     String getProcessName();
115 
getRequiresSmallestWidthDp()116     int getRequiresSmallestWidthDp();
117 
118     @SuppressLint("AutoBoxing")
119     @Nullable
getResizeableActivity()120     Boolean getResizeableActivity();
121 
getRoundIconRes()122     int getRoundIconRes();
123 
124     @NonNull
getSplitClassLoaderNames()125     String[] getSplitClassLoaderNames();
126 
127     @NonNull
getSplitCodePaths()128     String[] getSplitCodePaths();
129 
130     @Nullable
getSplitDependencies()131     SparseArray<int[]> getSplitDependencies();
132 
getTargetSdkVersion()133     int getTargetSdkVersion();
134 
getTargetSandboxVersion()135     int getTargetSandboxVersion();
136 
137     @Nullable
getTaskAffinity()138     String getTaskAffinity();
139 
getTheme()140     int getTheme();
141 
getUiOptions()142     int getUiOptions();
143 
144     @Nullable
getVolumeUuid()145     String getVolumeUuid();
146 
147     @Nullable
getZygotePreloadName()148     String getZygotePreloadName();
149 
hasRequestForegroundServiceExemption()150     boolean hasRequestForegroundServiceExemption();
151 
152     @SuppressLint("AutoBoxing")
153     @Nullable
hasRequestRawExternalStorageAccess()154     Boolean hasRequestRawExternalStorageAccess();
155 
isAllowAudioPlaybackCapture()156     boolean isAllowAudioPlaybackCapture();
157 
isAllowBackup()158     boolean isAllowBackup();
159 
isAllowClearUserData()160     boolean isAllowClearUserData();
161 
isAllowClearUserDataOnFailedRestore()162     boolean isAllowClearUserDataOnFailedRestore();
163 
isAllowNativeHeapPointerTagging()164     boolean isAllowNativeHeapPointerTagging();
165 
isAllowTaskReparenting()166     boolean isAllowTaskReparenting();
167 
isAnyDensity()168     boolean isAnyDensity();
169 
isBackupInForeground()170     boolean isBackupInForeground();
171 
isBaseHardwareAccelerated()172     boolean isBaseHardwareAccelerated();
173 
isCantSaveState()174     boolean isCantSaveState();
175 
isCrossProfile()176     boolean isCrossProfile();
177 
isDebuggable()178     boolean isDebuggable();
179 
isDefaultToDeviceProtectedStorage()180     boolean isDefaultToDeviceProtectedStorage();
181 
isDirectBootAware()182     boolean isDirectBootAware();
183 
isEnabled()184     boolean isEnabled();
185 
isExternalStorage()186     boolean isExternalStorage();
187 
isExtractNativeLibs()188     boolean isExtractNativeLibs();
189 
isFullBackupOnly()190     boolean isFullBackupOnly();
191 
isHasCode()192     boolean isHasCode();
193 
isHasDomainUrls()194     boolean isHasDomainUrls();
195 
isHasFragileUserData()196     boolean isHasFragileUserData();
197 
isIsolatedSplitLoading()198     boolean isIsolatedSplitLoading();
199 
isKillAfterRestore()200     boolean isKillAfterRestore();
201 
isLargeHeap()202     boolean isLargeHeap();
203 
isMultiArch()204     boolean isMultiArch();
205 
isOverlay()206     boolean isOverlay();
207 
isPartiallyDirectBootAware()208     boolean isPartiallyDirectBootAware();
209 
isPersistent()210     boolean isPersistent();
211 
isProfileable()212     boolean isProfileable();
213 
isProfileableByShell()214     boolean isProfileableByShell();
215 
isRequestLegacyExternalStorage()216     boolean isRequestLegacyExternalStorage();
217 
isResizeable()218     boolean isResizeable();
219 
isResizeableActivityViaSdkVersion()220     boolean isResizeableActivityViaSdkVersion();
221 
isRestoreAnyVersion()222     boolean isRestoreAnyVersion();
223 
isStaticSharedLibrary()224     boolean isStaticSharedLibrary();
225 
isSdkLibrary()226     boolean isSdkLibrary();
227 
isSupportsExtraLargeScreens()228     boolean isSupportsExtraLargeScreens();
229 
isSupportsLargeScreens()230     boolean isSupportsLargeScreens();
231 
isSupportsNormalScreens()232     boolean isSupportsNormalScreens();
233 
isSupportsRtl()234     boolean isSupportsRtl();
235 
isSupportsSmallScreens()236     boolean isSupportsSmallScreens();
237 
isTestOnly()238     boolean isTestOnly();
239 
isUseEmbeddedDex()240     boolean isUseEmbeddedDex();
241 
isUsesCleartextTraffic()242     boolean isUsesCleartextTraffic();
243 
isUsesNonSdkApi()244     boolean isUsesNonSdkApi();
245 
isVmSafeMode()246     boolean isVmSafeMode();
247 
248     @NonNull
getActivities()249     List<ParsedActivity> getActivities();
250 
251     @NonNull
getAttributions()252     List<ParsedAttribution> getAttributions();
253 
254     @NonNull
getAdoptPermissions()255     List<String> getAdoptPermissions();
256 
getBaseRevisionCode()257     int getBaseRevisionCode();
258 
getCompileSdkVersion()259     int getCompileSdkVersion();
260 
261     @Nullable
getCompileSdkVersionCodeName()262     String getCompileSdkVersionCodeName();
263 
264     @NonNull
getConfigPreferences()265     List<ConfigurationInfo> getConfigPreferences();
266 
267     @NonNull
getFeatureGroups()268     List<FeatureGroupInfo> getFeatureGroups();
269 
270     @NonNull
getImplicitPermissions()271     List<String> getImplicitPermissions();
272 
273     @NonNull
getInstrumentations()274     List<ParsedInstrumentation> getInstrumentations();
275 
getLongVersionCode()276     long getLongVersionCode();
277 
278     @NonNull
getPackageName()279     String getPackageName();
280 
281     @NonNull
getPermissions()282     List<ParsedPermission> getPermissions();
283 
284     @NonNull
getProviders()285     List<ParsedProvider> getProviders();
286 
287     @NonNull
getReceivers()288     List<ParsedActivity> getReceivers();
289 
290     @NonNull
getRequestedFeatures()291     List<FeatureInfo> getRequestedFeatures();
292 
293     @NonNull
getRequestedPermissions()294     List<String> getRequestedPermissions();
295 
296     @Nullable
getRequiredAccountType()297     String getRequiredAccountType();
298 
299     @Nullable
getRestrictedAccountType()300     String getRestrictedAccountType();
301 
302     @NonNull
getServices()303     List<ParsedService> getServices();
304 
305     @Nullable
getSharedUserId()306     String getSharedUserId();
307 
getSharedUserLabel()308     int getSharedUserLabel();
309 
310     @NonNull
getSplitNames()311     String[] getSplitNames();
312 
313     @NonNull
getSplitRevisionCodes()314     int[] getSplitRevisionCodes();
315 
316     @Nullable
getVersionName()317     String getVersionName();
318 
isRequiredForAllUsers()319     boolean isRequiredForAllUsers();
320 
321     @Nullable
getNativeLibraryDir()322     String getNativeLibraryDir();
323 
324     @Nullable
getNativeLibraryRootDir()325     String getNativeLibraryRootDir();
326 
327     @Nullable
getSecondaryNativeLibraryDir()328     String getSecondaryNativeLibraryDir();
329 
getUid()330     int getUid();
331 
isFactoryTest()332     boolean isFactoryTest();
333 
isNativeLibraryRootRequiresIsa()334     boolean isNativeLibraryRootRequiresIsa();
335 
isOdm()336     boolean isOdm();
337 
isOem()338     boolean isOem();
339 
isPrivileged()340     boolean isPrivileged();
341 
isProduct()342     boolean isProduct();
343 
isSignedWithPlatformKey()344     boolean isSignedWithPlatformKey();
345 
isSystem()346     boolean isSystem();
347 
isSystemExt()348     boolean isSystemExt();
349 
isVendor()350     boolean isVendor();
351 
isCoreApp()352     boolean isCoreApp();
353 
isStub()354     boolean isStub();
355 }
356