Loading packages/SystemUI/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -982,4 +982,7 @@ <!-- Volume dialog zen toggle switch title --> <string name="volume_zen_switch_text">@*android:string/zen_mode_feature_name</string> <!-- Toast shown when user unlocks screen and managed profile activity is in the foreground --> <string name="managed_profile_foreground_toast">You are in the Work profile</string> </resources> packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +19 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); Loading Loading @@ -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); Loading Loading
packages/SystemUI/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -982,4 +982,7 @@ <!-- Volume dialog zen toggle switch title --> <string name="volume_zen_switch_text">@*android:string/zen_mode_feature_name</string> <!-- Toast shown when user unlocks screen and managed profile activity is in the foreground --> <string name="managed_profile_foreground_toast">You are in the Work profile</string> </resources>
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +19 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); Loading Loading @@ -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); Loading