Skip to content

Commit 4ee14a7

Browse files
authored
Merge pull request #456 from swetha-thoomoju/master
#455 on BT state OFF stopping scan for Android version 6.0.0 or above
2 parents bf2ce54 + 574e575 commit 4ee14a7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/android/BluetoothLePlugin.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2779,6 +2779,11 @@ public void onReceive(Context context, Intent intent) {
27792779
addProperty(returnObj, keyMessage, logNotEnabled);
27802780

27812781
connections = new HashMap<Object, HashMap<Object, Object>>();
2782+
if (scanCallbackContext != null) {
2783+
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
2784+
bluetoothAdapter.getBluetoothLeScanner().stopScan(scanCallback);
2785+
}
2786+
}
27822787
scanCallbackContext = null;
27832788

27842789
pluginResult = new PluginResult(PluginResult.Status.OK, returnObj);

0 commit comments

Comments
 (0)