diff --git a/src/android/BLECentralPlugin.java b/src/android/BLECentralPlugin.java index a3692085..7a693e5c 100644 --- a/src/android/BLECentralPlugin.java +++ b/src/android/BLECentralPlugin.java @@ -1228,7 +1228,7 @@ private void findLowEnergyDevices(CallbackContext callbackContext, UUID[] servic missingPermissions.add(Manifest.permission.ACCESS_FINE_LOCATION); } else { String accessBackgroundLocation = this.preferences.getString("accessBackgroundLocation", "false"); - if (accessBackgroundLocation == "true" && !PermissionHelper.hasPermission(this, ACCESS_BACKGROUND_LOCATION)) { + if (accessBackgroundLocation.equals("true") && !PermissionHelper.hasPermission(this, ACCESS_BACKGROUND_LOCATION)) { LOG.w(TAG, "ACCESS_BACKGROUND_LOCATION is being requested"); missingPermissions.add(ACCESS_BACKGROUND_LOCATION); } @@ -1239,7 +1239,7 @@ private void findLowEnergyDevices(CallbackContext callbackContext, UUID[] servic } String accessBackgroundLocation = this.preferences.getString("accessBackgroundLocation", "false"); - if (accessBackgroundLocation == "true" && !PermissionHelper.hasPermission(this, ACCESS_BACKGROUND_LOCATION)) { + if (accessBackgroundLocation.equals("true") && !PermissionHelper.hasPermission(this, ACCESS_BACKGROUND_LOCATION)) { LOG.w(TAG, "ACCESS_BACKGROUND_LOCATION is being requested"); missingPermissions.add(ACCESS_BACKGROUND_LOCATION); }