• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2008 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 android.test.mock;
18 
19 import android.annotation.NonNull;
20 import android.annotation.Nullable;
21 import android.annotation.UserIdInt;
22 import android.app.PackageInstallObserver;
23 import android.content.ComponentName;
24 import android.content.Intent;
25 import android.content.IntentFilter;
26 import android.content.IntentSender;
27 import android.content.pm.ActivityInfo;
28 import android.content.pm.ApplicationInfo;
29 import android.content.pm.ChangedPackages;
30 import android.content.pm.FeatureInfo;
31 import android.content.pm.IPackageDataObserver;
32 import android.content.pm.IPackageDeleteObserver;
33 import android.content.pm.IPackageStatsObserver;
34 import android.content.pm.InstantAppInfo;
35 import android.content.pm.InstrumentationInfo;
36 import android.content.pm.IntentFilterVerificationInfo;
37 import android.content.pm.KeySet;
38 import android.content.pm.PackageInfo;
39 import android.content.pm.PackageInstaller;
40 import android.content.pm.PackageItemInfo;
41 import android.content.pm.PackageManager;
42 import android.content.pm.PermissionGroupInfo;
43 import android.content.pm.PermissionInfo;
44 import android.content.pm.ProviderInfo;
45 import android.content.pm.ResolveInfo;
46 import android.content.pm.ServiceInfo;
47 import android.content.pm.SharedLibraryInfo;
48 import android.content.pm.VerifierDeviceIdentity;
49 import android.content.pm.VersionedPackage;
50 import android.content.pm.dex.ArtManager;
51 import android.content.res.Resources;
52 import android.content.res.XmlResourceParser;
53 import android.graphics.Rect;
54 import android.graphics.drawable.Drawable;
55 import android.net.Uri;
56 import android.os.Handler;
57 import android.os.PersistableBundle;
58 import android.os.UserHandle;
59 import android.os.storage.VolumeInfo;
60 
61 import java.util.List;
62 
63 /**
64  * A mock {@link android.content.pm.PackageManager} class.  All methods are non-functional and throw
65  * {@link java.lang.UnsupportedOperationException}. Override it to provide the operations that you
66  * need.
67  *
68  * @deprecated Use a mocking framework like <a href="https://github.com/mockito/mockito">Mockito</a>.
69  * New tests should be written using the
70  * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
71  */
72 @Deprecated
73 public class MockPackageManager extends PackageManager {
74 
75     @Override
getPackageInfo(String packageName, int flags)76     public PackageInfo getPackageInfo(String packageName, int flags) throws NameNotFoundException {
77         throw new UnsupportedOperationException();
78     }
79 
80     @Override
getPackageInfo(VersionedPackage versionedPackage, int flags)81     public PackageInfo getPackageInfo(VersionedPackage versionedPackage,
82             int flags) throws NameNotFoundException {
83         throw new UnsupportedOperationException();
84     }
85 
86     /** @hide */
87     @Override
getPackageInfoAsUser(String packageName, int flags, int userId)88     public PackageInfo getPackageInfoAsUser(String packageName, int flags, int userId)
89             throws NameNotFoundException {
90         throw new UnsupportedOperationException();
91     }
92 
93     @Override
currentToCanonicalPackageNames(String[] names)94     public String[] currentToCanonicalPackageNames(String[] names) {
95         throw new UnsupportedOperationException();
96     }
97 
98     @Override
canonicalToCurrentPackageNames(String[] names)99     public String[] canonicalToCurrentPackageNames(String[] names) {
100         throw new UnsupportedOperationException();
101     }
102 
103     @Override
getLaunchIntentForPackage(String packageName)104     public Intent getLaunchIntentForPackage(String packageName) {
105         throw new UnsupportedOperationException();
106     }
107 
108     @Override
getLeanbackLaunchIntentForPackage(String packageName)109     public Intent getLeanbackLaunchIntentForPackage(String packageName) {
110         throw new UnsupportedOperationException();
111     }
112 
113     /** @hide */
114     @Override
getCarLaunchIntentForPackage(String packageName)115     public Intent getCarLaunchIntentForPackage(String packageName) {
116         throw new UnsupportedOperationException();
117     }
118 
119     @Override
getPackageGids(String packageName)120     public int[] getPackageGids(String packageName) throws NameNotFoundException {
121         throw new UnsupportedOperationException();
122     }
123 
124     @Override
getPackageGids(String packageName, int flags)125     public int[] getPackageGids(String packageName, int flags) throws NameNotFoundException {
126         throw new UnsupportedOperationException();
127     }
128 
129     @Override
getPackageUid(String packageName, int flags)130     public int getPackageUid(String packageName, int flags) throws NameNotFoundException {
131         throw new UnsupportedOperationException();
132     }
133 
134     /** @hide */
135     @Override
getPackageUidAsUser(String packageName, int flags, int userHandle)136     public int getPackageUidAsUser(String packageName, int flags, int userHandle)
137             throws NameNotFoundException {
138         throw new UnsupportedOperationException();
139     }
140 
141     /** @hide */
142     @Override
getPackageUidAsUser(String packageName, int userHandle)143     public int getPackageUidAsUser(String packageName, int userHandle)
144             throws NameNotFoundException {
145         throw new UnsupportedOperationException();
146     }
147 
148     @Override
getPermissionInfo(String name, int flags)149     public PermissionInfo getPermissionInfo(String name, int flags)
150     throws NameNotFoundException {
151         throw new UnsupportedOperationException();
152     }
153 
154     @Override
queryPermissionsByGroup(String group, int flags)155     public List<PermissionInfo> queryPermissionsByGroup(String group, int flags)
156             throws NameNotFoundException {
157         throw new UnsupportedOperationException();
158     }
159 
160     /** @hide */
161     @Override
isPermissionReviewModeEnabled()162     public boolean isPermissionReviewModeEnabled() {
163         return false;
164     }
165 
166     @Override
getPermissionGroupInfo(String name, int flags)167     public PermissionGroupInfo getPermissionGroupInfo(String name,
168             int flags) throws NameNotFoundException {
169         throw new UnsupportedOperationException();
170     }
171 
172     @Override
getAllPermissionGroups(int flags)173     public List<PermissionGroupInfo> getAllPermissionGroups(int flags) {
174         throw new UnsupportedOperationException();
175     }
176 
177     @Override
getApplicationInfo(String packageName, int flags)178     public ApplicationInfo getApplicationInfo(String packageName, int flags)
179             throws NameNotFoundException {
180         throw new UnsupportedOperationException();
181     }
182 
183     /** @hide */
184     @Override
getApplicationInfoAsUser(String packageName, int flags, int userId)185     public ApplicationInfo getApplicationInfoAsUser(String packageName, int flags, int userId)
186             throws NameNotFoundException {
187         throw new UnsupportedOperationException();
188     }
189 
190     @Override
getActivityInfo(ComponentName className, int flags)191     public ActivityInfo getActivityInfo(ComponentName className, int flags)
192     throws NameNotFoundException {
193         throw new UnsupportedOperationException();
194     }
195 
196     @Override
getReceiverInfo(ComponentName className, int flags)197     public ActivityInfo getReceiverInfo(ComponentName className, int flags)
198     throws NameNotFoundException {
199         throw new UnsupportedOperationException();
200     }
201 
202     @Override
getServiceInfo(ComponentName className, int flags)203     public ServiceInfo getServiceInfo(ComponentName className, int flags)
204     throws NameNotFoundException {
205         throw new UnsupportedOperationException();
206     }
207 
208     @Override
getProviderInfo(ComponentName className, int flags)209     public ProviderInfo getProviderInfo(ComponentName className, int flags)
210     throws NameNotFoundException {
211         throw new UnsupportedOperationException();
212     }
213 
214     @Override
getInstalledPackages(int flags)215     public List<PackageInfo> getInstalledPackages(int flags) {
216         throw new UnsupportedOperationException();
217     }
218 
219     @Override
getPackagesHoldingPermissions(String[] permissions, int flags)220     public List<PackageInfo> getPackagesHoldingPermissions(String[] permissions,
221             int flags) {
222         throw new UnsupportedOperationException();
223     }
224 
225     /** @hide */
226     @Override
getInstalledPackagesAsUser(int flags, int userId)227     public List<PackageInfo> getInstalledPackagesAsUser(int flags, int userId) {
228         throw new UnsupportedOperationException();
229     }
230 
231     @Override
checkPermission(String permName, String pkgName)232     public int checkPermission(String permName, String pkgName) {
233         throw new UnsupportedOperationException();
234     }
235 
236     @Override
canRequestPackageInstalls()237     public boolean canRequestPackageInstalls() {
238         throw new UnsupportedOperationException();
239     }
240 
241     @Override
isPermissionRevokedByPolicy(String permName, String pkgName)242     public boolean isPermissionRevokedByPolicy(String permName, String pkgName) {
243         throw new UnsupportedOperationException();
244     }
245 
246     /** @hide */
247     @Override
getPermissionControllerPackageName()248     public String getPermissionControllerPackageName() {
249         throw new UnsupportedOperationException();
250     }
251 
252     @Override
addPermission(PermissionInfo info)253     public boolean addPermission(PermissionInfo info) {
254         throw new UnsupportedOperationException();
255     }
256 
257     @Override
addPermissionAsync(PermissionInfo info)258     public boolean addPermissionAsync(PermissionInfo info) {
259         throw new UnsupportedOperationException();
260     }
261 
262     @Override
removePermission(String name)263     public void removePermission(String name) {
264         throw new UnsupportedOperationException();
265     }
266 
267     /** @hide */
268     @Override
grantRuntimePermission(String packageName, String permissionName, UserHandle user)269     public void grantRuntimePermission(String packageName, String permissionName,
270             UserHandle user) {
271         throw new UnsupportedOperationException();
272     }
273 
274     /** @hide */
275     @Override
revokeRuntimePermission(String packageName, String permissionName, UserHandle user)276     public void revokeRuntimePermission(String packageName, String permissionName,
277             UserHandle user) {
278         throw new UnsupportedOperationException();
279     }
280 
281     /** @hide */
282     @Override
getPermissionFlags(String permissionName, String packageName, UserHandle user)283     public int getPermissionFlags(String permissionName, String packageName, UserHandle user) {
284         throw new UnsupportedOperationException();
285     }
286 
287     /** @hide */
288     @Override
updatePermissionFlags(String permissionName, String packageName, int flagMask, int flagValues, UserHandle user)289     public void updatePermissionFlags(String permissionName, String packageName,
290             int flagMask, int flagValues, UserHandle user) {
291         throw new UnsupportedOperationException();
292     }
293 
294     /** @hide */
295     @Override
shouldShowRequestPermissionRationale(String permission)296     public boolean shouldShowRequestPermissionRationale(String permission) {
297         throw new UnsupportedOperationException();
298     }
299 
300     /** @hide */
301     @Override
addOnPermissionsChangeListener(OnPermissionsChangedListener listener)302     public void addOnPermissionsChangeListener(OnPermissionsChangedListener listener) {
303         throw new UnsupportedOperationException();
304     }
305 
306     /** @hide */
307     @Override
removeOnPermissionsChangeListener(OnPermissionsChangedListener listener)308     public void removeOnPermissionsChangeListener(OnPermissionsChangedListener listener) {
309         throw new UnsupportedOperationException();
310     }
311 
312     @Override
checkSignatures(String pkg1, String pkg2)313     public int checkSignatures(String pkg1, String pkg2) {
314         throw new UnsupportedOperationException();
315     }
316 
317     @Override
checkSignatures(int uid1, int uid2)318     public int checkSignatures(int uid1, int uid2) {
319         throw new UnsupportedOperationException();
320     }
321 
322     @Override
getPackagesForUid(int uid)323     public String[] getPackagesForUid(int uid) {
324         throw new UnsupportedOperationException();
325     }
326 
327     @Override
getNameForUid(int uid)328     public String getNameForUid(int uid) {
329         throw new UnsupportedOperationException();
330     }
331 
332     /** @hide */
333     @Override
getNamesForUids(int uid[])334     public String[] getNamesForUids(int uid[]) {
335         throw new UnsupportedOperationException();
336     }
337 
338     /**
339      * @hide - to match hiding in superclass
340      */
341     @Override
getUidForSharedUser(String sharedUserName)342     public int getUidForSharedUser(String sharedUserName) {
343         throw new UnsupportedOperationException();
344     }
345 
346     @Override
getInstalledApplications(int flags)347     public List<ApplicationInfo> getInstalledApplications(int flags) {
348         throw new UnsupportedOperationException();
349     }
350 
351     /** @hide */
352     @Override
getInstalledApplicationsAsUser(int flags, int userId)353     public List<ApplicationInfo> getInstalledApplicationsAsUser(int flags, int userId) {
354         throw new UnsupportedOperationException();
355     }
356 
357     /** @hide */
358     @Override
getInstantApps()359     public List<InstantAppInfo> getInstantApps() {
360         throw new UnsupportedOperationException();
361     }
362 
363     /** @hide */
364     @Override
getInstantAppIcon(String packageName)365     public Drawable getInstantAppIcon(String packageName) {
366         throw new UnsupportedOperationException();
367     }
368 
369     /** @hide */
370     @Override
getInstantAppCookie()371     public byte[] getInstantAppCookie() {
372         throw new UnsupportedOperationException();
373     }
374 
375     /** @hide */
376     @Override
isInstantApp()377     public boolean isInstantApp() {
378         throw new UnsupportedOperationException();
379     }
380 
381     /** @hide */
382     @Override
isInstantApp(String packageName)383     public boolean isInstantApp(String packageName) {
384         throw new UnsupportedOperationException();
385     }
386 
387     /** @hide */
388     @Override
getInstantAppCookieMaxBytes()389     public int getInstantAppCookieMaxBytes() {
390         throw new UnsupportedOperationException();
391     }
392 
393     /** @hide */
394     @Override
getInstantAppCookieMaxSize()395     public int getInstantAppCookieMaxSize() {
396         throw new UnsupportedOperationException();
397     }
398 
399     /** @hide */
400     @Override
clearInstantAppCookie()401     public void clearInstantAppCookie() {
402         throw new UnsupportedOperationException();
403     }
404 
405     /** @hide */
406     @Override
updateInstantAppCookie(@onNull byte[] cookie)407     public void updateInstantAppCookie(@NonNull byte[] cookie) {
408         throw new UnsupportedOperationException();
409     }
410 
411     /** @hide */
412     @Override
setInstantAppCookie(@onNull byte[] cookie)413     public boolean setInstantAppCookie(@NonNull byte[] cookie) {
414         throw new UnsupportedOperationException();
415     }
416 
417     /** @hide */
418     @Override
getChangedPackages(int sequenceNumber)419     public ChangedPackages getChangedPackages(int sequenceNumber) {
420         throw new UnsupportedOperationException();
421     }
422 
423     @Override
resolveActivity(Intent intent, int flags)424     public ResolveInfo resolveActivity(Intent intent, int flags) {
425         throw new UnsupportedOperationException();
426     }
427 
428     /** @hide */
429     @Override
resolveActivityAsUser(Intent intent, int flags, int userId)430     public ResolveInfo resolveActivityAsUser(Intent intent, int flags, int userId) {
431         throw new UnsupportedOperationException();
432     }
433 
434     @Override
queryIntentActivities(Intent intent, int flags)435     public List<ResolveInfo> queryIntentActivities(Intent intent, int flags) {
436         throw new UnsupportedOperationException();
437     }
438 
439     /** @hide */
440     @Override
queryIntentActivitiesAsUser(Intent intent, int flags, int userId)441     public List<ResolveInfo> queryIntentActivitiesAsUser(Intent intent,
442                                                    int flags, int userId) {
443         throw new UnsupportedOperationException();
444     }
445 
446     @Override
queryIntentActivityOptions(ComponentName caller, Intent[] specifics, Intent intent, int flags)447     public List<ResolveInfo> queryIntentActivityOptions(ComponentName caller,
448             Intent[] specifics, Intent intent, int flags) {
449         throw new UnsupportedOperationException();
450     }
451 
452     @Override
queryBroadcastReceivers(Intent intent, int flags)453     public List<ResolveInfo> queryBroadcastReceivers(Intent intent, int flags) {
454         throw new UnsupportedOperationException();
455     }
456 
457     /** @hide */
458     @Override
queryBroadcastReceiversAsUser(Intent intent, int flags, int userId)459     public List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, int flags, int userId) {
460         throw new UnsupportedOperationException();
461     }
462 
463     @Override
resolveService(Intent intent, int flags)464     public ResolveInfo resolveService(Intent intent, int flags) {
465         throw new UnsupportedOperationException();
466     }
467 
468     @Override
resolveServiceAsUser(Intent intent, int flags, int userId)469     public ResolveInfo resolveServiceAsUser(Intent intent, int flags, int userId) {
470         throw new UnsupportedOperationException();
471     }
472 
473     @Override
queryIntentServices(Intent intent, int flags)474     public List<ResolveInfo> queryIntentServices(Intent intent, int flags) {
475         throw new UnsupportedOperationException();
476     }
477 
478     /** @hide */
479     @Override
queryIntentServicesAsUser(Intent intent, int flags, int userId)480     public List<ResolveInfo> queryIntentServicesAsUser(Intent intent, int flags, int userId) {
481         throw new UnsupportedOperationException();
482     }
483 
484     /** @hide */
485     @Override
queryIntentContentProvidersAsUser( Intent intent, int flags, int userId)486     public List<ResolveInfo> queryIntentContentProvidersAsUser(
487             Intent intent, int flags, int userId) {
488         throw new UnsupportedOperationException();
489     }
490 
491     @Override
queryIntentContentProviders(Intent intent, int flags)492     public List<ResolveInfo> queryIntentContentProviders(Intent intent, int flags) {
493         throw new UnsupportedOperationException();
494     }
495 
496     @Override
resolveContentProvider(String name, int flags)497     public ProviderInfo resolveContentProvider(String name, int flags) {
498         throw new UnsupportedOperationException();
499     }
500 
501     /** @hide */
502     @Override
resolveContentProviderAsUser(String name, int flags, int userId)503     public ProviderInfo resolveContentProviderAsUser(String name, int flags, int userId) {
504         throw new UnsupportedOperationException();
505     }
506 
507     @Override
queryContentProviders(String processName, int uid, int flags)508     public List<ProviderInfo> queryContentProviders(String processName, int uid, int flags) {
509         throw new UnsupportedOperationException();
510     }
511 
512     @Override
getInstrumentationInfo(ComponentName className, int flags)513     public InstrumentationInfo getInstrumentationInfo(ComponentName className, int flags)
514     throws NameNotFoundException {
515         throw new UnsupportedOperationException();
516     }
517 
518     @Override
queryInstrumentation( String targetPackage, int flags)519     public List<InstrumentationInfo> queryInstrumentation(
520             String targetPackage, int flags) {
521         throw new UnsupportedOperationException();
522     }
523 
524     @Override
getDrawable(String packageName, int resid, ApplicationInfo appInfo)525     public Drawable getDrawable(String packageName, int resid, ApplicationInfo appInfo) {
526         throw new UnsupportedOperationException();
527     }
528 
529     @Override
getActivityIcon(ComponentName activityName)530     public Drawable getActivityIcon(ComponentName activityName)
531     throws NameNotFoundException {
532         throw new UnsupportedOperationException();
533     }
534 
535     @Override
getActivityIcon(Intent intent)536     public Drawable getActivityIcon(Intent intent) throws NameNotFoundException {
537         throw new UnsupportedOperationException();
538     }
539 
540     @Override
getDefaultActivityIcon()541     public Drawable getDefaultActivityIcon() {
542         throw new UnsupportedOperationException();
543     }
544 
545     @Override
getActivityBanner(ComponentName activityName)546     public Drawable getActivityBanner(ComponentName activityName)
547             throws NameNotFoundException {
548         throw new UnsupportedOperationException();
549     }
550 
551     @Override
getActivityBanner(Intent intent)552     public Drawable getActivityBanner(Intent intent) throws NameNotFoundException {
553         throw new UnsupportedOperationException();
554     }
555 
556     @Override
getApplicationBanner(ApplicationInfo info)557     public Drawable getApplicationBanner(ApplicationInfo info) {
558         throw new UnsupportedOperationException();
559     }
560 
561     @Override
getApplicationBanner(String packageName)562     public Drawable getApplicationBanner(String packageName) throws NameNotFoundException {
563         throw new UnsupportedOperationException();
564     }
565 
566     @Override
getApplicationIcon(ApplicationInfo info)567     public Drawable getApplicationIcon(ApplicationInfo info) {
568         throw new UnsupportedOperationException();
569     }
570 
571     @Override
getApplicationIcon(String packageName)572     public Drawable getApplicationIcon(String packageName) throws NameNotFoundException {
573         throw new UnsupportedOperationException();
574     }
575 
576     @Override
getActivityLogo(ComponentName activityName)577     public Drawable getActivityLogo(ComponentName activityName) throws NameNotFoundException {
578         throw new UnsupportedOperationException();
579     }
580 
581     @Override
getActivityLogo(Intent intent)582     public Drawable getActivityLogo(Intent intent) throws NameNotFoundException {
583         throw new UnsupportedOperationException();
584     }
585 
586     @Override
getApplicationLogo(ApplicationInfo info)587     public Drawable getApplicationLogo(ApplicationInfo info) {
588         throw new UnsupportedOperationException();
589     }
590 
591     @Override
getApplicationLogo(String packageName)592     public Drawable getApplicationLogo(String packageName) throws NameNotFoundException {
593         throw new UnsupportedOperationException();
594     }
595 
596     @Override
getUserBadgedIcon(Drawable icon, UserHandle user)597     public Drawable getUserBadgedIcon(Drawable icon, UserHandle user) {
598         throw new UnsupportedOperationException();
599     }
600 
601     @Override
getUserBadgedDrawableForDensity(Drawable drawable, UserHandle user, Rect badgeLocation, int badgeDensity)602     public Drawable getUserBadgedDrawableForDensity(Drawable drawable, UserHandle user,
603             Rect badgeLocation,
604             int badgeDensity) {
605         throw new UnsupportedOperationException();
606     }
607 
608     /** @hide */
609     @Override
getUserBadgeForDensity(UserHandle user, int density)610     public Drawable getUserBadgeForDensity(UserHandle user, int density) {
611         throw new UnsupportedOperationException();
612     }
613 
614     /** @hide */
615     @Override
getUserBadgeForDensityNoBackground(UserHandle user, int density)616     public Drawable getUserBadgeForDensityNoBackground(UserHandle user, int density) {
617         throw new UnsupportedOperationException();
618     }
619 
620     @Override
getUserBadgedLabel(CharSequence label, UserHandle user)621     public CharSequence getUserBadgedLabel(CharSequence label, UserHandle user) {
622         throw new UnsupportedOperationException();
623     }
624 
625     @Override
getText(String packageName, int resid, ApplicationInfo appInfo)626     public CharSequence getText(String packageName, int resid, ApplicationInfo appInfo) {
627         throw new UnsupportedOperationException();
628     }
629 
630     @Override
getXml(String packageName, int resid, ApplicationInfo appInfo)631     public XmlResourceParser getXml(String packageName, int resid,
632             ApplicationInfo appInfo) {
633         throw new UnsupportedOperationException();
634     }
635 
636     @Override
getApplicationLabel(ApplicationInfo info)637     public CharSequence getApplicationLabel(ApplicationInfo info) {
638         throw new UnsupportedOperationException();
639     }
640 
641     @Override
getResourcesForActivity(ComponentName activityName)642     public Resources getResourcesForActivity(ComponentName activityName)
643     throws NameNotFoundException {
644         throw new UnsupportedOperationException();
645     }
646 
647     @Override
getResourcesForApplication(ApplicationInfo app)648     public Resources getResourcesForApplication(ApplicationInfo app) {
649         throw new UnsupportedOperationException();
650     }
651 
652     @Override
getResourcesForApplication(String appPackageName)653     public Resources getResourcesForApplication(String appPackageName)
654     throws NameNotFoundException {
655         throw new UnsupportedOperationException();
656     }
657 
658     /** @hide */
659     @Override
getResourcesForApplicationAsUser(String appPackageName, int userId)660     public Resources getResourcesForApplicationAsUser(String appPackageName, int userId) {
661         throw new UnsupportedOperationException();
662     }
663 
664     @Override
getPackageArchiveInfo(String archiveFilePath, int flags)665     public PackageInfo getPackageArchiveInfo(String archiveFilePath, int flags) {
666         throw new UnsupportedOperationException();
667     }
668 
669     @Override
setInstallerPackageName(String targetPackage, String installerPackageName)670     public void setInstallerPackageName(String targetPackage,
671             String installerPackageName) {
672         throw new UnsupportedOperationException();
673     }
674 
675     /** @hide */
676     @Override
setUpdateAvailable(String packageName, boolean updateAvailable)677     public void setUpdateAvailable(String packageName, boolean updateAvailable) {
678         throw new UnsupportedOperationException();
679     }
680 
681     @Override
getInstallerPackageName(String packageName)682     public String getInstallerPackageName(String packageName) {
683         throw new UnsupportedOperationException();
684     }
685 
686     /** {@hide} */
687     @Override
getMoveStatus(int moveId)688     public int getMoveStatus(int moveId) {
689         throw new UnsupportedOperationException();
690     }
691 
692     /** {@hide} */
693     @Override
registerMoveCallback(MoveCallback callback, Handler handler)694     public void registerMoveCallback(MoveCallback callback, Handler handler) {
695         throw new UnsupportedOperationException();
696     }
697 
698     /** {@hide} */
699     @Override
unregisterMoveCallback(MoveCallback callback)700     public void unregisterMoveCallback(MoveCallback callback) {
701         throw new UnsupportedOperationException();
702     }
703 
704     /** {@hide} */
705     @Override
movePackage(String packageName, VolumeInfo vol)706     public int movePackage(String packageName, VolumeInfo vol) {
707         throw new UnsupportedOperationException();
708     }
709 
710     /** {@hide} */
711     @Override
getPackageCurrentVolume(ApplicationInfo app)712     public VolumeInfo getPackageCurrentVolume(ApplicationInfo app) {
713         throw new UnsupportedOperationException();
714     }
715 
716     /** {@hide} */
717     @Override
getPackageCandidateVolumes(ApplicationInfo app)718     public List<VolumeInfo> getPackageCandidateVolumes(ApplicationInfo app) {
719         throw new UnsupportedOperationException();
720     }
721 
722     /** {@hide} */
723     @Override
movePrimaryStorage(VolumeInfo vol)724     public int movePrimaryStorage(VolumeInfo vol) {
725         throw new UnsupportedOperationException();
726     }
727 
728     /** {@hide} */
729     @Override
getPrimaryStorageCurrentVolume()730     public VolumeInfo getPrimaryStorageCurrentVolume() {
731         throw new UnsupportedOperationException();
732     }
733 
734     /** {@hide} */
735     @Override
getPrimaryStorageCandidateVolumes()736     public List<VolumeInfo> getPrimaryStorageCandidateVolumes() {
737         throw new UnsupportedOperationException();
738     }
739 
740     /**
741      * @hide - to match hiding in superclass
742      */
743     @Override
clearApplicationUserData( String packageName, IPackageDataObserver observer)744     public void clearApplicationUserData(
745             String packageName, IPackageDataObserver observer) {
746         throw new UnsupportedOperationException();
747     }
748 
749     /**
750      * @hide - to match hiding in superclass
751      */
752     @Override
deleteApplicationCacheFiles( String packageName, IPackageDataObserver observer)753     public void deleteApplicationCacheFiles(
754             String packageName, IPackageDataObserver observer) {
755         throw new UnsupportedOperationException();
756     }
757 
758     /**
759      * @hide - to match hiding in superclass
760      */
761     @Override
deleteApplicationCacheFilesAsUser(String packageName, int userId, IPackageDataObserver observer)762     public void deleteApplicationCacheFilesAsUser(String packageName, int userId,
763             IPackageDataObserver observer) {
764         throw new UnsupportedOperationException();
765     }
766 
767     /** {@hide} */
768     @Override
freeStorageAndNotify(String volumeUuid, long idealStorageSize, IPackageDataObserver observer)769     public void freeStorageAndNotify(String volumeUuid, long idealStorageSize,
770             IPackageDataObserver observer) {
771         throw new UnsupportedOperationException();
772     }
773 
774     /** {@hide} */
775     @Override
freeStorage(String volumeUuid, long idealStorageSize, IntentSender pi)776     public void freeStorage(String volumeUuid, long idealStorageSize, IntentSender pi) {
777         throw new UnsupportedOperationException();
778     }
779 
780     /**
781      * @hide - to match hiding in superclass
782      */
783     @Override
deletePackage(String packageName, IPackageDeleteObserver observer, int flags)784     public void deletePackage(String packageName, IPackageDeleteObserver observer, int flags) {
785         throw new UnsupportedOperationException();
786     }
787 
788     /**
789      * @hide - to match hiding in superclass
790      */
791     @Override
deletePackageAsUser(String packageName, IPackageDeleteObserver observer, int flags, int userId)792     public void deletePackageAsUser(String packageName, IPackageDeleteObserver observer,
793             int flags, int userId) {
794         throw new UnsupportedOperationException();
795     }
796 
797     @Override
addPackageToPreferred(String packageName)798     public void addPackageToPreferred(String packageName) {
799         throw new UnsupportedOperationException();
800     }
801 
802     @Override
removePackageFromPreferred(String packageName)803     public void removePackageFromPreferred(String packageName) {
804         throw new UnsupportedOperationException();
805     }
806 
807     @Override
getPreferredPackages(int flags)808     public List<PackageInfo> getPreferredPackages(int flags) {
809         throw new UnsupportedOperationException();
810     }
811 
812     @Override
setComponentEnabledSetting(ComponentName componentName, int newState, int flags)813     public void setComponentEnabledSetting(ComponentName componentName,
814             int newState, int flags) {
815         throw new UnsupportedOperationException();
816     }
817 
818     @Override
getComponentEnabledSetting(ComponentName componentName)819     public int getComponentEnabledSetting(ComponentName componentName) {
820         throw new UnsupportedOperationException();
821     }
822 
823     @Override
setApplicationEnabledSetting(String packageName, int newState, int flags)824     public void setApplicationEnabledSetting(String packageName, int newState, int flags) {
825         throw new UnsupportedOperationException();
826     }
827 
828     @Override
getApplicationEnabledSetting(String packageName)829     public int getApplicationEnabledSetting(String packageName) {
830         throw new UnsupportedOperationException();
831     }
832 
833     /** @hide */
834     @Override
flushPackageRestrictionsAsUser(int userId)835     public void flushPackageRestrictionsAsUser(int userId) {
836         throw new UnsupportedOperationException();
837     }
838 
839     @Override
addPreferredActivity(IntentFilter filter, int match, ComponentName[] set, ComponentName activity)840     public void addPreferredActivity(IntentFilter filter,
841             int match, ComponentName[] set, ComponentName activity) {
842         throw new UnsupportedOperationException();
843     }
844 
845     /**
846      * @hide - to match hiding in superclass
847      */
848     @Override
replacePreferredActivity(IntentFilter filter, int match, ComponentName[] set, ComponentName activity)849     public void replacePreferredActivity(IntentFilter filter,
850             int match, ComponentName[] set, ComponentName activity) {
851         throw new UnsupportedOperationException();
852     }
853 
854 
855     @Override
clearPackagePreferredActivities(String packageName)856     public void clearPackagePreferredActivities(String packageName) {
857         throw new UnsupportedOperationException();
858     }
859 
860     /**
861      * @hide - to match hiding in superclass
862      */
863     @Override
getPackageSizeInfoAsUser(String packageName, int userHandle, IPackageStatsObserver observer)864     public void getPackageSizeInfoAsUser(String packageName, int userHandle,
865             IPackageStatsObserver observer) {
866         throw new UnsupportedOperationException();
867     }
868 
869     @Override
getPreferredActivities(List<IntentFilter> outFilters, List<ComponentName> outActivities, String packageName)870     public int getPreferredActivities(List<IntentFilter> outFilters,
871             List<ComponentName> outActivities, String packageName) {
872         throw new UnsupportedOperationException();
873     }
874 
875     /** @hide - hidden in superclass */
876     @Override
getHomeActivities(List<ResolveInfo> outActivities)877     public ComponentName getHomeActivities(List<ResolveInfo> outActivities) {
878         throw new UnsupportedOperationException();
879     }
880 
881     @Override
getSystemSharedLibraryNames()882     public String[] getSystemSharedLibraryNames() {
883         throw new UnsupportedOperationException();
884     }
885 
886     @Override
getSharedLibraries(int flags)887     public @NonNull List<SharedLibraryInfo> getSharedLibraries(int flags) {
888         throw new UnsupportedOperationException();
889     }
890 
891     /** @hide */
892     @Override
getSharedLibrariesAsUser(int flags, int userId)893     public @NonNull List<SharedLibraryInfo> getSharedLibrariesAsUser(int flags, int userId) {
894         throw new UnsupportedOperationException();
895     }
896 
897     /** @hide */
898     @Override
getServicesSystemSharedLibraryPackageName()899     public @NonNull String getServicesSystemSharedLibraryPackageName() {
900         throw new UnsupportedOperationException();
901     }
902 
903     /** @hide */
904     @Override
getSharedSystemSharedLibraryPackageName()905     public @NonNull String getSharedSystemSharedLibraryPackageName() {
906         throw new UnsupportedOperationException();
907     }
908 
909     @Override
getSystemAvailableFeatures()910     public FeatureInfo[] getSystemAvailableFeatures() {
911         throw new UnsupportedOperationException();
912     }
913 
914     @Override
hasSystemFeature(String name)915     public boolean hasSystemFeature(String name) {
916         throw new UnsupportedOperationException();
917     }
918 
919     @Override
hasSystemFeature(String name, int version)920     public boolean hasSystemFeature(String name, int version) {
921         throw new UnsupportedOperationException();
922     }
923 
924     @Override
isSafeMode()925     public boolean isSafeMode() {
926         throw new UnsupportedOperationException();
927     }
928 
929     /** @hide */
930     @Override
getKeySetByAlias(String packageName, String alias)931     public KeySet getKeySetByAlias(String packageName, String alias) {
932         throw new UnsupportedOperationException();
933     }
934 
935     /** @hide */
936     @Override
getSigningKeySet(String packageName)937     public KeySet getSigningKeySet(String packageName) {
938         throw new UnsupportedOperationException();
939     }
940 
941     /** @hide */
942     @Override
isSignedBy(String packageName, KeySet ks)943     public boolean isSignedBy(String packageName, KeySet ks) {
944         throw new UnsupportedOperationException();
945     }
946 
947     /** @hide */
948     @Override
isSignedByExactly(String packageName, KeySet ks)949     public boolean isSignedByExactly(String packageName, KeySet ks) {
950         throw new UnsupportedOperationException();
951     }
952 
953     /** @hide */
954     @Override
setPackagesSuspended(String[] packageNames, boolean hidden, PersistableBundle appExtras, PersistableBundle launcherExtras, String dialogMessage)955     public String[] setPackagesSuspended(String[] packageNames, boolean hidden,
956             PersistableBundle appExtras, PersistableBundle launcherExtras, String dialogMessage) {
957         throw new UnsupportedOperationException();
958     }
959 
960     /** @hide */
961     @Override
isPackageSuspendedForUser(String packageName, int userId)962     public boolean isPackageSuspendedForUser(String packageName, int userId) {
963         throw new UnsupportedOperationException();
964     }
965 
966     /** @hide */
967     @Override
setApplicationCategoryHint(String packageName, int categoryHint)968     public void setApplicationCategoryHint(String packageName, int categoryHint) {
969         throw new UnsupportedOperationException();
970     }
971 
972     /**
973      * @hide
974      */
975     @Override
setApplicationHiddenSettingAsUser(String packageName, boolean hidden, UserHandle user)976     public boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden,
977             UserHandle user) {
978         return false;
979     }
980 
981     /**
982      * @hide
983      */
984     @Override
getApplicationHiddenSettingAsUser(String packageName, UserHandle user)985     public boolean getApplicationHiddenSettingAsUser(String packageName, UserHandle user) {
986         return false;
987     }
988 
989     /**
990      * @hide
991      */
992     @Override
installExistingPackage(String packageName)993     public int installExistingPackage(String packageName) throws NameNotFoundException {
994         throw new UnsupportedOperationException();
995     }
996 
997     /**
998      * @hide
999      */
1000     @Override
installExistingPackage(String packageName, int installReason)1001     public int installExistingPackage(String packageName, int installReason)
1002             throws NameNotFoundException {
1003         throw new UnsupportedOperationException();
1004     }
1005 
1006     /**
1007      * @hide
1008      */
1009     @Override
installExistingPackageAsUser(String packageName, int userId)1010     public int installExistingPackageAsUser(String packageName, int userId)
1011             throws NameNotFoundException {
1012         throw new UnsupportedOperationException();
1013     }
1014 
1015     @Override
verifyPendingInstall(int id, int verificationCode)1016     public void verifyPendingInstall(int id, int verificationCode) {
1017         throw new UnsupportedOperationException();
1018     }
1019 
1020     @Override
extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay)1021     public void extendVerificationTimeout(int id, int verificationCodeAtTimeout,
1022             long millisecondsToDelay) {
1023         throw new UnsupportedOperationException();
1024     }
1025 
1026     /**
1027      * @hide
1028      */
1029     @Override
verifyIntentFilter(int id, int verificationCode, List<String> outFailedDomains)1030     public void verifyIntentFilter(int id, int verificationCode, List<String> outFailedDomains) {
1031         throw new UnsupportedOperationException();
1032     }
1033 
1034     /**
1035      * @hide
1036      */
1037     @Override
getIntentVerificationStatusAsUser(String packageName, int userId)1038     public int getIntentVerificationStatusAsUser(String packageName, int userId) {
1039         throw new UnsupportedOperationException();
1040     }
1041 
1042     /**
1043      * @hide
1044      */
1045     @Override
updateIntentVerificationStatusAsUser(String packageName, int status, int userId)1046     public boolean updateIntentVerificationStatusAsUser(String packageName, int status, int userId) {
1047         throw new UnsupportedOperationException();
1048     }
1049 
1050     /**
1051      * @hide
1052      */
1053     @Override
getIntentFilterVerifications(String packageName)1054     public List<IntentFilterVerificationInfo> getIntentFilterVerifications(String packageName) {
1055         throw new UnsupportedOperationException();
1056     }
1057 
1058     @Override
getAllIntentFilters(String packageName)1059     public List<IntentFilter> getAllIntentFilters(String packageName) {
1060         throw new UnsupportedOperationException();
1061     }
1062 
1063     /** {@removed} */
1064     @Deprecated
getDefaultBrowserPackageName(int userId)1065     public String getDefaultBrowserPackageName(int userId) {
1066         throw new UnsupportedOperationException();
1067     }
1068 
1069     /** {@hide} */
1070     @Override
getDefaultBrowserPackageNameAsUser(int userId)1071     public String getDefaultBrowserPackageNameAsUser(int userId) {
1072         throw new UnsupportedOperationException();
1073     }
1074 
1075     /** {@removed} */
1076     @Deprecated
setDefaultBrowserPackageName(String packageName, int userId)1077     public boolean setDefaultBrowserPackageName(String packageName, int userId) {
1078         throw new UnsupportedOperationException();
1079     }
1080 
1081     /** {@hide} */
1082     @Override
setDefaultBrowserPackageNameAsUser(String packageName, int userId)1083     public boolean setDefaultBrowserPackageNameAsUser(String packageName, int userId) {
1084         throw new UnsupportedOperationException();
1085     }
1086 
1087     /**
1088      * @hide
1089      */
1090     @Override
getVerifierDeviceIdentity()1091     public VerifierDeviceIdentity getVerifierDeviceIdentity() {
1092         throw new UnsupportedOperationException();
1093     }
1094 
1095     /**
1096      * @hide
1097      */
1098     @Override
isUpgrade()1099     public boolean isUpgrade() {
1100         throw new UnsupportedOperationException();
1101     }
1102 
1103     /**
1104      * @hide
1105      */
1106     @Override
addCrossProfileIntentFilter(IntentFilter filter, int sourceUserId, int targetUserId, int flags)1107     public void addCrossProfileIntentFilter(IntentFilter filter, int sourceUserId, int targetUserId,
1108             int flags) {
1109         throw new UnsupportedOperationException();
1110     }
1111 
1112     /**
1113      * @hide
1114      */
1115     @Override
clearCrossProfileIntentFilters(int sourceUserId)1116     public void clearCrossProfileIntentFilters(int sourceUserId) {
1117         throw new UnsupportedOperationException();
1118     }
1119 
1120     /** {@hide} */
getPackageInstaller()1121     public PackageInstaller getPackageInstaller() {
1122         throw new UnsupportedOperationException();
1123     }
1124 
1125     /** {@hide} */
1126     @Override
isPackageAvailable(String packageName)1127     public boolean isPackageAvailable(String packageName) {
1128         throw new UnsupportedOperationException();
1129     }
1130 
1131     /**
1132      * @hide
1133      */
loadItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo)1134     public Drawable loadItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo) {
1135         throw new UnsupportedOperationException();
1136     }
1137 
1138     /**
1139      * @hide
1140      */
loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo)1141     public Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo) {
1142         throw new UnsupportedOperationException();
1143     }
1144 
1145     /**
1146      * @hide
1147      */
getInstallReason(String packageName, UserHandle user)1148     public int getInstallReason(String packageName, UserHandle user) {
1149         throw new UnsupportedOperationException();
1150     }
1151 
1152     /**
1153      * @hide
1154      */
1155     @Override
getInstantAppResolverSettingsComponent()1156     public ComponentName getInstantAppResolverSettingsComponent() {
1157         throw new UnsupportedOperationException();
1158     }
1159 
1160     /**
1161      * @hide
1162      */
1163     @Override
getInstantAppInstallerComponent()1164     public ComponentName getInstantAppInstallerComponent() {
1165         throw new UnsupportedOperationException();
1166     }
1167 
1168     /**
1169      * @hide
1170      */
getInstantAppAndroidId(String packageName, UserHandle user)1171     public String getInstantAppAndroidId(String packageName, UserHandle user) {
1172         throw new UnsupportedOperationException();
1173     }
1174 
1175     /**
1176      * @hide
1177      */
1178     @Override
registerDexModule(String dexModulePath, @Nullable DexModuleRegisterCallback callback)1179     public void registerDexModule(String dexModulePath,
1180             @Nullable DexModuleRegisterCallback callback) {
1181         throw new UnsupportedOperationException();
1182     }
1183 
1184     /**
1185      * @hide
1186      */
1187     @Override
getArtManager()1188     public ArtManager getArtManager() {
1189         throw new UnsupportedOperationException();
1190     }
1191 
1192     /**
1193      * @hide
1194      */
1195     @Override
setHarmfulAppWarning(String packageName, CharSequence warning)1196     public void setHarmfulAppWarning(String packageName, CharSequence warning) {
1197         throw new UnsupportedOperationException();
1198     }
1199 
1200     /**
1201      * @hide
1202      */
1203     @Override
getHarmfulAppWarning(String packageName)1204     public CharSequence getHarmfulAppWarning(String packageName) {
1205         throw new UnsupportedOperationException();
1206     }
1207 
1208     @Override
hasSigningCertificate( String packageName, byte[] certificate, @PackageManager.CertificateInputType int type)1209     public boolean hasSigningCertificate(
1210             String packageName, byte[] certificate, @PackageManager.CertificateInputType int type) {
1211         throw new UnsupportedOperationException();
1212     }
1213 
1214     @Override
hasSigningCertificate( int uid, byte[] certificate, @PackageManager.CertificateInputType int type)1215     public boolean hasSigningCertificate(
1216             int uid, byte[] certificate, @PackageManager.CertificateInputType int type) {
1217         throw new UnsupportedOperationException();
1218     }
1219 
1220     /**
1221      * @hide
1222      */
1223     @Override
getSystemTextClassifierPackageName()1224     public String getSystemTextClassifierPackageName() {
1225         throw new UnsupportedOperationException();
1226     }
1227 }
1228