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

Commit caab2666 authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

Restored switchTo method

It is current used in another branch. Restored to fix a breakage.

Change-Id: Iec98bf525b88b6b5b45bffb97a1f3e9b57c492dd
parent 542221d6
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -362,6 +362,19 @@ public class UserSwitcherController {
        switchToUserId(id);
    }

    public void switchTo(int userId) {
        final int count = mUsers.size();
        for (int i = 0; i < count; ++i) {
            UserRecord record = mUsers.get(i);
            if (record.info != null && record.info.id == userId) {
                switchTo(record);
                return;
            }
        }

        Log.e(TAG, "Couldn't switch to user, id=" + userId);
    }

    private void switchToUserId(int id) {
        try {
            pauseRefreshUsers();