Android MTK 去掉 Setting 中 Wifi 和 蓝牙


http://blog.csdn.net/mr_kings/article/details/51802609


    //去除SystemUI下拉中的 wifi和Bluetooth开关选项  
    frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\phone\ QuickSettings.java  
      private void addWifiTile(ViewGroup parent, LayoutInflater inflater) {  
      
    //Remove wifi systemUI lhw start   
           // if (!FeatureOption.MTK_WLAN_SUPPORT) {  
           if (FeatureOption.MTK_WLAN_SUPPORT) {  
           //Remove wifi systemUI lhw end  
                wifiTile.setVisibility(View.GONE);  
            }  
      
    private void addBluetoothTile(ViewGroup parent, LayoutInflater inflater) {  
      
    if (mModel.deviceSupportsBluetooth()  
                    && FeatureOption.MTK_BT_SUPPORT) {  
                   //Remove bluetooth systemUI lhw start   
                   //parent.addView(bluetoothTile);  
                 //  parent.removeView(view);  
                   bluetoothTile.setVisibility(View.GONE);  
                 //Remove bluetooth systemUI lhw start   
            }  
    //去掉Setting 中的 wifi 和蓝牙 条目  
    packages\apps\Settings\src\com\android\settings\Settings.java  
    //根据判断获取当前是否支持该属性 进行移除 逆向处理  
      private void updateHeaderList(List<Header> target) {  
       } else if (id == R.id.wifi_settings) {  
                    // Remove WiFi Settings if WiFi service is not available.  
                     //Remove WIFI Settings lhw start  
                    //if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {  
                    if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {  
             target.remove(i);  
                        //Remove WIFI Settings lhw end  
    } else if (id == R.id.bluetooth_settings) {  
                    // Remove Bluetooth Settings if Bluetooth service is not available.  
                    //Remove Bluetooth Settings lhw start  
                    if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {  
                    //if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {  
                   //Remove Bluetooth Settings lhw end  
                        target.remove(i);  


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值