Improve mitigation for finding the top resumed activity

Current mitigation does not work well as there is no guarantee anything has a focus. Using isTopResumedActivity is more robust.

Keeping the old mitigation which might still be helpful for cases when there is an external keyboard/mouse/trackpad. 

Change-Id: I4f1ca94f1c28dd9f237f400ac928170caf5e589d
Fixes: 290379905
1 file changed