summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/os/SystemProperties.java2
-rw-r--r--core/jni/android_os_SystemProperties.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/os/SystemProperties.java b/core/java/android/os/SystemProperties.java
index 45384105cc8f..7bf1c4b68390 100644
--- a/core/java/android/os/SystemProperties.java
+++ b/core/java/android/os/SystemProperties.java
@@ -184,6 +184,8 @@ public class SystemProperties {
* Set the value for the given {@code key} to {@code val}.
*
* @throws IllegalArgumentException if the {@code val} exceeds 91 characters
+ * @throws RuntimeException if the property cannot be set, for example, if it was blocked by
+ * SELinux. libc will log the underlying reason.
* @hide
*/
@UnsupportedAppUsage
diff --git a/core/jni/android_os_SystemProperties.cpp b/core/jni/android_os_SystemProperties.cpp
index 9ec7517754d9..87f498a710c1 100644
--- a/core/jni/android_os_SystemProperties.cpp
+++ b/core/jni/android_os_SystemProperties.cpp
@@ -109,7 +109,7 @@ void SystemProperties_set(JNIEnv *env, jobject clazz, jstring keyJ,
if (!ConvertKeyAndForward(env, keyJ, true, handler)) {
// Must have been a failure in SetProperty.
jniThrowException(env, "java/lang/RuntimeException",
- "failed to set system property");
+ "failed to set system property (check logcat for reason)");
}
}