Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After updating the app to a new version, it doesn't provide locations until it's restarted #1851

Open
wir3z opened this issue Sep 16, 2024 · 7 comments
Labels
needs-more-info A little more info requested from the submitter

Comments

@wir3z
Copy link
Contributor

wir3z commented Sep 16, 2024

I've seen back on 2.5.0, but never really put my finger on it. This is what I did:

  • Built off master commit for 2.5.3
  • Side loaded the APK
  • App opened, I trigger a manual location trigger, all was good
  • Went for a bike ride, and after 25 minutes, I checked the location update history. There was no location points for those first 25 minutes (we were constantly moving -- about 5km was travelled).
  • Restarted the app, and then it started to report location updates. Didn't realize that the action of doing that would delete the past log history. :(

During the rest of the ride, it seemed decent, but I did get some periods that locations stopped reporting.

Here is an example where it stopped for 18 minutes. Looks like when it's happening, isDeviceIdleMode=true is set. Do you know what triggers that? Is that the phone sleeping the app?

  • 2024-09-15 14:27:32.492 D [DefaultDispatcher-worker-3] MessageProcessor/sendAvailableMessages/311: Message sent successfully: [MessageLocation id=e675c8fa ts=2024-09-15T20:27:31Z,lat=12.34,long=-56.78,created_at=2024-09-15T20:27:31.719Z,trigger=DEFAULT]
  • 2024-09-15 14:28:07.265 D [main] BackgroundService$PowerStateLogger/logPowerState/723: triggeringAction=android.os.action.DEVICE_IDLE_MODE_CHANGED isPowerSaveMode=false locationPowerSaveMode=0 isDeviceIdleMode=true isDeviceLightIdleMode=false isInteractive=false isIgnoringBatteryOptimizations=true
  • 2024-09-15 14:46:48.655 D [backgroundHandlerThread] BackgroundService$LocationCallbackWithReportType/onLocationResult/699: Location result received: LocationResult(lastLocation=Location[fused 23.45,-67.89 hAcc=37.485 et=+1h32m59s649ms alt=1212.9002044370736 vAcc=19.217323 vel=4.636708 sAcc=0.6535555 bear=63.0 bAcc=180.0])
  • App build number: 2.5.x
  • Android version: 14
  • Device: Google Pixel 7
  • Installation source: APK
@wir3z
Copy link
Contributor Author

wir3z commented Sep 16, 2024

Should add the above is 2-issues. The first seems to not configure the locator service properly after an app update.

The second (after looking at the code), is the phone not detecting movement. I'll monitor this one a bit more. It had been working flawless on the 2.5.0 to 2.5.2 tags and Android 14.0.0 (AP2A.240805.005, Aug 2024). Phone had updated a couple days ago to 14.0.0 (AP2A.240905.003, Sep 2024) so I'm unsure if the second issue is an OS update, or something else.

@wir3z
Copy link
Contributor Author

wir3z commented Sep 20, 2024

Ok, rolled back to the previous version I had been using for the last month and same issue. This seems to have manifested from the Sept 5, 2024 security patch. If I select "high accuracy" instead of "balance power/accuracy" it works perfectly fine again. That one baffles my brain a bit unless the phone is ignoring wifi for location updates and is only grabbing from cellular movements.

For this subsciption:
val request =
LocationRequest(fastestInterval, smallestDisplacement, null, null, priority, interval, null)

I tried switching it to this to check if the null's were impacting default settings for those parameters:
val request =
LocationRequest(fastestInterval, smallestDisplacement, priority, interval, false)

But no change. Any idea what to look at around this (unless Google just borked the last patch they pushed)?

@growse
Copy link
Collaborator

growse commented Sep 23, 2024

isDeviceIdleMode=true is set. Do you know what triggers that? Is that the phone sleeping the app?

Yes.

unless Google just borked the last patch they pushed

This is entirely possible :) I also wouldn't be surprised if Google treated apps differently depending on their provenance (sideload vs play store - although I have no evidence of that.

Have you got the "don't optimize battery" setting set?

image

@growse growse added the needs-more-info A little more info requested from the submitter label Sep 23, 2024
@wir3z
Copy link
Contributor Author

wir3z commented Sep 23, 2024

Yes, set to "don't optimize", "pause app" is disabled, etc. This just happened after that last security patch from Google (noted from others using my server side integration as well.)

@wir3z
Copy link
Contributor Author

wir3z commented Sep 27, 2024

I loaded the play store version in parallel of the side load. Need to run a bit more testing to see if there is a delta. Seems to show if you are walking/cycling (lower cadence) than driving where Google seems to switch to GPS regardless.

@wir3z
Copy link
Contributor Author

wir3z commented Sep 27, 2024

Confirmed today that the latest Play Store version or a side loaded APK from tip of master react the same when using "BalancedPowerAccuracy". Others have confirmed the same results. It seems that Google has "done something" in their Sept release of Android 14 that is breaking this operation. Using "HighAccuracy" mode stops it from deep sleeping the OwnTracks app.

It shows up clearly when walking since Android never triggers a GPS update for locations (unlike driving).

@wir3z
Copy link
Contributor Author

wir3z commented Oct 24, 2024

Opened a ticket with Google for them to investigate: https://issuetracker.google.com/issues/370069681

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-more-info A little more info requested from the submitter
Projects
None yet
Development

No branches or pull requests

2 participants