Don't use the profile info for name

Since we now have a way to directly edit the user's photo/name
via a dialog, don't rely on the Me profile name anymore. That
one will be out of sync with the manual nickname editing.

Bug: 15761405
Change-Id: Ia16c43ddcfd47894b2d2e049802d7de153ea5b94
diff --git a/src/com/android/settings/ManagedProfileSetup.java b/src/com/android/settings/ManagedProfileSetup.java
index bb73bd7..8677219 100644
--- a/src/com/android/settings/ManagedProfileSetup.java
+++ b/src/com/android/settings/ManagedProfileSetup.java
@@ -76,5 +76,5 @@
         ComponentName settingsComponentName = new ComponentName(context, Settings.class);
         pm.setComponentEnabledSetting(settingsComponentName,
                 PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
-        }
+    }
 }
diff --git a/src/com/android/settings/users/UserSettings.java b/src/com/android/settings/users/UserSettings.java
index 5f3c1f8..e04791d 100644
--- a/src/com/android/settings/users/UserSettings.java
+++ b/src/com/android/settings/users/UserSettings.java
@@ -50,8 +50,6 @@
 import android.preference.Preference;
 import android.preference.Preference.OnPreferenceClickListener;
 import android.preference.PreferenceGroup;
-import android.provider.ContactsContract;
-import android.provider.ContactsContract.Contacts;
 import android.provider.Settings.Secure;
 import android.util.Log;
 import android.util.SparseArray;
@@ -142,7 +140,6 @@
     private int mRemovingUserId = -1;
     private int mAddedUserId = 0;
     private boolean mAddingUser;
-    private boolean mProfileExists;
     private boolean mEnabled = true;
     private boolean mCanAddRestrictedProfile = true;
 
@@ -310,7 +307,6 @@
      * Loads profile information for the current user.
      */
     private void loadProfile() {
-        mProfileExists = false;
         if (mIsGuest) {
             // No need to load profile information
             mMePreference.setIcon(getEncircledGuestDrawable());
@@ -330,11 +326,7 @@
                 if (user.iconPath == null || user.iconPath.equals("")) {
                     assignProfilePhoto(user);
                 }
-                String profileName = getProfileName();
-                if (profileName == null) {
-                    profileName = user.name;
-                }
-                return profileName;
+                return user.name;
             }
         }.execute();
     }
@@ -843,14 +835,6 @@
         }
     }
 
-    private String getProfileName() {
-        String name = Utils.getMeProfileName(getActivity(), true);
-        if (name != null) {
-            mProfileExists = true;
-        }
-        return name;
-    }
-
     private void assignDefaultPhoto(UserInfo user) {
         Bitmap bitmap = createBitmapFromDrawable(
                 USER_DRAWABLES[user.id % UserSettings.USER_DRAWABLES.length]);