@Implements(value=android.os.SystemProperties.class, isInAndroidSdk=false) public class ShadowSystemProperties extends java.lang.Object
Constructor and Description |
---|
ShadowSystemProperties() |
Modifier and Type | Method and Description |
---|---|
protected static boolean |
native_get_boolean(java.lang.String key,
boolean def) |
protected static int |
native_get_int(java.lang.String key,
int def) |
protected static long |
native_get_long(java.lang.String key,
long def) |
protected static java.lang.String |
native_get(java.lang.String key) |
protected static java.lang.String |
native_get(java.lang.String key,
java.lang.String def) |
protected static void |
native_set(java.lang.String key,
java.lang.String val) |
static void |
override(java.lang.String key,
java.lang.String val)
Overrides the system property for testing.
|
static void |
reset() |
@Implementation protected static java.lang.String native_get(java.lang.String key)
@Implementation protected static java.lang.String native_get(java.lang.String key, java.lang.String def)
@Implementation protected static int native_get_int(java.lang.String key, int def)
@Implementation protected static long native_get_long(java.lang.String key, long def)
@Implementation protected static boolean native_get_boolean(java.lang.String key, boolean def)
@Implementation protected static void native_set(java.lang.String key, java.lang.String val)
public static void override(java.lang.String key, java.lang.String val)
Overrides the system property for testing. Similar to the Android implementation, the value may be coerced to other types like boolean or long depending on the get method that is used.
Note: Use ShadowBuild
instead for changing fields in Build
.
@Resetter public static void reset()