• Android 9.0 屏蔽设备的WLAN功能


    Android 9.0 屏蔽设备的WLAN功能

    最近接到需求反馈,想要屏蔽设备的WLAN功能,具体修改参照如下:

    /vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/bools.xml

    1. <!-- Whether Wi-Fi settings should be shown or not.
    2. This also controls whether Wi-fi related sub-settings (e.g. Wi-Fi preferences) will
    3. surface in search results or not.-->
    4. - <bool name="config_show_wifi_settings">true</bool>
    5. + <bool name="config_show_wifi_settings">false</bool>

    另外一级菜单“网络和互联网”的 summary 也要调整,将WLAN字样去除,具体修改参照如下:

    /vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/network/NetworkDashboardFragment.java

    1. public void setListening(boolean listening) {
    2. if (listening) {
    3. /*/
    4. String summary = BidiFormatter.getInstance()
    5. .unicodeWrap(mContext.getString(R.string.wifi_settings_title));
    6. if (mMobileNetworkPreferenceController.isAvailable()) {
    7. final String mobileSettingSummary = mContext.getString(
    8. R.string.network_dashboard_summary_mobile);
    9. //*/
    10. String summary = BidiFormatter.getInstance()
    11. .unicodeWrap(mContext.getString(R.string.network_dashboard_summary_mobile));
    12. //}
    13. //*/

    下拉状态栏中对应WLAN功能的quick setting图标也需要屏蔽掉:

    /vendor/mediatek/proprietary/packages/apps/SystemUI/res/values/config.xml

    1. <string name="quick_settings_tiles_default" translatable="false">
    2. - wifi,bt,dnd,flashlight,rotation,cell,airplane,cast,location,screenrecord
    3. + bt,dnd,flashlight,rotation,cell,airplane,cast,location,screenrecord
    4. </string>
    5. <string name="quick_settings_tiles_stock" translatable="false">
    6. - wifi,cell,dnd,flashlight,rotation,bt,airplane,location,screenrecord,hotspot,inversion,saver,work,cast,night
    7. + cell,dnd,flashlight,rotation,bt,airplane,location,screenrecord,hotspot,inversion,saver,work,cast,night
    8. </string>

    重新编译验证,修改生效,设备WLAN功能已屏蔽

  • 相关阅读:
    Minio入门系列【7】Spring Boot集成Minio
    Targeting S+ (version 31 and above) requires that an explicit value for android
    单片机论文参考:1、基于单片机的电子琴
    【java】【项目实战】[外卖十二]【完结】项目优化(前后端分离开发)
    Stable Diffusion WebUI 控制网络 ControlNet 插件实现精准控图-详细教程
    我的创作纪念日
    数据结构--图
    【AGC】如何创建自定义应用内消息
    redis中value/SortedSet
    Pytorch基础:Tensor的reshape方法
  • 原文地址:https://blog.csdn.net/Jeffries_C/article/details/134423900