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