Feedback for Samsung page

This issue has been tracked since 2022-01-19.

Samsung Galaxy A50 (SM-A505F/DS) running Android 11 One UI 3.1, no SIM card installed.

Tested with our app: Psngr mileage tracker. Our app:

  1. Runs a foreground service with Wake lock to receive location updates in the background.
  2. Requests physical activity detection AND transition updates via a broadcast receiver.
  3. Requests geofencing EXIT updates via a broadcast receiver

The app stopped working after the latest update to One UI 3.1 on our test device Samsung Galaxy A50. We have made this update on 27 Dec 2021.

We have double and tripple checked:

  • Location permissions for the app set to ALWAYS
  • Physical activity ALLOWED
  • Foreground service is running and displays a sticky notification
  • Android Settings > Battery & Device care >
    > Power Saving mode OFF
    > Background usage limits > Put unused apps to sleep > OFF
    > More battery settings > Adaptive battery > OFF
    > (3-dot menu) > Automation
    > Auto optimize daily > OFF
    > Adaptive power saving > OFF
  • Our app is locked in Recent apps

Despite all of the above, the app:

  • never receive geofencing alert when moving a significant distance.
  • never receives physical activity transition updates (we tested running and driving with the device)
  • If we launch the app prior to starting a trip, and kill it from the task switcher (remove it from recents), the app does receive geofencing event and physical activity updates. So it appears to be an issue related to the app not being used for over a day (?)

More info:

  • Our app was also tested on Pixel 4 running Android 12, and works perfectly well (same app version and code).

Could this be a bug in One UI 3.1, or new and undocumented restrictions to background running apps enforeced by Samsung?

petrnalevka wrote this answer on 2022-01-19

Hello @rubnov, many thanks for sharing this, do you see any potential hints in the adb log?

If this would be related to the ChimeraPolicyHandler issue reported earlier than you should see this in ADB:
#307

We are monitoring such cases and I think we still have evidence to keep Samsung in the 5 crap score category for the moment.

rubnov wrote this answer on 2022-01-22

Update:

After inserting a SIM card into the device, geofencing started working and our app is notified in the background. Even after taking the SIM card out, geofencing continues to work and the app is launched in the background.

Could it be that geofencing on Samsung devices relies on access to cellular network so much that it stops working (after a while?) without such access? Testing the same scenario on Google Pixel 4 running Android 12, geofencing works fine without a SIM card installed.

I will monitor this in the next few days and, if and when the app fails to launch in the background, will examine logcat and look for clues.

rubnov wrote this answer on 2022-01-26

I ran into the issue again this morning. Went out for a run and geofencing did not trigger / the app did not launch in the background.
I ran adb logcat and could not find any trace of ChimeraPolicyHandler. I did find the following exception repeating itself every 15-20 seconds:

01-26 09:11:52.127  4569  5352 E AppOps  : noteOperation
01-26 09:11:52.127  4569  5352 E AppOps  : java.lang.SecurityException: Specified package {com.package.myapp} under uid 10589 but it is really 10591
01-26 09:11:52.127  4569  5352 E AppOps  : 	at com.android.server.appop.AppOpsService.verifyAndGetBypass(AppOpsService.java:3937)
01-26 09:11:52.127  4569  5352 E AppOps  : 	at com.android.server.appop.AppOpsService.noteOperationUnchecked(AppOpsService.java:3090)
01-26 09:11:52.127  4569  5352 E AppOps  : 	at com.android.server.appop.AppOpsService.noteProxyOperation(AppOpsService.java:3048)
01-26 09:11:52.127  4569  5352 E AppOps  : 	at com.android.internal.app.IAppOpsService$Stub.onTransact(IAppOpsService.java:585)
01-26 09:11:52.127  4569  5352 E AppOps  : 	at android.os.Binder.execTransactInternal(Binder.java:1190)
01-26 09:11:52.127  4569  5352 E AppOps  : 	at android.os.Binder.execTransact(Binder.java:1159)

I am not sure if this exception blocks my app from launching. I doubt it, because I found the same exception multiple times in a reference logcat in which geofencing worked well and the app launched in the background. Let's call it the "good" logcat.

When comparing the "good" logcat to this recent "bad" run, there is one striking difference. The following log line appears many times throughout "good" logcat (every ±1 sec):

01-26 09:22:58.939  4569  6942 D ActivityManager: Received SERVICE intent 0xec4f6ea Key{startService pkg=com.google.android.gms/geofencer_provider intent=act=com.google.android.location.internal.action.GEOFENCER_LOCATION_RESULT pkg=com.google.android.gms cmp=com.google.android.gms/com.google.android.location.internal.PendingIntentCallbackService flags=0x0 u=0} requestCode=0 from uid 10038

whereas in the "bad" logcat (geofencing did not trigger, app not launched in background) this line appears only once, which is after I returned home from my run.

I still don't know what to do with this information. Sharing it here in case someone has any thoughts or has had a similar experience.

Again, I'm testing with Samsung A50 without SIM card installed.

JoshuaGloriod wrote this answer on 2022-02-20

Hi, I'm not much of a coder (or at all), but I've been heavily contributing to cellmapper. I'm not sure why, but when mapping by car or other high-speed method, these are the ideal location settings.

Location: on

Google location service:off

*Wifi scanning: on

*Bluetooth scanning: on


*Also known as high-accuracy

I've been thinking of mentioning a setting for a pull request that I haven't discussion about (regarding power saving). In Developer settings, there's an option for Android to completely disregard that an app is in cache and choose not to run it. Option "Suspend execution on cached apps". The toggles: enabled (apps will get to run), disabled (no cached apps will run), and "default for this phone" which is itself the default toggle.

Getting that set to enabled helped more with battery saver nonsense. Could be something to look at.

More Details About Repo
Owner Name urbandroid-team
Repo Name dont-kill-my-app
Full Name urbandroid-team/dont-kill-my-app
Language JavaScript
Created Date 2018-12-19
Updated Date 2022-12-08
Star Count 904
Watcher Count 82
Fork Count 681
Issue Count 212

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date