Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Small fix for background location permission

Michael Rademakerb47aeb9ee6b6
diff --git a/console/android/GenericApp/app/build.gradle b/console/android/GenericApp/app/build.gradle
index 6bdb64ee8..ace155f61 100644
--- a/console/android/GenericApp/app/build.gradle
+++ b/console/android/GenericApp/app/build.gradle
@@ -10,8 +10,8 @@ android {
applicationId "io.openremote.app"
minSdkVersion 25
targetSdkVersion 30
- versionCode 22
- versionName "1.0.3"
+ versionCode 24
+ versionName "1.0.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
diff --git a/console/android/GenericApp/app/src/main/AndroidManifest.xml b/console/android/GenericApp/app/src/main/AndroidManifest.xml
index 048113d43..effce8798 100644
--- a/console/android/GenericApp/app/src/main/AndroidManifest.xml
+++ b/console/android/GenericApp/app/src/main/AndroidManifest.xml
@@ -19,7 +19,6 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/OpenRemoteTheme">
- <activity android:name=".ui.PrivacyPolicyActivity"></activity>
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
@@ -50,6 +49,7 @@
android:exported="true"
android:label="@string/title_activity_project" />
<activity android:name=".ui.MainActivity" />
+ <activity android:name=".ui.PrivacyPolicyActivity" />
<service android:name=".service.ORFirebaseMessagingService">
<intent-filter>
diff --git a/console/android/GenericApp/app/src/main/java/io/openremote/app/service/GeofenceProvider.kt b/console/android/GenericApp/app/src/main/java/io/openremote/app/service/GeofenceProvider.kt
index f2ecc1977..4387a9b7f 100644
--- a/console/android/GenericApp/app/src/main/java/io/openremote/app/service/GeofenceProvider.kt
+++ b/console/android/GenericApp/app/src/main/java/io/openremote/app/service/GeofenceProvider.kt
@@ -217,8 +217,8 @@ class GeofenceProvider(val context: Context) {
.remove(geofenceDisabledKey)
.apply()
- val hasPermission = when (android.os.Build.VERSION.SDK_INT) {
- android.os.Build.VERSION_CODES.Q -> {
+ val hasPermission = when {
+ android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q -> {
context.checkSelfPermission(
ACCESS_BACKGROUND_LOCATION
) == PackageManager.PERMISSION_GRANTED
diff --git a/console/android/GenericApp/app/src/main/res/values/strings.xml b/console/android/GenericApp/app/src/main/res/values/strings.xml
index 47d3b3ed5..8d10fc7b9 100644
--- a/console/android/GenericApp/app/src/main/res/values/strings.xml
+++ b/console/android/GenericApp/app/src/main/res/values/strings.xml
@@ -16,7 +16,7 @@
<string name="error_downloading">Error downloading file</string>
<string name="download_completed">Download completed</string>
<string name="background_location_alert_title">Background location needed</string>
- <string name="background_location_alert_body">Background location is needed in order to signal the server whether the device has entered or exited a certain location, the app needs to get the device\'s location when the app is running in the background.\nNo location history is stored, only the latest location is saved.\nDo you want to enabled it in the settings?</string>
+ <string name="background_location_alert_body">In order to receive these notifications when the app is running in the background, background location access is needed.\nNo location history is stored, only the latest location is saved.\nDo you want to enabled it in the settings?</string>
<string name="location_background_disabled_title">Background location disabled</string>
<string name="background_location_decline">No</string>
<string name="background_location_accept">Yes</string>