Create BluetoothSwitchPreference

In the new design, bluetooth preference is not MasterSwitchPreference
any more. This cl creates BluetoothSwitchPreference while reuse the
BluetoothEnabler.

Future cl will remove the BluetoothMasterSwitchPreference when P
feature is finalized.

Bug: 69333961
Test: RunSettingsRoboTests
Change-Id: Ie1f934b4e93a6758a1b0cf83bb5098585a635c2a
This commit is contained in:
jackqdyulei
2017-12-04 13:57:31 -08:00
parent 988199e202
commit d055937664
6 changed files with 305 additions and 6 deletions

View File

@@ -24,6 +24,7 @@ import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.bluetooth.BluetoothFilesPreferenceController;
import com.android.settings.bluetooth.BluetoothMasterSwitchPreferenceController;
import com.android.settings.bluetooth.BluetoothSwitchPreferenceController;
import com.android.settings.bluetooth.Utils;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.deviceinfo.UsbBackend;
@@ -83,10 +84,8 @@ public class AdvancedConnectedDeviceDashboardFragment extends DashboardFragment
mUsbPrefController = new UsbModePreferenceController(context, new UsbBackend(context));
lifecycle.addObserver(mUsbPrefController);
controllers.add(mUsbPrefController);
final BluetoothMasterSwitchPreferenceController bluetoothPreferenceController =
new BluetoothMasterSwitchPreferenceController(
context, Utils.getLocalBtManager(context), this,
(SettingsActivity) getActivity());
final BluetoothSwitchPreferenceController bluetoothPreferenceController =
new BluetoothSwitchPreferenceController(context);
lifecycle.addObserver(bluetoothPreferenceController);
controllers.add(bluetoothPreferenceController);