当前位置:   article > 正文

android Settings系统的三种数据属性及其adb修改指令_settings.global.getstring

settings.global.getstring

android Settings系统属性,共分三种:
1.global:所有的偏好设置对系统的所有用户公开,第三方APP有读没有写的权限;

2.system:包含各种各样的用户偏好系统设置

3.secure:安全性的用户偏好系统设置,第三方APP有读没有写的权限。


在java语言中的读写形式如下
//System
Settings.System.putInt(getActivity().getContentResolver(), "sound_effects_enabled", 1);

Settings.System.getInt(getActivity().getContentResolver(), "sound_effects_enabled", 1);

//Global
Settings.Global.getString(ActivityThread.currentApplication().getContentResolver(), "disable_list");

adb修改指令 举例

案例一

修改系统的全局变量
adb shell settings put global disable_list “kr.co.homematics.unoplus;com.google.android.youtube.tv”

列出global配置表中的所有属性值
adb shell
settings list global

检索对应的属性值
settings list global |grep disable

取出指定配置表中指定属性值
settings get global disable_list

设置(不存在就添加)属性值
settings put

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/正经夜光杯/article/detail/891840
推荐阅读
相关标签
  

闽ICP备14008679号