Merge "Make Bluetooth settings page can be discoverable"
This commit is contained in:
committed by
Android (Google) Code Review
commit
4f9595a88d
@@ -46,6 +46,9 @@ public class BluetoothSwitchPreferenceController
|
||||
private Context mContext;
|
||||
private FooterPreference mFooterPreference;
|
||||
|
||||
@VisibleForTesting
|
||||
AlwaysDiscoverable mAlwaysDiscoverable;
|
||||
|
||||
public BluetoothSwitchPreferenceController(Context context,
|
||||
SwitchWidgetController switchController,
|
||||
FooterPreference footerPreference) {
|
||||
@@ -69,11 +72,13 @@ public class BluetoothSwitchPreferenceController
|
||||
SettingsEnums.ACTION_SETTINGS_MASTER_SWITCH_BLUETOOTH_TOGGLE,
|
||||
mRestrictionUtils);
|
||||
mBluetoothEnabler.setToggleCallback(this);
|
||||
mAlwaysDiscoverable = new AlwaysDiscoverable(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
mBluetoothEnabler.resume(mContext);
|
||||
mAlwaysDiscoverable.start();
|
||||
if (mSwitch != null) {
|
||||
updateText(mSwitch.isChecked());
|
||||
}
|
||||
@@ -82,6 +87,7 @@ public class BluetoothSwitchPreferenceController
|
||||
@Override
|
||||
public void onStop() {
|
||||
mBluetoothEnabler.pause();
|
||||
mAlwaysDiscoverable.stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user