Update BackgroundServiceDelegate.mc

Changes to location sending and accuracy.
This commit is contained in:
Philip Abbey
2026-03-10 21:55:06 +00:00
parent 2f76d68f1b
commit 07f3be0d26

View File

@@ -115,15 +115,17 @@ class BackgroundServiceDelegate extends System.ServiceDelegate {
// System.println("BackgroundServiceDelegate onTemporalEvent(): Activity : " + Activity.getProfileInfo().name); // System.println("BackgroundServiceDelegate onTemporalEvent(): Activity : " + Activity.getProfileInfo().name);
// Don't use Settings.* here as the object lasts < 30 secs and is recreated each time the background service is run // Don't use Settings.* here as the object lasts < 30 secs and is recreated each time the background service is run
if (position.accuracy != Position.QUALITY_NOT_AVAILABLE) {
if (position.accuracy != Position.QUALITY_NOT_AVAILABLE && position.accuracy != Position.QUALITY_LAST_KNOWN) {
var accuracy = 0; var accuracy = 0;
switch (position.accuracy) { switch (position.accuracy) {
case Position.QUALITY_LAST_KNOWN:
accuracy = 100;
break;
case Position.QUALITY_POOR: case Position.QUALITY_POOR:
accuracy = 500; accuracy = 100;
break; break;
case Position.QUALITY_USABLE: case Position.QUALITY_USABLE:
accuracy = 100; accuracy = 50;
break; break;
case Position.QUALITY_GOOD: case Position.QUALITY_GOOD:
accuracy = 10; accuracy = 10;