Merge "Fix app crash while adding new user"
diff --git a/src/com/android/settings/users/UserSettings.java b/src/com/android/settings/users/UserSettings.java
index bef2e9a..ec055f1 100644
--- a/src/com/android/settings/users/UserSettings.java
+++ b/src/com/android/settings/users/UserSettings.java
@@ -450,6 +450,10 @@
private void onUserCreated(int userId) {
mAddedUserId = userId;
mAddingUser = false;
+ if (!isResumed()) {
+ Log.w(TAG, "Cannot show dialog after onPause");
+ return;
+ }
if (mUserManager.getUserInfo(userId).isRestricted()) {
showDialog(DIALOG_SETUP_PROFILE);
} else {