I see in the logcat that the app google play services "com.google.android.gms" gets updated.
Therefore the activity manager kills all applications which use the play services even if they are in the foreground.
I/ActivityManager( 2076): Force stopping com.google.android.gms appid=10008 user=-1: installPackageLI
I/ActivityManager( 2076): Killing 4051:com.google.android.youtube/u0a68 (adj 902): stop com.google.android.gms
I/ActivityManager( 2076): Killing 2883:com.google.android.gms.persistent/u0a8 (adj 100): stop com.google.android.gms
W/ActivityManager( 2076): Scheduling restart of crashed service com.google.android.gms/.common.stats.GmsCoreStatsService in 1000ms
W/ActivityManager( 2076): Scheduling restart of crashed service com.google.android.gms/.backup.BackupTransportService in 10993ms
...
I/ActivityManager( 2076): Killing 9409:com.android.vending/u0a26 (adj 200): stop com.google.android.gms
D/ConnectivityService( 2076): ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ LISTEN id=8, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&FOREGROUND] ], android.os.BinderProxy@a87ac95)
W/PackageManager( 2076): Trying to update system app code path from /data/app/com.google.android.gms-1 to /data/app/com.google.android.gms-2
W/PackageManager( 2076): Package com.google.android.gms desires unavailable shared library com.google.android.ble; ignoring!
W/PackageManager( 2076): Package com.google.android.gms desires unavailable shared library com.google.android.wearable; ignoring!
E/ConnectivityService( 2076): RemoteException caught trying to send a callback msg for NetworkRequest [ LISTEN id=8, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&FOREGROUND] ]
W/PackageManager( 2076): Code path for com.google.android.gms changing from /data/app/com.google.android.gms-1 to /data/app/com.google.android.gms-2
W/PackageManager( 2076): Resource path for com.google.android.gms changing from /data/app/com.google.android.gms-1 to /data/app/com.google.android.gms-2
I/ActivityManager( 2076): Killing 2903:com.google.android.googlequicksearchbox:search/u0a27 (adj 500): stop com.google.android.gms
W/ActivityManager( 2076): Scheduling restart of crashed service com.google.android.googlequicksearchbox/com.google.android.apps.gsa.search.core.service.SearchService in 200950ms
I/ActivityManager( 2076): Killing 3711:com.google.android.gms.unstable/u0a8 (adj 900): stop com.google.android.gms
I/ActivityManager( 2076): Killing 3873:com.google.android.gms.ui/u0a8 (adj 904): stop com.google.android.gms
I/ActivityManager( 2076): Killing 2895:com.google.android.apps.maps/u0a64 (adj 902): stop com.google.android.gms
I/ActivityManager( 2076): Killing 3127:com.google.android.gms/u0a8 (adj 100): stop com.google.android.gms
W/ActivityManager( 2076): Scheduling restart of crashed service com.google.android.gms/.measurement.service.MeasurementBrokerService in 60945ms
W/ActivityManager( 2076): Scheduling restart of crashed service com.google.android.gms/.chimera.GmsBoundBrokerService in 210945ms
I/ActivityManager( 2076): Killing 9632:com.example.app/1000 (adj 0): stop com.google.android.gms
W/ActivityManager( 2076): Force removing ActivityRecord{7ea5f8a u0 com.example.app/.MyActivity t33}: app died, no saved state
My app "com.example.app" gets killed last.
Avoid update of depending app
Is it possible to avoid this update during my app is in foreground. It shouldn't happen often but still is not that nice regarding the user experience.
Avoid update of foreground app Is it possible to avoid the automatic playstore update of an app while it is in foreground. This happens quite often to android users. I hate when I am reading the newspaper and the newspaper app gets updated then.
Similar, does not answer my question
Android/Google Play - Can an App Update While it Is Running
First, swipe down once from the top of the screen and tap the gear icon. Scroll down and find “Apps.” Next, tap the three-dot menu icon and select “Special Access.” If you don't see it, there will be a section on that screen titled “Special App Access.” Now select “Optimize Battery Usage.”
You can't handle swipe, because system just removes your process from memory without calling any callback. I have checked, that before user calls "recent apps" screen, onPause() will be always called. So you need to save all data in onPause method without checking isFinishing().
Call startService() method in Foreground Service Launcher class in your Activity to start a background service which will run forever. In order to sync something between application and server we can create a handler which run every time interval .
Google reported that they won't fix the issue, though they also won't really admit that they won't: https://issuetracker.google.com/issues/174418227
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With