diff options
| author | 2019-09-19 23:59:07 -0700 | |
|---|---|---|
| committer | 2019-09-19 23:59:07 -0700 | |
| commit | 60311e153fe945623c810738e70557dd85b9333f (patch) | |
| tree | 2fd9693b4891cee30e0fd758ce218f05fb84474b | |
| parent | e927ca91ad26f479bdfa2509fdf8687e066c57c6 (diff) | |
| parent | 1a8cd03fbcd83d90240fe9b2f670268b55b27438 (diff) | |
Merge "Document that SystemProperties.set() can throw RuntimeException" am: 6265eea819 am: 14a2b65e4e am: f5269ed927
am: 1a8cd03fbc
Change-Id: I05c785b6f4d653c6f7911765bd2e2b9043488f1a
| -rw-r--r-- | core/java/android/os/SystemProperties.java | 2 | ||||
| -rw-r--r-- | core/jni/android_os_SystemProperties.cpp | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/os/SystemProperties.java b/core/java/android/os/SystemProperties.java index cdae72ebd313..b6af82948da3 100644 --- a/core/java/android/os/SystemProperties.java +++ b/core/java/android/os/SystemProperties.java @@ -189,6 +189,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 ab5231425b6d..cfdf26abc25c 100644 --- a/core/jni/android_os_SystemProperties.cpp +++ b/core/jni/android_os_SystemProperties.cpp @@ -108,7 +108,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)"); } } |