Android 10.0 移除wifi功能及相关菜单

介绍

客户的机器没有wifi功能,所以需要删除wifi相关的菜单,主要有设置-网络和互联网-WLAN,长按桌面设置弹出的WALN快捷方式,长按桌面-微件-设置-WLAN。

修改

Android10 上直接将config_show_wifi_settings改为false,这样wifi菜单的入口就隐藏了

路径:vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/config.xml

XML 复制代码
    <!-- Whether Wi-Fi settings should be shown or not.
    This also controls whether Wi-fi related sub-settings (e.g. Wi-Fi preferences) will
    surface in search results or not.-->
    <bool name="config_show_wifi_settings">false</bool>

移除长按设置弹出的WALN菜单项

路径:vendor/mediatek/proprietary/packages/apps/MtkSettings/res/xml/shortcuts.xml

XML 复制代码
<!--Soda Water.20250217 rm wifi
    <shortcut
        android:shortcutId="manifest-shortcut-wifi"
        android:icon="@drawable/ic_shortcut_wireless"
        android:shortcutShortLabel="@string/wifi_settings" >
        <intent android:action="android.settings.WIFI_SETTINGS" />
    </shortcut>
-->

移除长按桌面微件设置中的WALN

路径:vendor/mediatek/proprietary/packages/apps/MtkSettings/AndroidManifest.xml

XML 复制代码
        <activity
            android:name="Settings$WifiSettingsActivity"
            android:label="@string/wifi_settings"
            android:icon="@drawable/ic_settings_wireless"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:parentActivityName="Settings">
<!--Soda Water.2025021 rm wifi
            <intent-filter android:priority="1">
                <action android:name="android.settings.WIFI_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter android:priority="1">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="com.android.settings.SHORTCUT" />
            </intent-filter>
            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                android:value="com.android.settings.wifi.WifiSettings" />
            <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
                android:value="true" />
-->
        </activity>

最后移除下拉栏中的wifi入口

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

XML 复制代码
    <string name="quick_settings_tiles_default" translatable="false">
        bt,dnd,flashlight,rotation,battery,cell,airplane,cast,location,screenrecord,supershot,custom(com.google.android.gms/.nearby.sharing.SharingTileService)
    </string>

    <string name="quick_settings_tiles_stock" translatable="false">
        cell,battery,dnd,flashlight,rotation,bt,airplane,location,screenrecord,supershot,hotspot,inversion,saver,dark,work,cast,night,custom(com.google.android.gms/.nearby.sharing.SharingTileService)
    </string>
相关推荐
whatever who cares几秒前
android:实现圆角效果
android
程序员麻辣烫8 分钟前
晋升系列4:学习方法
java·数据库·程序人生·学习方法
爱学习的小王!15 分钟前
有关MyBatis的动态SQL
java·笔记·sql·学习·mybatis
斑鸠喳喳17 分钟前
模块系统 JPMS
java·后端
苦逼的老王19 分钟前
java之uniapp实现门店地图
java·开发语言·uni-app
austin流川枫20 分钟前
如何基于缓存设计实现一个商品最近搜索记录功能
java·redis
无际单片机编程44 分钟前
单片机OTA升级中Bootloader怎么判断APP有没有问题?
java·stm32·单片机·嵌入式硬件·嵌入式
A boy CDEF girl1 小时前
【JavaEE】多线程进阶(2)
java·java-ee
我真的不会C1 小时前
Mysql表的复合查询
java·数据库·mysql