diff options
| author | 2015-08-18 12:41:52 -0700 | |
|---|---|---|
| committer | 2015-08-18 12:41:52 -0700 | |
| commit | ce161861c3507c91c25b2491abac1e7611d14c5c (patch) | |
| tree | 9c3f3fa912c3d69c834d0d984d5c912f1c1a543c | |
| parent | f931053e3386c42ba53af4d288605c2d2c8b941a (diff) | |
Show guest notification on each user switch
Change-Id: I572ee347a4059789a67f6da4da008a293bcb3596
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java index bc7d1b77d75e..81658941b339 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java @@ -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), |