Fix "You're using your work profile" toast is shown when launcher is
...in foreground

What's the problem:
getRecentTasks no longer returns home task. Check
RecentTasks.isVisibleRecentTask

Solution:
Instead of "fixing" getRecentTasks, use getLastResumedActivityUserId,
which is already used for the work profile icon in status bar.
Note that Keyguard is not an activity, so it won't change the value of
"last resumed activity user id". It should be more lightweight than
getRecentTasks anyway.

Test: Open any personal app -> screen off and on -> no toast
Test: Open any work app -> screen off and on -> observe toast
Test: Open any work app -> tap home -> scren off and on -> no toast

Change-Id: I1cc880bfa23017c9d2c5ad99d57e67b430aa4ac8
Fix: 70377375
1 file changed