Methods Summary |
---|
public static void | addChangeCallback(java.lang.Runnable callback)
synchronized (sChangeCallbacks) {
if (sChangeCallbacks.size() == 0) {
native_add_change_callback();
}
sChangeCallbacks.add(callback);
}
|
static void | callChangeCallbacks()
synchronized (sChangeCallbacks) {
//Log.i("foo", "Calling " + sChangeCallbacks.size() + " change callbacks!");
if (sChangeCallbacks.size() == 0) {
return;
}
ArrayList<Runnable> callbacks = new ArrayList<Runnable>(sChangeCallbacks);
for (int i=0; i<callbacks.size(); i++) {
callbacks.get(i).run();
}
}
|
public static java.lang.String | get(java.lang.String key)Get the value for the given key.
if (key.length() > PROP_NAME_MAX) {
throw new IllegalArgumentException("key.length > " + PROP_NAME_MAX);
}
return native_get(key);
|
public static java.lang.String | get(java.lang.String key, java.lang.String def)Get the value for the given key.
if (key.length() > PROP_NAME_MAX) {
throw new IllegalArgumentException("key.length > " + PROP_NAME_MAX);
}
return native_get(key, def);
|
public static boolean | getBoolean(java.lang.String key, boolean def)Get the value for the given key, returned as a boolean.
Values 'n', 'no', '0', 'false' or 'off' are considered false.
Values 'y', 'yes', '1', 'true' or 'on' are considered true.
(case sensitive).
If the key does not exist, or has any other value, then the default
result is returned.
if (key.length() > PROP_NAME_MAX) {
throw new IllegalArgumentException("key.length > " + PROP_NAME_MAX);
}
return native_get_boolean(key, def);
|
public static int | getInt(java.lang.String key, int def)Get the value for the given key, and return as an integer.
if (key.length() > PROP_NAME_MAX) {
throw new IllegalArgumentException("key.length > " + PROP_NAME_MAX);
}
return native_get_int(key, def);
|
public static long | getLong(java.lang.String key, long def)Get the value for the given key, and return as a long.
if (key.length() > PROP_NAME_MAX) {
throw new IllegalArgumentException("key.length > " + PROP_NAME_MAX);
}
return native_get_long(key, def);
|
private static native void | native_add_change_callback()
|
private static native java.lang.String | native_get(java.lang.String key)
|
private static native java.lang.String | native_get(java.lang.String key, java.lang.String def)
|
private static native boolean | native_get_boolean(java.lang.String key, boolean def)
|
private static native int | native_get_int(java.lang.String key, int def)
|
private static native long | native_get_long(java.lang.String key, long def)
|
private static native void | native_set(java.lang.String key, java.lang.String def)
|
public static void | set(java.lang.String key, java.lang.String val)Set the value for the given key.
if (key.length() > PROP_NAME_MAX) {
throw new IllegalArgumentException("key.length > " + PROP_NAME_MAX);
}
if (val != null && val.length() > PROP_VALUE_MAX) {
throw new IllegalArgumentException("val.length > " +
PROP_VALUE_MAX);
}
native_set(key, val);
|