Annotation Type GetInstallerPackageNameMode


@Documented @Retention(RUNTIME) @Target({PACKAGE,TYPE,METHOD}) public @interface GetInstallerPackageNameMode
A Configurer annotation for controlling how Robolectric executes PackageManager#getInstallerPackageName method.

'getInstallerPackageName' method in PackageManager must throw IllegalArgumentException if the installer package is not present. The legacy robolectric behavior returns a null value for these cases.

This annotation can be applied to tests to have Robolectric perform the legacy mechanism of not throwing IllegalArgumentException and instead return 'null', when installer package name is not found.

This annotation will be deleted in a forthcoming Robolectric release.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Specifies the different ShadowApplicationPackageManager#getInstallerPackageName modes.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Optional string for storing the issue / bug id tracking the fixing of the affected tests and thus removal of this annotation.
  • Element Details

    • issueId

      String issueId
      Optional string for storing the issue / bug id tracking the fixing of the affected tests and thus removal of this annotation.
      Default:
      ""