Index: device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java |
diff --git a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java |
index 0774ea2401b20049095213c710fc17c5970db0a5..51cb5c5c7cbc8390c940946c59631466271b854d 100644 |
--- a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java |
+++ b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java |
@@ -200,6 +200,9 @@ final class ChromeBluetoothAdapter { |
} catch (IllegalArgumentException e) { |
Log.e(TAG, "Cannot start scan: " + e); |
return false; |
+ } catch (IllegalStateException e) { |
scheib
2016/01/21 05:33:51
Add a test:
- In Fakes.java have FakeBluetoothLeSc
|
+ Log.e(TAG, "Adapter is off. Cannot start scan: " + e); |
+ return false; |
} |
return true; |
} |
@@ -218,6 +221,10 @@ final class ChromeBluetoothAdapter { |
Log.e(TAG, "Cannot stop scan: " + e); |
mScanCallback = null; |
return false; |
+ } catch (IllegalStateException e) { |
+ Log.e(TAG, "Adapter is off. Cannot stop scan: " + e); |
+ mScanCallback = null; |
+ return false; |
} |
mScanCallback = null; |
return true; |