Commits

Dianne Hackborn authored 50685606cfa
Improve how we manage the previous app. Setting it when a new activity is being resumed is too soon, because things like an activity launching an exiting (without being seen by the user) can knock out the real previous app that we want. So now we set it when an activity is stopped. At this point it is going to move from the preceptible to background oom adj, so it is a good point to determine whether it should be a previous app to instead put it to that oom adj. This also avoids things like activities that start and immediately finish from impacting the previous app. Further, we keep track of the time each activity was last shown, and use this to further filter what is set as the previous app. Change-Id: I72d1cac4de0cc2d4598170296028f11b06918d4f