android SystemProperties属性的使用

首先需在system.prop中添加

persist.sys.camera_switch=1

之后需要make后才会在out下面的build.prop中生效,然后重新烧机器,或者调试的时候将build.prop导出来,手动添加,然后再push进去替换,adb shell chmod -R 644 system/build.prop 每次push一次之后,需要运行此命令 否则会开机开不了

然后代码中调用为

import android.os.SystemProperties;

SystemProperties.set("persist.sys.camera_switch","1");  字符不能超过31个,否则会报错
String getState=SystemProperties.get("persist.sys.camera_switch");
发布了49 篇原创文章 · 获赞 13 · 访问量 3万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章