diff options
author | Kenny Guy <kennyguy@google.com> | 2015-04-14 14:20:43 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-14 14:20:45 +0000 |
commit | 4fc266bbef6129b5cefc910f0680eb9d61794faf (patch) | |
tree | 1c09dc767d0f3214b1c03b1ce59512b8b514efe5 /packages/SystemUI/src/com/android/systemui/statusbar | |
parent | 575217fc3da38357f1d5e322bf1c7a07b909ef2a (diff) | |
parent | dae30d5dd3787b84ec97f4886b9f97ec3d7c4a26 (diff) | |
download | frameworks_base-4fc266bbef6129b5cefc910f0680eb9d61794faf.zip frameworks_base-4fc266bbef6129b5cefc910f0680eb9d61794faf.tar.gz frameworks_base-4fc266bbef6129b5cefc910f0680eb9d61794faf.tar.bz2 |
Merge "Display toast when screen is unlocked to a work app."
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index d2837b7..ee607a7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -80,6 +80,7 @@ import android.widget.DateTimeView; import android.widget.ImageView; import android.widget.RemoteViews; import android.widget.TextView; +import android.widget.Toast; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.StatusBarIcon; @@ -378,6 +379,23 @@ public abstract class BaseStatusBar extends SystemUI implements userSwitched(mCurrentUserId); } else if (Intent.ACTION_USER_ADDED.equals(action)) { updateCurrentProfilesCache(); + } else if (Intent.ACTION_USER_PRESENT.equals(action)) { + List<ActivityManager.RecentTaskInfo> recentTask = null; + try { + recentTask = ActivityManagerNative.getDefault().getRecentTasks(1, + ActivityManager.RECENT_WITH_EXCLUDED + | ActivityManager.RECENT_INCLUDE_PROFILES, + mCurrentUserId); + } catch (RemoteException e) { + // Abandon hope activity manager not running. + } + if (recentTask != null && recentTask.size() > 0) { + UserInfo user = mUserManager.getUserInfo(recentTask.get(0).userId); + if (user != null && user.isManagedProfile()) { + Toast.makeText(mContext, R.string.managed_profile_foreground_toast, + Toast.LENGTH_SHORT).show(); + } + } } else if (DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED.equals( action)) { mUsersAllowingPrivateNotifications.clear(); @@ -612,6 +630,7 @@ public abstract class BaseStatusBar extends SystemUI implements IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_USER_SWITCHED); filter.addAction(Intent.ACTION_USER_ADDED); + filter.addAction(Intent.ACTION_USER_PRESENT); filter.addAction(BANNER_ACTION_CANCEL); filter.addAction(BANNER_ACTION_SETUP); filter.addAction(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED); |