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