Class ShadowPackageBackwardCompatibility

java.lang.Object
org.robolectric.shadows.ShadowPackageBackwardCompatibility

@Implements(className="android.content.pm.PackageBackwardCompatibility", maxSdk=28) public class ShadowPackageBackwardCompatibility extends Object
Shadow of PackageBackwardCompatibility to handle a scenario that can come up when multiple Android versions end up on the classpath
  • Constructor Details

    • ShadowPackageBackwardCompatibility

      public ShadowPackageBackwardCompatibility()
  • Method Details

    • addOptionalUpdater

      @Implementation protected static boolean addOptionalUpdater(List<com.android.server.pm.parsing.library.PackageSharedLibraryUpdater> packageUpdaters, String className, Supplier<com.android.server.pm.parsing.library.PackageSharedLibraryUpdater> defaultUpdater)
      Stubbing this out as if Android S+ is on the classpath, we'll get a ClassCastException instead of a ClassNotFoundException. Since we don't really need this logic, simpler to just skip it