Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3817fd20 authored by Matthew Ng's avatar Matthew Ng
Browse files

Dismiss recents after switching users

Switching users was causing Recents to load the other user's tasks. This
is bypassed by dismissing Recents when user is changed to match to how
turning the screen off dismisses Recents. When a user is switched, home
is shown after keyguard is unlocked. Then when Recents is launched again
it will load the usual tasks by the user.

Fixes: 63336488
Test: make 2nd user, open recents with at least one task, switch to 2nd
user and switch back, unlock keyguard to recents

Change-Id: I46dcec9954007068ff28cd0671a4242aa009bd2a
parent 47b92092
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -182,6 +182,9 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
            if (action.equals(Intent.ACTION_SCREEN_OFF)) {
                // When the screen turns off, dismiss Recents to Home
                dismissRecentsToHomeIfVisible(false);
            } else if (action.equals(Intent.ACTION_USER_SWITCHED)) {
                // When switching users, dismiss Recents to Home similar to screen off
                finish();
            } else if (action.equals(Intent.ACTION_TIME_CHANGED)) {
                // If the time shifts but the currentTime >= lastStackActiveTime, then that boundary
                // is still valid.  Otherwise, we need to reset the lastStackactiveTime to the
@@ -375,6 +378,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
        IntentFilter filter = new IntentFilter();
        filter.addAction(Intent.ACTION_SCREEN_OFF);
        filter.addAction(Intent.ACTION_TIME_CHANGED);
        filter.addAction(Intent.ACTION_USER_SWITCHED);
        registerReceiver(mSystemBroadcastReceiver, filter);

        getWindow().addPrivateFlags(LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION);