RK_android8.1在设置中去掉Bluetooth功能

android8.1去掉蓝牙相关设置:
第1步:/frameworks/base/packages/SettingsProvider/res/values/defaults.xml

     <fraction name="def_window_transition_scale">100%</fraction>
     <bool name="def_haptic_feedback">true</bool>
-    <bool name="def_bluetooth_on">true</bool>
+    <bool name="def_bluetooth_on">false</bool>   //false默认关闭
     <bool name="def_wifi_display_on">false</bool>
     <bool name="def_install_non_market_apps">true</bool>
     <bool name="def_package_verifier_enable">false</bool>

第2步:删除下拉菜单中的bt:
frameworks/base/packages/SystemUI/res/values/config.xml

     <!-- The default tiles to display in QuickSettings -->
     <string name="quick_settings_tiles_default" translatable="false">
-        wifi,bt,dnd,flashlight,rotation,cell,airplane,cast
+        wifi,dnd,flashlight,rotation,cell,airplane,cast
     </string>	

第3步:packages/apps/Settings/res/xml/connected_devices.xml

     android:title="@string/connected_devices_dashboard_title">
-    <com.android.settings.widget.MasterSwitchPreference
+    <!--<com.android.settings.widget.MasterSwitchPreference
       android:key="toggle_bluetooth"
       android:title="@string/bluetooth_settings_title"
       android:icon="@drawable/ic_settings_bluetooth"
-      android:order="-7"/>
+      android:order="-7"/>-->

第4步:packages/apps/Settings/src/com/android/settings/SettingsActivity.java

         somethingChanged = setTileEnabled(new ComponentName(packageName,
                         Settings.BluetoothSettingsActivity.class.getName()),
-                pm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH), isAdmin)
+                false/*pm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)*/, isAdmin)
                 || somethingChanged;
 
         boolean isDataPlanFeatureEnabled = FeatureFactory.getFactory(this)

第5步:packages/apps/Settings/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java

@@ -79,12 +79,12 @@ public class ConnectedDeviceDashboardFragment extends DashboardFragment {
 		controllers.add(new YFcamerafaceSwitchPreferenceController(context, "camera_face_switch"));
 		controllers.add(new YFcameramirrorSwitchPreferenceController(context, "camera_mirror_switch"));
 		controllers.add(new YFcamerarotationPreferenceController(context, "camera_rotation"));
-        final BluetoothMasterSwitchPreferenceController bluetoothPreferenceController =
-                new BluetoothMasterSwitchPreferenceController(
-                        context, Utils.getLocalBtManager(context), this,
-                        (SettingsActivity) getActivity());
-        lifecycle.addObserver(bluetoothPreferenceController);
-        controllers.add(bluetoothPreferenceController);
+        //final BluetoothMasterSwitchPreferenceController bluetoothPreferenceController =
+        //        new BluetoothMasterSwitchPreferenceController(
+        //                context, Utils.getLocalBtManager(context), this,
+        //                (SettingsActivity) getActivity());
+        //lifecycle.addObserver(bluetoothPreferenceController);
+        //controllers.add(bluetoothPreferenceController);


@@ -152,7 +153,7 @@ public class ConnectedDeviceDashboardFragment extends DashboardFragment {
                         keys.add(NfcPreferenceController.KEY_TOGGLE_NFC);
                         keys.add(NfcPreferenceController.KEY_ANDROID_BEAM_SETTINGS);
                     }
-                    keys.add(BluetoothMasterSwitchPreferenceController.KEY_TOGGLE_BLUETOOTH);
+                    //keys.add(BluetoothMasterSwitchPreferenceController.KEY_TOGGLE_BLUETOOTH);
 
                     SmsMirroringFeatureProvider smsMirroringFeaturePro

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值