Fixes to handleAppDiedLocked.

- Call in all circumstances but only set launchHomeTaskNext for
  focused stack. Previous version didn't call handleAppDiedLocked for
  non-focused stack.

- Rearrange logic to run down the top task and make sure that all
  remaining activities belong to the dying app. Previous version just
  looked at the top non-finishing activity and based its behavior on
  that.

Fixes bug 11029560.

Change-Id: Ic3a7c873c4c975577d6b390a8955ff41729bdfde
2 files changed