diff --git a/core/res/res/layout/user_switching_dialog.xml b/core/res/res/layout/user_switching_dialog.xml new file mode 100644 index 0000000000000..8617e5ddbd212 --- /dev/null +++ b/core/res/res/layout/user_switching_dialog.xml @@ -0,0 +1,27 @@ + + + + diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index d2cf689cb5371..d6224da2e729a 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -4545,7 +4545,7 @@ Current user %1$s. - Switching to user %1$s + Switching to %1$s\u2026 Owner diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 3f373aabde838..11d712ef906a0 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1253,6 +1253,7 @@ + diff --git a/services/core/java/com/android/server/am/UserSwitchingDialog.java b/services/core/java/com/android/server/am/UserSwitchingDialog.java index 59d53ec8d929b..dfc8df580a15c 100644 --- a/services/core/java/com/android/server/am/UserSwitchingDialog.java +++ b/services/core/java/com/android/server/am/UserSwitchingDialog.java @@ -16,6 +16,7 @@ package com.android.server.am; +import android.app.AlertDialog; import android.app.Service; import android.content.ActivityNotFoundException; import android.content.Context; @@ -25,7 +26,12 @@ import android.content.res.Resources; import android.os.Handler; import android.os.Message; import android.util.Slog; +import android.view.LayoutInflater; +import android.view.View; import android.view.WindowManager; +import android.widget.TextView; + +import com.android.internal.R; /** * Dialog to show when a user switch it about to happen. The intent is to snapshot the screen @@ -33,7 +39,7 @@ import android.view.WindowManager; * in the background rather than just freeze the screen and not know if the user-switch affordance * was being handled. */ -final class UserSwitchingDialog extends BaseErrorDialog { +final class UserSwitchingDialog extends AlertDialog { private static final String TAG = "ActivityManagerUserSwitchingDialog"; private static final int MSG_START_USER = 1; @@ -47,9 +53,16 @@ final class UserSwitchingDialog extends BaseErrorDialog { mService = service; mUserId = userId; - Resources res = context.getResources(); + + // Set up the dialog contents setCancelable(false); - setMessage(res.getString(com.android.internal.R.string.user_switching_message, userName)); + Resources res = getContext().getResources(); + // Custom view due to alignment and font size requirements + View view = LayoutInflater.from(getContext()).inflate(R.layout.user_switching_dialog, null); + ((TextView) view.findViewById(R.id.message)).setText( + res.getString(com.android.internal.R.string.user_switching_message, userName)); + setView(view); + if (aboveSystem) { getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR); }