Class ShadowBuild

java.lang.Object
org.robolectric.shadows.ShadowBuild

@Implements(android.os.Build.class) public class ShadowBuild extends Object
  • Constructor Details

    • ShadowBuild

      public ShadowBuild()
  • Method Details

    • setBoard

      public static void setBoard(String board)
      Sets the value of the Build.BOARD field.

      It will be reset for the next test.

    • setDevice

      public static void setDevice(String device)
      Sets the value of the Build.DEVICE field.

      It will be reset for the next test.

    • setFingerprint

      public static void setFingerprint(String fingerprint)
      Sets the value of the Build.FINGERPRINT field.

      It will be reset for the next test.

    • setId

      public static void setId(String id)
      Sets the value of the Build.ID field.

      It will be reset for the next test.

    • setProduct

      public static void setProduct(String product)
      Sets the value of the Build.PRODUCT field.

      It will be reset for the next test.

    • setDebuggable

      public static void setDebuggable(Boolean isDebuggable)
      Sets the value of the Build.IS_DEBUGGABLE field.

      It will be reset for the next test.

    • setModel

      public static void setModel(String model)
      Sets the value of the Build.MODEL field.

      It will be reset for the next test.

    • setManufacturer

      public static void setManufacturer(String manufacturer)
      Sets the value of the Build.MANUFACTURER field.

      It will be reset for the next test.

    • setBrand

      public static void setBrand(String brand)
      Sets the value of the Build.BRAND field.

      It will be reset for the next test.

    • setHardware

      public static void setHardware(String hardware)
      Sets the value of the Build.HARDWARE field.

      It will be reset for the next test.

    • setSerial

      public static void setSerial(String serial)
      Override return value from Build.getSerial().
    • setVersionCodename

      public static void setVersionCodename(String versionCodename)
      Sets the value of the Build.VERSION.CODENAME field.

      It will be reset for the next test.

    • setVersionIncremental

      public static void setVersionIncremental(String versionIncremental)
      Sets the value of the Build.VERSION.INCREMENTAL field.

      It will be reset for the next test.

    • setVersionMediaPerformanceClass

      public static void setVersionMediaPerformanceClass(int performanceClass)
      Sets the value of the Build.VERSION.MEDIA_PERFORMANCE_CLASS field. Available in Android S+.

      It will be reset for the next test.

    • setVersionRelease

      public static void setVersionRelease(String release)
      Sets the value of the Build.VERSION.RELEASE field.

      It will be reset for the next test.

    • setVersionSecurityPatch

      public static void setVersionSecurityPatch(String securityPatch)
      Sets the value of the Build.VERSION.SECURITY_PATCH field. Available in Android M+.

      It will be reset for the next test.

    • setTags

      public static void setTags(String tags)
      Sets the value of the Build.TAGS field.

      It will be reset for the next test.

    • setType

      public static void setType(String type)
      Sets the value of the Build.TYPE field.

      It will be reset for the next test.

    • setSupported32BitAbis

      public static void setSupported32BitAbis(String[] supported32BitAbis)
      Sets the value of the Build.SUPPORTED_32_BIT_ABIS field.

      It will be reset for the next test.

    • setSupported64BitAbis

      public static void setSupported64BitAbis(String[] supported64BitAbis)
      Sets the value of the Build.SUPPORTED_64_BIT_ABIS field.

      It will be reset for the next test.

    • setSupportedAbis

      public static void setSupportedAbis(String[] supportedAbis)
      Sets the value of the Build.SUPPORTED_ABIS field.

      It will be reset for the next test.

    • setRadioVersion

      public static void setRadioVersion(String radioVersion)
      Override return value from Build.getRadioVersion()
      Parameters:
      radioVersion -
    • setSystemOnChipManufacturer

      public static void setSystemOnChipManufacturer(String systemOnChipManufacturer)
      Sets the value of the Build.SOC_MANUFACTURER field.

      It will be reset for the next test.

      Added in API level 31.

    • setSystemOnChipModel

      public static void setSystemOnChipModel(String systemOnChipModel)
      Sets the value of the Build.SOC_MODEL field.

      It will be reset for the next test.

      Added in API level 31.

    • setOdmSku

      public static void setOdmSku(String odmSku)
      Sets the value of the Build.ODM_SKU field.

      It will be reset for the next test.

      Added in API level 31.

    • getRadioVersion

      @Implementation protected static String getRadioVersion()
    • getSerial

      @Implementation(minSdk=26) protected static String getSerial()
    • reset

      @Resetter public static void reset()