Skip to content

Commit

Permalink
Fix incorrect string comparison on Android background location
Browse files Browse the repository at this point in the history
  • Loading branch information
peitschie committed Jul 14, 2024
1 parent a5a15be commit 82c65df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/android/BLECentralPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 82c65df

Please sign in to comment.