Tuesday, July 9, 2019

4.0 ice cream sandwich - What actually happens when you swipe an app out of the recent apps list?



The recent apps list in Ice Cream Sandwich added the ability to swipe apps out of the list, thereby dismissing them permanently (and as far as I know this is a vanilla function, not a CM/custom ROM one). The documentation and platform highlights don't appear to cover the under-the-hood workings of this functionality, but I'm curious to know what the system is actually doing.


Further adding to my curiosity, I decided to do a quick test: I started up Music on a CM9 install, then backed out of it. I then checked the recent apps list and saw it was indeed there (and in the proper state, based on the thumbnail). I then went into Settings->Applications and force stopped the Music app, but it was still listed in the recent list, leading me to believe it's not connected to processes lingering in the background.


Realizing now that Music may have been a poor choice, I also tested with the USA Today app. This exhibited basically the same behavior, and it seemed like it was forced to "relaunch" after the force stop (which makes sense) though the thumbnail in the recent apps list didn't reflect this (cached, I'm guessing?).


So, what actually happens at the OS level when you swipe an app out of the recent list? Does it simply clear the app's data out of RAM and garbage collect it, destroying its saved state?



Answer



Swiping apps out of the recent apps list is vanilla, and yes, not well documented. This has been the topic of a decent amount of discussion on various Android forums... the consensus seems to be best described here in some comments: that the behavior is similar to but not exactly the same as closing an app -- in general (for apps that don't define explicit back button handling) it's the same thing as hitting back enough times from within an application that you exit out of it.


The link has some more details on the specifics, but overall you can think of it as quitting the application.


Specific to the Music app, I believe it starts a service, so while the task itself (the Music app/UI) may be closed, the service continues to run in the background so that your music doesn't suddenly stop just because the task got cleared out for memory management reasons. That may have affected what you saw.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...