diff --git a/packages/SystemUI/res/drawable/managed_profile_toast_background.xml b/packages/SystemUI/res/drawable/managed_profile_toast_background.xml new file mode 100644 index 0000000000000..5c77b9a1f660e --- /dev/null +++ b/packages/SystemUI/res/drawable/managed_profile_toast_background.xml @@ -0,0 +1,21 @@ + + + + + + diff --git a/packages/SystemUI/res/drawable/stat_sys_managed_profile_status.xml b/packages/SystemUI/res/drawable/stat_sys_managed_profile_status.xml index 3c4c6468d6a6f..2bfa39d2392c8 100644 --- a/packages/SystemUI/res/drawable/stat_sys_managed_profile_status.xml +++ b/packages/SystemUI/res/drawable/stat_sys_managed_profile_status.xml @@ -20,10 +20,10 @@ Copyright (C) 2015 The Android Open Source Project android:viewportHeight="17.0"> diff --git a/packages/SystemUI/res/layout/managed_profile_toast.xml b/packages/SystemUI/res/layout/managed_profile_toast.xml new file mode 100644 index 0000000000000..5a01ca7f16a62 --- /dev/null +++ b/packages/SystemUI/res/layout/managed_profile_toast.xml @@ -0,0 +1,39 @@ + + + + + + diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index 0dcbe884b30f5..9a96939f700dc 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -143,4 +143,6 @@ #ffffffff #7fffffff #FFB0BEC5 + + #E5000000 diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index a2a2e5f0c63a6..a0b70f01dd96c 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -1012,7 +1012,7 @@ Touch to restore the original. - You are in the work profile + You\'re using your work profile Voice calls diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index ef8c5db6a5eea..85b4a642e72da 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -65,6 +65,7 @@ import android.util.Slog; import android.util.SparseArray; import android.util.SparseBooleanArray; import android.view.Display; +import android.view.Gravity; import android.view.IWindowManager; import android.view.LayoutInflater; import android.view.MotionEvent; @@ -395,8 +396,14 @@ public abstract class BaseStatusBar extends SystemUI implements 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(); + LayoutInflater inflater = (LayoutInflater) mContext.getSystemService( + Context.LAYOUT_INFLATER_SERVICE); + View layout = inflater.inflate(R.layout.managed_profile_toast, null); + Toast toast = new Toast(mContext); + toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0); + toast.setDuration(Toast.LENGTH_SHORT); + toast.setView(layout); + toast.show(); } } } else if (BANNER_ACTION_CANCEL.equals(action) || BANNER_ACTION_SETUP.equals(action)) {