@@ -788,7 +788,7 @@ private void stopAdvertisingAction(JSONArray args, CallbackContext callbackConte
788788 }
789789
790790 advertiser .stopAdvertising (advertiseCallback );
791-
791+
792792 if (isAdvertising ) isAdvertising = false ;
793793
794794 JSONObject returnObj = new JSONObject ();
@@ -926,7 +926,7 @@ public void requestPermissionAction(CallbackContext callbackContext) {
926926 public void hasPermissionBtScanAction (CallbackContext callbackContext ) {
927927 JSONObject returnObj = new JSONObject ();
928928
929- addProperty (returnObj , "hasPermission" , cordova .hasPermission (Manifest .permission .BLUETOOTH_SCAN ));
929+ addProperty (returnObj , "hasPermission" , Build . VERSION . SDK_INT < Build . VERSION_CODES . S || cordova .hasPermission (Manifest .permission .BLUETOOTH_SCAN ));
930930
931931 callbackContext .success (returnObj );
932932 }
@@ -951,7 +951,7 @@ public void requestPermissionBtScanAction(CallbackContext callbackContext) {
951951 public void hasPermissionBtConnectAction (CallbackContext callbackContext ) {
952952 JSONObject returnObj = new JSONObject ();
953953
954- addProperty (returnObj , "hasPermission" , cordova .hasPermission (Manifest .permission .BLUETOOTH_CONNECT ));
954+ addProperty (returnObj , "hasPermission" , Build . VERSION . SDK_INT < Build . VERSION_CODES . S || cordova .hasPermission (Manifest .permission .BLUETOOTH_CONNECT ));
955955
956956 callbackContext .success (returnObj );
957957 }
@@ -2866,7 +2866,7 @@ private void setPinAction(JSONArray args, CallbackContext callbackContext) {
28662866 if (isNotArgsObject (obj , callbackContext )) {
28672867 return ;
28682868 }
2869-
2869+
28702870 String address = getAddress (obj );
28712871 if (isNotAddress (address , callbackContext )) {
28722872 return ;
@@ -2876,7 +2876,7 @@ private void setPinAction(JSONArray args, CallbackContext callbackContext) {
28762876 if (pin ==null ) {
28772877 return ;
28782878 }
2879-
2879+
28802880 Log .d ("BLE" ,"set pin " + address + " " + pin );
28812881 JSONObject returnObj = new JSONObject ();
28822882 try {
@@ -2957,7 +2957,7 @@ public void onReceive(Context context, Intent intent) {
29572957
29582958 // Reset isAdvertising when adapter is off (if STATE_TURNING_OFF doesn't trigger)
29592959 if (isAdvertising ) isAdvertising = false ;
2960-
2960+
29612961 gattServer = null ;
29622962
29632963 pluginResult = new PluginResult (PluginResult .Status .OK , returnObj );
@@ -3036,7 +3036,7 @@ public void onReceive(Context context, Intent intent) {
30363036 }
30373037 }
30383038 };
3039-
3039+
30403040 private BroadcastReceiver mPairingRequestReceiver ;
30413041
30423042 @ Override
0 commit comments