安卓的settings共有三个表:
global:所有的偏好设置对系统的所有用户公开,第三方APP只能读,无写权限;
system:包含各种各样的用户偏好系统设置;
secure:安全性的用户偏好系统设置,第三方APP只能读,无写权限
settingsSettings provider (settings) commands:helpPrint this help text.get [--user <USER_ID> | current] NAMESPACE KEYRetrieve the current value of KEY.put [--user <USER_ID> | current] NAMESPACE KEY VALUE [TAG] [default]Change the contents of KEY to VALUE.TAG to associate with the setting.{default} to set as the default, case-insensitive only for global/secure namespacedelete [--user <USER_ID> | current] NAMESPACE KEYDelete the entry for KEY.reset [--user <USER_ID> | current] NAMESPACE {PACKAGE_NAME | RESET_MODE}Reset the global/secure table for a package with mode.RESET_MODE is one of {untrusted_defaults, untrusted_clear, trusted_defaults}, case-insensitivelist [--user <USER_ID> | current] NAMESPACEPrint all defined keys.NAMESPACE is one of {system, secure, global}, case-insensitive
全屏沉浸:
adb shell settings put global policy_control immersive.full=*
沉浸状态栏:
adb shell settings put global policy_control immersive.status=*
沉浸导航栏:
adb shell settings put global policy_control immersive.navigation=*
单独控制哪些app不沉浸,例如以下代码设置TIM不沉浸,其他程序沉浸:
adb shell settings put global policy_control immersive.full=apps,-com.tencent.tim,
如果想恢复到正常模式,运行下面的代码:
adb shell settings put global policy_control null
若要将导航栏完全隐藏(上划不会唤出):
adb shell wm overscan 0,0,0,-210 //如果无效 可以修改数字大小 或者方向
四个数字分别表示 左、上、右、下距边缘的距离(根据需求调整)
恢复
adb shell wm overscan 0,0,0,0