FileDocCategorySizeDatePackage
SystemProperties_Delegate.javaAPI DocAndroid 5.1 API3435Thu Mar 12 22:22:44 GMT 2015android.os

SystemProperties_Delegate

public 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.

Fields Summary
Constructors Summary
Methods Summary
static voidnative_add_change_callback()

        // pass.
    
static java.lang.Stringnative_get(java.lang.String key)

        return native_get(key, "");
    
static java.lang.Stringnative_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 booleannative_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 intnative_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 longnative_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 voidnative_set(java.lang.String key, java.lang.String def)

        Map<String, String> properties = Bridge.getPlatformProperties();
        properties.put(key, def);