Merge "Add preferences in new connected device page"

This commit is contained in:
TreeHugger Robot
2017-12-01 23:00:20 +00:00
committed by Android (Google) Code Review
5 changed files with 51 additions and 7 deletions

View File

@@ -73,10 +73,20 @@ public class BluetoothPairingDetail extends DeviceListPreferenceFragment impleme
public void onStart() {
super.onStart();
updateContent(mLocalAdapter.getBluetoothState());
updateBluetooth();
mAvailableDevicesCategory.setProgress(mLocalAdapter.isDiscovering());
}
@VisibleForTesting
void updateBluetooth() {
if (mLocalAdapter.isEnabled()) {
updateContent(mLocalAdapter.getBluetoothState());
} else {
// Turn on bluetooth if it is disabled
mLocalAdapter.enable();
}
}
@Override
public void onStop() {
super.onStop();