After all, I got location services working by
- removing my fake Google account from microG
- disabling all location modules in microG (which were Mozilla Location Service and, for the address resolving, Nominatim)
- in my HA Companion app under Sensors > Background Location, turn on GPS for a couple of seconds
- restarting my phone.
I have no idea what exactly caused the issue, but one or more of the above things must have solved it.
It worked for more than a week now - however, the location services stopped working yesterday in the late afternoon for no obvious reason.
I started adb debug and see the following output:
02-28 11:31:16.771 9514 9806 D LocBroadcastReceiver: Background location updates appear to have stopped, restarting location updates
02-28 11:31:16.771 9514 9806 D LocBroadcastReceiver: Removing background location requests.
02-28 11:31:16.776 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:31:16.790 9514 9806 D LocBroadcastReceiver: Registering for location updates.
02-28 11:31:20.237 9514 9599 D LocBroadcastReceiver: Background location updates appear to have stopped, restarting location updates
02-28 11:31:20.237 9514 9599 D LocBroadcastReceiver: Removing background location requests.
02-28 11:31:20.247 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:31:20.248 9514 9599 D LocBroadcastReceiver: Registering for location updates.
02-28 11:31:24.421 9514 9599 D LocBroadcastReceiver: Background location updates appear to have stopped, restarting location updates
02-28 11:31:24.421 9514 9599 D LocBroadcastReceiver: Removing background location requests.
02-28 11:31:24.427 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:31:24.438 9514 9599 D LocBroadcastReceiver: Registering for location updates.
02-28 11:31:25.491 9514 9806 D LocBroadcastReceiver: Background location updates appear to have stopped, restarting location updates
02-28 11:31:25.491 9514 9806 D LocBroadcastReceiver: Removing background location requests.
02-28 11:31:25.503 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:31:25.511 9514 9806 D LocBroadcastReceiver: Registering for location updates.
Weirdly enough, turning on GPS now results in a permanent crash of the GPS location service (push notifications popping up and disappearing after <1 second):
02-28 11:38:59.162 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:38:59.369 9514 9806 D LocBroadcastReceiver: High accuracy mode appears to have stopped, restarting high accuracy mode
02-28 11:38:59.378 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:38:59.504 9514 9806 D LocBroadcastReceiver: High accuracy mode appears to have stopped, restarting high accuracy mode
02-28 11:38:59.514 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:38:59.922 9514 9806 D LocBroadcastReceiver: High accuracy mode appears to have stopped, restarting high accuracy mode
02-28 11:38:59.931 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:39:00.018 9514 9599 D LocBroadcastReceiver: High accuracy mode appears to have stopped, restarting high accuracy mode
02-28 11:39:00.026 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:39:00.160 9514 11863 D LocBroadcastReceiver: High accuracy mode appears to have stopped, restarting high accuracy mode
02-28 11:39:00.168 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:39:00.263 9514 9599 D LocBroadcastReceiver: High accuracy mode appears to have stopped, restarting high accuracy mode
02-28 11:39:00.279 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:39:00.741 9514 9596 D LocBroadcastReceiver: High accuracy mode appears to have stopped, restarting high accuracy mode
02-28 11:39:00.754 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:39:01.006 9514 9603 D LocBroadcastReceiver: High accuracy mode appears to have stopped, restarting high accuracy mode
02-28 11:39:01.032 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:39:01.069 9514 9605 D LocBroadcastReceiver: High accuracy mode appears to have stopped, restarting high accuracy mode
02-28 11:39:01.092 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:39:01.324 9514 11866 D LocBroadcastReceiver: High accuracy mode appears to have stopped, restarting high accuracy mode
02-28 11:39:01.360 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:39:01.652 9514 9603 D LocBroadcastReceiver: High accuracy mode appears to have stopped, restarting high accuracy mode
02-28 11:39:01.683 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:39:02.055 9514 11866 D LocBroadcastReceiver: High accuracy mode appears to have stopped, restarting high accuracy mode
02-28 11:39:02.096 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:39:02.133 9514 11879 D LocBroadcastReceiver: High accuracy mode appears to have stopped, restarting high accuracy mode
02-28 11:39:02.171 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
When deactivating the GPS mode, location services appear to go completely crazy:
02-28 11:39:32.729 9514 11937 D LocBroadcastReceiver: High accuracy mode appears to have stopped, restarting high accuracy mode
02-28 11:39:32.730 9514 9808 D LocBroadcastReceiver: Registering for location updates.
02-28 11:39:32.740 9514 11881 D LocBroadcastReceiver: High accuracy mode parameters changed. Disable high accuracy mode.
02-28 11:39:32.758 9514 11956 D LocBroadcastReceiver: High accuracy mode parameters changed. Disable high accuracy mode.
02-28 11:39:32.773 9514 11952 D LocBroadcastReceiver: High accuracy mode parameters changed. Disable high accuracy mode.
02-28 11:39:32.789 9514 11957 D LocBroadcastReceiver: High accuracy mode parameters changed. Disable high accuracy mode.
02-28 11:39:32.800 9514 9808 D LocBroadcastReceiver: Background location updates appear to have stopped, restarting location updates
02-28 11:39:32.800 9514 9808 D LocBroadcastReceiver: Removing background location requests.
02-28 11:39:32.811 9514 11881 D LocBroadcastReceiver: Registering for location updates.
02-28 11:39:32.820 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:39:32.833 9514 11888 D LocBroadcastReceiver: Registering for location updates.
02-28 11:39:32.842 9514 11956 D LocBroadcastReceiver: Registering for location updates.
02-28 11:39:32.857 9514 11958 D LocBroadcastReceiver: High accuracy mode parameters changed. Disable high accuracy mode.
02-28 11:39:32.867 9514 11952 D LocBroadcastReceiver: Registering for location updates.
02-28 11:39:32.876 9514 11953 D LocBroadcastReceiver: High accuracy mode parameters changed. Disable high accuracy mode.
02-28 11:39:32.888 9514 11957 D LocBroadcastReceiver: Registering for location updates.
02-28 11:39:32.927 9514 11958 D LocBroadcastReceiver: Registering for location updates.
02-28 11:39:32.928 9514 11881 D LocBroadcastReceiver: Background location updates appear to have stopped, restarting location updates
02-28 11:39:32.928 9514 11881 D LocBroadcastReceiver: Removing background location requests.
02-28 11:39:32.954 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:39:32.998 9514 11953 D LocBroadcastReceiver: Registering for location updates.
02-28 11:39:33.071 9514 11937 D LocBroadcastReceiver: Registering for location updates.
02-28 11:39:33.073 9514 9808 D LocBroadcastReceiver: High accuracy mode parameters changed. Disable high accuracy mode.
02-28 11:39:33.105 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:39:33.164 9514 11937 D LocBroadcastReceiver: Background location updates appear to have stopped, restarting location updates
02-28 11:39:33.164 9514 11937 D LocBroadcastReceiver: Removing background location requests.
02-28 11:39:33.165 9514 9808 D LocBroadcastReceiver: Registering for location updates.
02-28 11:39:33.176 9514 9514 D LocBroadcastReceiver: Not requesting accurate location, last accurate location was too recent
02-28 11:39:33.214 9514 11881 D LocBroadcastReceiver: Registering for location updates.
02-28 11:39:33.244 9514 11888 D LocBroadcastReceiver: High accuracy mode parameters changed. Disable high accuracy mode.
02-28 11:39:33.289 9514 9808 D LocBroadcastReceiver: Background location updates appear to have stopped, restarting location updates
02-28 11:39:33.289 9514 9808 D LocBroadcastReceiver: Removing background location requests.
02-28 11:39:33.352 9514 11888 D LocBroadcastReceiver: Registering for location updates.
(and so on). After a couple of seconds, everything seems to be fine again, however the location still isn’t updated.
For me it somehow looks like the Android application shows an unknown behavior. Any idea about that?
EDIT:
Looking at the normal logcat, I can see following warning:
02-28 11:42:42.971 6129 8270 W ServiceManager: Permission failure: android.permission.HIGH_SAMPLING_RATE_SENSORS from uid=10157 pid=9514
which might be related to this?