From 82c65dff61febcf1f33309fa44559db8abb75952 Mon Sep 17 00:00:00 2001 From: Philip Peitsch Date: Sun, 14 Jul 2024 17:22:44 +1000 Subject: [PATCH] Fix incorrect string comparison on Android background location --- src/android/BLECentralPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); }