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

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

Show guest notification on each user switch

Change-Id: I572ee347a4059789a67f6da4da008a293bcb3596
parent f931053e
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -400,12 +400,6 @@ public class UserSwitcherController {
                    switchToUserId(UserHandle.USER_SYSTEM);
                    stopUserId(currentUser);
                }
            } else if (Intent.ACTION_USER_ADDED.equals(intent.getAction())) {
                final int currentId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, -1);
                UserInfo userInfo = mUserManager.getUserInfo(currentId);
                if (userInfo != null && userInfo.isGuest()) {
                    showGuestNotification(currentId);
                }
            } else if (Intent.ACTION_USER_SWITCHED.equals(intent.getAction())) {
                if (mExitGuestDialog != null && mExitGuestDialog.isShowing()) {
                    mExitGuestDialog.cancel();
@@ -437,6 +431,9 @@ public class UserSwitcherController {
                        && userInfo.id != UserHandle.USER_SYSTEM) {
                    showLogoutNotification(currentId);
                }
                if (userInfo != null && userInfo.isGuest()) {
                    showGuestNotification(currentId);
                }
                unpauseRefreshUsers = true;
            } else if (Intent.ACTION_USER_INFO_CHANGED.equals(intent.getAction())) {
                forcePictureLoadForId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE,
@@ -477,6 +474,7 @@ public class UserSwitcherController {
                    .setContentTitle(mContext.getString(R.string.user_logout_notification_title))
                    .setContentText(mContext.getString(R.string.user_logout_notification_text))
                    .setContentIntent(logoutPI)
                    .setOngoing(true)
                    .setShowWhen(false)
                    .addAction(R.drawable.ic_delete,
                            mContext.getString(R.string.user_logout_notification_action),