From 35cb17d358cc0af2415ceeaf764890bd694edfc9 Mon Sep 17 00:00:00 2001 From: Wookie1 Date: Wed, 21 Apr 2021 22:11:20 -0700 Subject: [PATCH 1/2] Update BluetoothLePlugin.java Changed ACCESS_COARSE_LOCATION to ACCESS_FINE_LOCATION --- .../com/codename1/bluetoothle/BluetoothLePlugin.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CN1Bluetooth/native/android/com/codename1/bluetoothle/BluetoothLePlugin.java b/CN1Bluetooth/native/android/com/codename1/bluetoothle/BluetoothLePlugin.java index 30df569..eada25e 100644 --- a/CN1Bluetooth/native/android/com/codename1/bluetoothle/BluetoothLePlugin.java +++ b/CN1Bluetooth/native/android/com/codename1/bluetoothle/BluetoothLePlugin.java @@ -61,6 +61,7 @@ public class BluetoothLePlugin extends CordovaPlugin { private final int REQUEST_BT_ENABLE = 59627; /*Random integer*/ private final int REQUEST_ACCESS_COARSE_LOCATION = 59628; + private final int REQUEST_ACCESS_FINE_LOCATION = 59630; private final int REQUEST_LOCATION_SOURCE_SETTINGS = 59629; private BluetoothAdapter bluetoothAdapter; private boolean isReceiverRegistered = false; @@ -855,7 +856,7 @@ private void notifyAction(JSONArray args, CallbackContext callbackContext) { public void hasPermissionAction(CallbackContext callbackContext) { JSONObject returnObj = new JSONObject(); - addProperty(returnObj, "hasPermission", cordova.hasPermission(Manifest.permission.ACCESS_COARSE_LOCATION)); + addProperty(returnObj, "hasPermission", cordova.hasPermission(Manifest.permission.ACCESS_FINE_LOCATION)); callbackContext.success(returnObj); } @@ -870,7 +871,7 @@ public void requestPermissionAction(CallbackContext callbackContext) { } permissionsCallback = callbackContext; - cordova.requestPermission(this, REQUEST_ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION); + cordova.requestPermission(this, REQUEST_ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION); } public void onRequestPermissionResult(int requestCode, String[] permissions, int[] grantResults) throws JSONException { @@ -881,7 +882,7 @@ public void onRequestPermissionResult(int requestCode, String[] permissions, int //Just call hasPermission again to verify JSONObject returnObj = new JSONObject(); - addProperty(returnObj, "requestPermission", cordova.hasPermission(Manifest.permission.ACCESS_COARSE_LOCATION)); + addProperty(returnObj, "requestPermission", cordova.hasPermission(Manifest.permission.ACCESS_FINE_LOCATION)); permissionsCallback.success(returnObj); } From e238ab95b2c54dc869df746760f7e9d3132c73a7 Mon Sep 17 00:00:00 2001 From: Wookie1 Date: Wed, 21 Apr 2021 22:13:09 -0700 Subject: [PATCH 2/2] Update codenameone_library_appended.properties Changed ACCESS_COARSE_LOCATION to ACCESS_FINE_LOCATION --- CN1Bluetooth/codenameone_library_appended.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CN1Bluetooth/codenameone_library_appended.properties b/CN1Bluetooth/codenameone_library_appended.properties index be10ad9..9997f70 100644 --- a/CN1Bluetooth/codenameone_library_appended.properties +++ b/CN1Bluetooth/codenameone_library_appended.properties @@ -3,7 +3,7 @@ #is an appended type property. # #Wed Jan 09 17:59:31 IST 2013 -codename1.arg.android.xpermissions= +codename1.arg.android.xpermissions= codename1.arg.ios.pods=,Cordova ~> 6.1 codename1.arg.ios.pods.platform=,11.0 codename1.arg.ios.add_libs=;CoreBluetooth.framework;