MTK Android8.1 系统UI之蓝牙和WiFi开关禁用
- 蓝牙和WIFI的默认配置
vendor/mediatek/proprietary/packages/apps/SettingsProvider/res/values/defaults.xml 修改如下的值即可
<bool name="def_bluetooth_on">true</bool>
<bool name="def_wifi_display_on">false</bool>
- 蓝牙切换开关置灰
vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/bluetooth/BluetoothEnabler.java
void handleStateChanged(int state) {
setChecked(false);
mSwitchWidget.setEnabled(false);
return;
}
- WIFI切换开关置灰
vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/wifi/WifiEnabler.java
void handleWifiStateChanged(int state) {
setSwitchBarChecked(false);
mSwitchWidget.setEnabled(false);
return;
}
- 快捷下拉菜单禁用蓝牙和WiFi开关
vendor/mediatek/proprietary/packages/apps/SystemUI/res/values/config.xml 将下面的wifi, bt 去掉即可。
<string name="quick_settings_tiles_default" translatable="false">
wifi,bt,dnd,flashlight,rotation,battery,cell,airplane,cast,saver,location
</string>
或修改JAVA文件 vendor/mediatek/proprietary/packages/apps/SystemUI//src/com/android/systemui/qs/QSTileHost.java
protected List<String> loadTileSpecs(Context context, String tileList) {
...
if((tiles.size() > 0))
{
Iterator<String> it = tiles.iterator();
while (it.hasNext()){
String s=it.next();
if(s.equals("wifi"))
it.remove();
else if(s.equals("bt"))
it.remove();
}
}
return tiles;
}
|