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