@Implements(value=android.os.Build.class) public class ShadowBuild extends Object
Modifier and Type | Field and Description |
---|---|
static int |
Q
Temporary constant that maps to Build.VERSION_CODES.Q.
|
Constructor and Description |
---|
ShadowBuild() |
Modifier and Type | Method and Description |
---|---|
protected static String |
getRadioVersion() |
protected static String |
getSerial() |
static void |
reset() |
static void |
setDevice(String device)
Sets the value of the
Build.DEVICE field. |
static void |
setFingerprint(String fingerprint)
Sets the value of the
Build.FINGERPRINT field. |
static void |
setId(String id)
Sets the value of the
Build.ID field. |
static void |
setManufacturer(String manufacturer)
Sets the value of the
Build.MANUFACTURER field. |
static void |
setModel(String model)
Sets the value of the
Build.MODEL field. |
static void |
setRadioVersion(String radioVersion)
Override return value from
Build.getRadioVersion() |
static void |
setSupported64BitAbis(String[] supported64BitAbis)
Sets the value of the
Build.SUPPORTED_64_BIT_ABIS field. |
static void |
setTags(String tags)
Sets the value of the
Build.TAGS field. |
static void |
setType(String type)
Sets the value of the
Build.TYPE field. |
static void |
setVersionCodename(String versionCodename)
Sets the value of the
Build.VERSION#CODENAME field. |
static void |
setVersionIncremental(String versionIncremental)
Sets the value of the
Build.VERSION#INCREMENTAL field. |
static void |
setVersionRelease(String release)
Sets the value of the
Build.VERSION#RELEASE field. |
public static final int Q
Temporary constant that maps to Build.VERSION_CODES.Q. Useful for projects that still compile against P but want to explicitly run tests on Q.
public static void setDevice(String device)
Sets the value of the Build.DEVICE
field.
It will be reset for the next test.
public static void setFingerprint(String fingerprint)
Sets the value of the Build.FINGERPRINT
field.
It will be reset for the next test.
public static void setId(String id)
Sets the value of the Build.ID
field.
It will be reset for the next test.
public static void setModel(String model)
Sets the value of the Build.MODEL
field.
It will be reset for the next test.
public static void setManufacturer(String manufacturer)
Sets the value of the Build.MANUFACTURER
field.
It will be reset for the next test.
public static void setVersionCodename(String versionCodename)
Sets the value of the Build.VERSION#CODENAME
field.
It will be reset for the next test.
public static void setVersionIncremental(String versionIncremental)
Sets the value of the Build.VERSION#INCREMENTAL
field.
It will be reset for the next test.
public static void setVersionRelease(String release)
Sets the value of the Build.VERSION#RELEASE
field.
It will be reset for the next test.
public static void setTags(String tags)
Sets the value of the Build.TAGS
field.
It will be reset for the next test.
public static void setType(String type)
Sets the value of the Build.TYPE
field.
It will be reset for the next test.
public static void setSupported64BitAbis(String[] supported64BitAbis)
Sets the value of the Build.SUPPORTED_64_BIT_ABIS
field. Available in Android L+.
It will be reset for the next test.
public static void setRadioVersion(String radioVersion)
Override return value from Build.getRadioVersion()
radioVersion
- @Implementation protected static String getRadioVersion()
@Implementation(minSdk=26) protected static String getSerial()
@Resetter public static void reset()