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