Re: [android-developers] Re: Issues with KitKat 4.4.2, the recent apps list, and startForeground(): What criteria does KitKat use to kill an app when swiped away from the recent apps list?
Stuff I've tried: 1) Removed all broadcast receivers from AndroidManifest.xml. 2) Removed all sendBroadcast calls from the code. 3) Removed all broadcast receivers from the code. 4) Removed all calls to AppWidgetManager. 5) (I don't have any calls to AlarmManager) 6) Delete all intent-filter from the manifest, except for the launcher. 7) Change android:targetSdkVersion=19 to different levels all the way down to 14. At this point, I think the only safe way to handle this might be to override onTaskRemoved only for API 19 and use that to safely stop the app (since onDestroy doesn't get called), and display a warning / clear ongoing notifications so that the user at least knows that they stopped their task by swiping the app away. Does anyone have ideas on how I could trace this further and figure out what's triggering the app to get killed? Otherwise it's a wait to API 20 and hope it's fixed there. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Re: Issues with KitKat 4.4.2, the recent apps list, and startForeground(): What criteria does KitKat use to kill an app when swiped away from the recent apps list?
I decided to dig further into this based on readings from Googling, and here are some stats from adb shell dumpsys activity: Here's the last line I see an instant before the app is killed (I'm just running it over and over): Proc # 4: prcp F/S/IF trm: 0 17361:com.mypackage.name/u0a241 (fg-service) With this in LogCat: I/ActivityManager( 1743): Killing 17361:com.mypackage.name/u0a241 (adj 0): remove task It doesn't always get killed, but it does get killed pretty often. If it doesn't get killed right away (within 5 seconds or so) then it seems to persist. Here's what I see run another other app that doesn't get killed: Proc # 4: prcp F/S/IF trm: 0 17539:com.anotherpackage.name/u0a118 (fg-service) With dab shell dumpsys meminfo (IIRC), this other app was also consuming significantly more memory than my own, yet not getting killed. So, I'm not really seeing much difference and not understanding why my app is getting killed. :( On Thursday, March 13, 2014 12:36:03 AM UTC-4, Digipom wrote: I'm running into an issue with my app on KitKat 4.4.2: when it's recording, and the user later sends it to the background and swipes it away from the recent apps list, the app is killed, even though it called startForeground! This did not happen on 4.3, and to add insult to injury, the notification doesn't disappear and the app services still appear in the running services in the device settings. However, I see that this isn't happening for all apps. I downloaded some other recorders, and I can confirm that their processes remain active in memory even though I've also removed them from the recent apps list using the same method; they remain active even if not recording! I thought it could be an issue with the target API, but lowering that to 14 didn't help (I don't think I could lower it further than that if using Action Bar Sherlock). Does anyone have any ideas? It's definitely not cool from a customer's point of view, so I really want to find a solution. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Re: Issues with KitKat 4.4.2, the recent apps list, and startForeground(): What criteria does KitKat use to kill an app when swiped away from the recent apps list?
Try a search of the forum. There are some long threads on this issue. It's also on the Android issues list in various guises. Pent -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Re: Issues with KitKat 4.4.2, the recent apps list, and startForeground(): What criteria does KitKat use to kill an app when swiped away from the recent apps list?
Based on those threads and the issues list, it seems that receiving a broadcast is the main known way that this is triggered (aside from not having a foreground service, but I do have one), but I have logs on all my onReceive and it doesn't seem to be that. :( On Mar 13, 2014, at 2:45 AM, Pent supp...@apps.dinglisch.net wrote: Try a search of the forum. There are some long threads on this issue. It's also on the Android issues list in various guises. Pent -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to a topic in the Google Groups Android Developers group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-developers/3SBriAT632M/unsubscribe. To unsubscribe from this group and all its topics, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Re: Issues with KitKat 4.4.2, the recent apps list, and startForeground(): What criteria does KitKat use to kill an app when swiped away from the recent apps list?
With dumpsys activity | grep Proc # | grep my.package.name It looks like the app was in fg-service before getting killed. Looking at the source code here: 6968http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.2_r1/com/android/server/am/ActivityManagerService.java#6968, it seems that the process should only be killed if non-interactive. The latest is 4.4.2 so not sure exactly what 4.4.3 is using if different. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Re: Issues with KitKat 4.4.2, the recent apps list, and startForeground(): What criteria does KitKat use to kill an app when swiped away from the recent apps list?
With dumpsys activity | grep Proc # | grep my.package.name It looks like the app was in fg-service before getting killed. Looking at the source code here: 6968http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.2_r1/com/android/server/am/ActivityManagerService.java#6968, it seems that the process should only be killed if non-interactive. On Thursday, March 13, 2014 12:36:03 AM UTC-4, Digipom wrote: I'm running into an issue with my app on KitKat 4.4.2: when it's recording, and the user later sends it to the background and swipes it away from the recent apps list, the app is killed, even though it called startForeground! This did not happen on 4.3, and to add insult to injury, the notification doesn't disappear and the app services still appear in the running services in the device settings. However, I see that this isn't happening for all apps. I downloaded some other recorders, and I can confirm that their processes remain active in memory even though I've also removed them from the recent apps list using the same method; they remain active even if not recording! I thought it could be an issue with the target API, but lowering that to 14 didn't help (I don't think I could lower it further than that if using Action Bar Sherlock). Does anyone have any ideas? It's definitely not cool from a customer's point of view, so I really want to find a solution. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.