summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Martijn Coenen <maco@google.com> 2016-11-22 10:00:36 +0000
committer android-build-merger <android-build-merger@google.com> 2016-11-22 10:00:36 +0000
commitd42b1d01ca854ee1abb0dc2973c1fa7ec720a63d (patch)
tree94e7f9e0b41a64846adc0f4a6ae1dd361e78348e
parentf598da48f28b5c2e804959cbd8624d8f94774ab0 (diff)
parent201cf4fb27a42237cc70fba44f05195e6a38e4cb (diff)
Merge "Add SystemProperties.reportSyspropChanged()." am: 45c0c6939f am: 8c05ff96fb
am: 201cf4fb27 Change-Id: Ibd379f588dacbf571948d34d76abb0e6f12f3a79
-rw-r--r--core/java/android/os/SystemProperties.java8
-rw-r--r--core/jni/android_os_SystemProperties.cpp7
2 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/os/SystemProperties.java b/core/java/android/os/SystemProperties.java
index 1479035df978..e47c2380ca83 100644
--- a/core/java/android/os/SystemProperties.java
+++ b/core/java/android/os/SystemProperties.java
@@ -39,6 +39,7 @@ public class SystemProperties
private static native boolean native_get_boolean(String key, boolean def);
private static native void native_set(String key, String def);
private static native void native_add_change_callback();
+ private static native void native_report_sysprop_change();
/**
* Get the value for the given key.
@@ -151,4 +152,11 @@ public class SystemProperties
}
}
}
+
+ /*
+ * Notifies listeners that a system property has changed
+ */
+ public static void reportSyspropChanged() {
+ native_report_sysprop_change();
+ }
}
diff --git a/core/jni/android_os_SystemProperties.cpp b/core/jni/android_os_SystemProperties.cpp
index 5dace6b7e536..8844fb0a261f 100644
--- a/core/jni/android_os_SystemProperties.cpp
+++ b/core/jni/android_os_SystemProperties.cpp
@@ -220,6 +220,11 @@ static void SystemProperties_add_change_callback(JNIEnv *env, jobject clazz)
}
}
+static void SystemProperties_report_sysprop_change(JNIEnv /**env*/, jobject /*clazz*/)
+{
+ report_sysprop_change();
+}
+
static const JNINativeMethod method_table[] = {
{ "native_get", "(Ljava/lang/String;)Ljava/lang/String;",
(void*) SystemProperties_getS },
@@ -235,6 +240,8 @@ static const JNINativeMethod method_table[] = {
(void*) SystemProperties_set },
{ "native_add_change_callback", "()V",
(void*) SystemProperties_add_change_callback },
+ { "native_report_sysprop_change", "()V",
+ (void*) SystemProperties_report_sysprop_change },
};
int register_android_os_SystemProperties(JNIEnv *env)