failed to set system property

时间:2024-03-24 15:39:31

        android8.1系统应用在使用SystemProperties.set(String key, String value)时报java.lang.RuntimeException: failed to set system property错误,修改方式如下:(原文内容是:SystemProperties.set("persist.vendor.debug.camera.picture.flip", "1");)

failed to set system property

修改内容:

failed to set system property

diff --git a/prebuilts/api/26.0/private/property_contexts b/prebuilts/api/26.0/private/property_contexts
index 4c27b35..c596f04 100644 (file)
--- a/prebuilts/api/26.0/private/property_contexts
+++ b/prebuilts/api/26.0/private/property_contexts

@@ -57,6 +57,7 @@ persist.sys.audit_safemode      u:object_r:safemode_prop:s0
 persist.service.        u:object_r:system_prop:s0
 persist.service.bdroid. u:object_r:bluetooth_prop:s0
 persist.security.       u:object_r:system_prop:s0
+persist.vendor.         u:object_r:system_prop:s0
 persist.vendor.overlay.  u:object_r:overlay_prop:s0
 ro.boot.vendor.overlay.  u:object_r:overlay_prop:s0
 ro.boottime.             u:object_r:boottime_prop:s0

 

diff --git a/private/property_contexts b/private/property_contexts
index 8eb2f28..714da7a 100644 (file)
--- a/private/property_contexts
+++ b/private/property_contexts

@@ -58,6 +58,7 @@ persist.sys.audit_safemode      u:object_r:safemode_prop:s0
 persist.service.        u:object_r:system_prop:s0
 persist.service.bdroid. u:object_r:bluetooth_prop:s0
 persist.security.       u:object_r:system_prop:s0
+persist.vendor.         u:object_r:system_prop:s0
 persist.vendor.overlay.  u:object_r:overlay_prop:s0
 ro.boot.vendor.overlay.  u:object_r:overlay_prop:s0
 ro.boottime.             u:object_r:boottime_prop:s0