Merge "Ensure settings maintains its Bluetooth device inquiry state" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-07-02 23:02:30 +00:00
committed by Android (Google) Code Review

View File

@@ -229,15 +229,19 @@ public abstract class DeviceListPreferenceFragment extends
@VisibleForTesting @VisibleForTesting
void enableScanning() { void enableScanning() {
// BluetoothAdapter already handles repeated scan requests // BluetoothAdapter already handles repeated scan requests
if (!mScanEnabled) {
startScanning(); startScanning();
mScanEnabled = true; mScanEnabled = true;
} }
}
@VisibleForTesting @VisibleForTesting
void disableScanning() { void disableScanning() {
if (mScanEnabled) {
stopScanning(); stopScanning();
mScanEnabled = false; mScanEnabled = false;
} }
}
@Override @Override
public void onScanningStateChanged(boolean started) { public void onScanningStateChanged(boolean started) {