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
This commit is contained in:
Amith Yamasani
2014-07-25 09:37:33 -07:00
parent 8610ff9ea6
commit 2d578ce293
2 changed files with 2 additions and 18 deletions

View File

@@ -76,5 +76,5 @@ public class ManagedProfileSetup extends BroadcastReceiver {
ComponentName settingsComponentName = new ComponentName(context, Settings.class); ComponentName settingsComponentName = new ComponentName(context, Settings.class);
pm.setComponentEnabledSetting(settingsComponentName, pm.setComponentEnabledSetting(settingsComponentName,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
} }
} }

View File

@@ -50,8 +50,6 @@ import android.os.UserManager;
import android.preference.Preference; import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener; import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceGroup; import android.preference.PreferenceGroup;
import android.provider.ContactsContract;
import android.provider.ContactsContract.Contacts;
import android.provider.Settings.Secure; import android.provider.Settings.Secure;
import android.util.Log; import android.util.Log;
import android.util.SparseArray; import android.util.SparseArray;
@@ -142,7 +140,6 @@ public class UserSettings extends SettingsPreferenceFragment
private int mRemovingUserId = -1; private int mRemovingUserId = -1;
private int mAddedUserId = 0; private int mAddedUserId = 0;
private boolean mAddingUser; private boolean mAddingUser;
private boolean mProfileExists;
private boolean mEnabled = true; private boolean mEnabled = true;
private boolean mCanAddRestrictedProfile = true; private boolean mCanAddRestrictedProfile = true;
@@ -310,7 +307,6 @@ public class UserSettings extends SettingsPreferenceFragment
* Loads profile information for the current user. * Loads profile information for the current user.
*/ */
private void loadProfile() { private void loadProfile() {
mProfileExists = false;
if (mIsGuest) { if (mIsGuest) {
// No need to load profile information // No need to load profile information
mMePreference.setIcon(getEncircledGuestDrawable()); mMePreference.setIcon(getEncircledGuestDrawable());
@@ -330,11 +326,7 @@ public class UserSettings extends SettingsPreferenceFragment
if (user.iconPath == null || user.iconPath.equals("")) { if (user.iconPath == null || user.iconPath.equals("")) {
assignProfilePhoto(user); assignProfilePhoto(user);
} }
String profileName = getProfileName(); return user.name;
if (profileName == null) {
profileName = user.name;
}
return profileName;
} }
}.execute(); }.execute();
} }
@@ -843,14 +835,6 @@ public class UserSettings extends SettingsPreferenceFragment
} }
} }
private String getProfileName() {
String name = Utils.getMeProfileName(getActivity(), true);
if (name != null) {
mProfileExists = true;
}
return name;
}
private void assignDefaultPhoto(UserInfo user) { private void assignDefaultPhoto(UserInfo user) {
Bitmap bitmap = createBitmapFromDrawable( Bitmap bitmap = createBitmapFromDrawable(
USER_DRAWABLES[user.id % UserSettings.USER_DRAWABLES.length]); USER_DRAWABLES[user.id % UserSettings.USER_DRAWABLES.length]);