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

Commit 06f5e07a authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by Android (Google) Code Review
Browse files

Merge "Show guest notification on each user switch"

parents ab334697 ce161861
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),