您有 2 个可以更改的设置数组:
airplane_mode_radios=cell,bluetooth,wifi,nfc,wimax
airplane_mode_toggleable_radios=bluetooth,wifi,nfc
例如,如果您想防止蓝牙在飞行模式下被禁用,
你可以从airplane_mode_radios 删除蓝牙
如果您想阻止蓝牙在之前未启用的情况下启用(是的,有时在您打开然后关闭飞行模式时可能会发生)
所以你可以从airplane_mode_toggleable_radios 中删除蓝牙(如果在飞行模式打开然后关闭之前启用它仍然会启用)
使用亚行:
adb shell settings put global airplane_mode_radios 'cell,wifi,nfc,wimax'
adb shell settings put global airplane_mode_toggleable_radios 'wifi,nfc'
以编程方式使用:
Settings.Global.putString(getContentResolver(), "airplane_mode_radios", "cell,wifi,nfc,wimax");
Settings.Global.putString(getContentResolver(), "airplane_mode_toggleable_radios", "wifi,nfc");
注意:完成后,请重启您的设备