Android 11.0 飞行模式下禁用NFC功能

11.0产品在测试中发现,打开飞行模式以后,wifi和蓝牙都关闭了,nfc还是能打开的,这也是原生系统的一个bug,客户要求开启飞行模式的时候 禁用nfc,就是
不能打开nfc,既然发现了就必须解决掉这个问题
通过代码发现飞行模式打开后,控制这个的参数就是airplane_mode_toggleable_radios,然后根据这个参数来设置哪些可以打开使用
接下来 看下这个参数
路径:
/frameworks/base/packages/SettingsProvider/res/values/defaults.xml

<string name="airplane_mode_toggleable_radios" translatable="false">bluetooth,wifi,nfc</string>

所以可以去掉nfc 修改为:

&

猜你喜欢

转载自blog.csdn.net/baidu_41666295/article/details/124792285