Closed licaon-kter closed 7 years ago
This is a problem we encountered only on sony devices. We use an Service WITH foreground notification to stay alive. This is a bug in Sonys Android. We tested with AOSP 5, 5.1, 6 and 7. all show a different behavior. If you swipe away the GUI from the last used apps it has no effect on playback.
Ok so the problem is that actually the app dies/is killed, so #18 is just a consequence of this:
I ActivityManager: Killing 25351:org.gateshipone.odyssey/u0a94 (adj 9): remove task
I WindowState: WIN DEATH: Window{2bb7a6c9 u0 org.gateshipone.odyssey/org.gateshipone.odyssey.activities.OdysseyMainActivity}
I ActivityManager: Killing 25383:org.gateshipone.odyssey:serviceProcess/u0a94 (adj 0): remove task
D NuPlayerDriver: reset(0xaebe63a0)
W MediaFocusControl: AudioFocus audio focus client died
I MediaFocusControl: AudioFocus removeFocusStackEntry(): removing entry for android.os.BinderProxy@b7a9708
D NuPlayerDriver: notifyResetComplete(0xaebe63a0)
W AudioFlinger: session id 452 not found for pid 25383
D NuPlayerDriver: reset(0xaebe6520)
D NuPlayerDriver: notifyResetComplete(0xaebe6520)
W ActivityManager: Exception when unbinding service org.gateshipone.odyssey/.playbackservice.PlaybackService
W ActivityManager: android.os.DeadObjectException
W ActivityManager: at android.os.BinderProxy.transactNative(Native Method)
W ActivityManager: at android.os.BinderProxy.transact(Binder.java:496)
W ActivityManager: at android.app.ApplicationThreadProxy.scheduleUnbindService(ApplicationThreadNative.java:926)
W ActivityManager: at com.android.server.am.ActiveServices.removeConnectionLocked(ActiveServices.java:1803)
W ActivityManager: at com.android.server.am.ActiveServices.killServicesLocked(ActiveServices.java:2201)
W ActivityManager: at com.android.server.am.ActivityManagerService.cleanUpApplicationRecordLocked(ActivityManagerService.java:15146)
W ActivityManager: at com.android.server.am.ActivityManagerService.handleAppDiedLocked(ActivityManagerService.java:4617)
W ActivityManager: at com.android.server.am.ActivityManagerService.appDiedLocked(ActivityManagerService.java:4782)
W ActivityManager: at com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied(ActivityManagerService.java:1251)
W ActivityManager: at android.os.BinderProxy.sendDeathNotice(Binder.java:551)
E lowmemorykiller: Error opening /proc/25383/oom_score_adj; errno=2
But you either don't get the crash dialogue or it's too fast.
This happened:
We can reproduce this issue on an old sony phone BUT ONLY by swiping away the gui from the list of recently apps. All other cases can not be confirmed.
This is a sony specific problem with old devices. I can reproduce this issue on my xperia z (5.1.1). As you can see the ActivityManager just kills our two processes. This wouldn't be a big deal if they only kill the GUI process but they kill the serviceProcess as well.
At the moment we don't see how to handle a kill from the outside. We tried fixing this but as this bug only occurs on old sony phones we don't see the need to investigate this further. Sony fixed this problem with its newer versions of android. They now have the same behavior like googles phones.
As a workaround just don't swipe away the application which is not recommended anyway because it wastes battery by reloading every application each time. They better can stay in RAM inactive.
Z3 5.1.1 can't really be called old though, it won't get Nougat but c'mon. ;)
More tests:
You have the notification, use it to stay alive, Vanilla (and Timber to a degree; it pauses but you can use the notification to start playing gain) do this, it's somewhat expected that music could play in the background irrespective of the app being in the app list or not.
Xperia 5.1.1, 1.0.11 from F-Droid
Tested with FLAC files