Device: OnePlus running android 10
I am experiencing issues with prolonged background app tracking on Android 10. It seems that after a period of time, the app is killed entirely and the background locations stop coming in.
In build hints, I have android.xpermissions set to:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /><uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
I am starting location tracking like so:
CommonUtil.log("Starting Tracking");
LocationManager.getLocationManager().setLocationListener(new LocationListenerImpl(), new LocationRequest(LocationRequest.PRIORITY_MEDIUM_ACCUARCY, 1000 * 60 * 5));
LocationManager.getLocationManager().setBackgroundLocationListener(LocationListenerImpl.class);
I am also starting geofencing like so:
LocationManager.getLocationManager().addGeoFencing(GeofenceListenerImpl.class, revisedGeofences.get(id));
Upon entering a geofence, I simply increase tracking accuracy
LocationManager.getLocationManager().setLocationListener(new LocationListenerImpl(), new LocationRequest(LocationRequest.PRIORITY_HIGH_ACCUARCY, 1000 * 60 * 2));
All of this works fine for the first several hours, and then it suddenly stops until the app is manually opened. Any thoughts?