diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index 4dd203c..9693ed9 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -336,24 +336,31 @@
     }
 
     /* Used by UserSettings as well. Call this on a non-ui thread. */
-    public static boolean copyMeProfilePhoto(Context context, UserInfo user) {
+    public static void copyMeProfilePhoto(Context context, UserInfo user) {
         Uri contactUri = Profile.CONTENT_URI;
 
+        int userId = user != null ? user.id : UserHandle.myUserId();
+
         InputStream avatarDataStream = Contacts.openContactPhotoInputStream(
                     context.getContentResolver(),
                     contactUri, true);
         // If there's no profile photo, assign a default avatar
         if (avatarDataStream == null) {
-            return false;
+            assignDefaultPhoto(context, userId);
+        } else {
+            UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
+            Bitmap icon = BitmapFactory.decodeStream(avatarDataStream);
+            um.setUserIcon(userId, icon);
         }
-        int userId = user != null ? user.id : UserHandle.myUserId();
-        UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
-        Bitmap icon = BitmapFactory.decodeStream(avatarDataStream);
-        um.setUserIcon(userId, icon);
         try {
             avatarDataStream.close();
         } catch (IOException ioe) { }
-        return true;
+    }
+
+    public static void assignDefaultPhoto(Context context, int userId) {
+        UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
+        Bitmap bitmap = getDefaultUserIconAsBitmap(userId);
+        um.setUserIcon(userId, bitmap);
     }
 
     public static String getMeProfileName(Context context, boolean full) {
diff --git a/src/com/android/settings/users/UserSettings.java b/src/com/android/settings/users/UserSettings.java
index eb74c4b..bf93cd3 100644
--- a/src/com/android/settings/users/UserSettings.java
+++ b/src/com/android/settings/users/UserSettings.java
@@ -331,7 +331,8 @@
             protected String doInBackground(Void... values) {
                 UserInfo user = mUserManager.getUserInfo(UserHandle.myUserId());
                 if (user.iconPath == null || user.iconPath.equals("")) {
-                    assignProfilePhoto(user);
+                    // Assign profile photo.
+                    Utils.copyMeProfilePhoto(getActivity(), user);
                 }
                 return user.name;
             }
@@ -404,14 +405,14 @@
 
     private UserInfo createRestrictedProfile() {
         UserInfo newUserInfo = mUserManager.createRestrictedProfile(mAddingUserName);
-        assignDefaultPhoto(newUserInfo);
+        Utils.assignDefaultPhoto(getActivity(), newUserInfo.id);
         return newUserInfo;
     }
 
     private UserInfo createTrustedUser() {
         UserInfo newUserInfo = mUserManager.createUser(mAddingUserName, 0);
         if (newUserInfo != null) {
-            assignDefaultPhoto(newUserInfo);
+            Utils.assignDefaultPhoto(getActivity(), newUserInfo.id);
         }
         return newUserInfo;
     }
@@ -898,17 +899,6 @@
         }.execute(missingIcons);
     }
 
-    private void assignProfilePhoto(final UserInfo user) {
-        if (!Utils.copyMeProfilePhoto(getActivity(), user)) {
-            assignDefaultPhoto(user);
-        }
-    }
-
-    private void assignDefaultPhoto(UserInfo user) {
-        Bitmap bitmap = Utils.getDefaultUserIconAsBitmap(user.id);
-        mUserManager.setUserIcon(user.id, bitmap);
-    }
-
     private Drawable getEncircledDefaultIcon() {
         if (mDefaultIconDrawable == null) {
             mDefaultIconDrawable = encircle(Utils.getDefaultUserIconAsBitmap(UserHandle.USER_NULL));
