Skip to content
Commit 90f203c5 authored by Tony Mak's avatar Tony Mak
Browse files

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
parent 5c74af94
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment