SystemProperties_Delegatepublic class SystemProperties_Delegate extends Object Delegate implementing the native methods of android.os.SystemProperties
Through the layoutlib_create tool, the original native methods of SystemProperties have been
replaced by calls to methods of the same name in this delegate class.
Because it's a stateless class to start with, there's no need to keep a {@link DelegateManager}
around to map int to instance of the delegate. |
Methods Summary |
---|
static void | native_add_change_callback()
// pass.
| static java.lang.String | native_get(java.lang.String key)
return native_get(key, "");
| static java.lang.String | native_get(java.lang.String key, java.lang.String def)
Map<String, String> properties = Bridge.getPlatformProperties();
String value = properties.get(key);
if (value != null) {
return value;
}
return def;
| static boolean | native_get_boolean(java.lang.String key, boolean def)Values 'n', 'no', '0', 'false' or 'off' are considered false.
Values 'y', 'yes', '1', 'true' or 'on' are considered true.
Map<String, String> properties = Bridge.getPlatformProperties();
String value = properties.get(key);
if ("n".equals(value) || "no".equals(value) || "0".equals(value) || "false".equals(value)
|| "off".equals(value)) {
return false;
}
//noinspection SimplifiableIfStatement
if ("y".equals(value) || "yes".equals(value) || "1".equals(value) || "true".equals(value)
|| "on".equals(value)) {
return true;
}
return def;
| static int | native_get_int(java.lang.String key, int def)
Map<String, String> properties = Bridge.getPlatformProperties();
String value = properties.get(key);
if (value != null) {
return Integer.decode(value);
}
return def;
| static long | native_get_long(java.lang.String key, long def)
Map<String, String> properties = Bridge.getPlatformProperties();
String value = properties.get(key);
if (value != null) {
return Long.decode(value);
}
return def;
| static void | native_set(java.lang.String key, java.lang.String def)
Map<String, String> properties = Bridge.getPlatformProperties();
properties.put(key, def);
|
|