Skip to content

Commit

Permalink
More tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
barbeau committed Dec 28, 2024
1 parent 9e66c2b commit 37abdf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions GPSTest/src/main/java/com/android/gpstest/ui/Preferences.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import androidx.annotation.RequiresApi
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.Toolbar
import androidx.core.app.ActivityCompat
import com.android.gpstest.Application
import com.android.gpstest.Application.Companion.app
import com.android.gpstest.Application.Companion.localeManager
import com.android.gpstest.Application.Companion.prefs
Expand Down Expand Up @@ -392,6 +391,8 @@ class Preferences : PreferenceActivity(), OnSharedPreferenceChangeListener {
if (!newValue) {
// If the user disabled the setting revoke the notification permission
revokeSelfPermissionOnKill(Manifest.permission.POST_NOTIFICATIONS)
// Destroy and recreate Activity
recreate()
}

// Accept change to setting by returning true
Expand Down Expand Up @@ -455,7 +456,7 @@ class Preferences : PreferenceActivity(), OnSharedPreferenceChangeListener {
true,
prefs
)
addPreferencesFromResource(R.xml.preferences)
recreate()
} else {
// Prompt the user to grant permissions again
createNotificationPermissionDialog(this).show();
Expand Down
2 changes: 1 addition & 1 deletion library/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
<string name="pref_auto_start_gps_summary">Start GNSS when the app starts</string>

<string name="pref_gnss_show_notification_title">Show a notification</string>
<string name="pref_gnss_show_notification_summary">If checked, the app will show a notification with real-time GNSS information. This setting must be enabled to run in the background or log data. This setting can only be changed on Android 13 and up.</string>
<string name="pref_gnss_show_notification_summary">If checked, the app will show a notification with real-time GNSS information. This setting must be enabled to run in the background or log data. When disabling this setting you must kill and restart the app for it to take effect. This setting can only be changed on Android 13 and up.</string>

<string name="pref_gnss_background_title">Run GNSS in background</string>
<string name="pref_gnss_background_summary">If checked, when you leave the app a notification will keep GNSS running in the background until you stop it from that notification. This setting is automatically enabled when you enable logging data to files to allow logging in the background.</string>
Expand Down

0 comments on commit 37abdf7

Please sign in to comment.