Fix: change owner name when account setup

When the device is setup with an account the
owner's user name should be updated. This was broken due to
ag/14056085, so we fix it here.

Test: manual (set up new device and make sure name is changed)
Bug: 194510551
Change-Id: Ide5bc525eba17c78f457c2baa131d7cefd4c15dd
This commit is contained in:
Adam Bookatz
2021-07-23 12:53:43 -07:00
parent 7c55ea3fc0
commit 7ae8801fba

View File

@@ -63,6 +63,9 @@ public class ProfileUpdateReceiver extends BroadcastReceiver {
/** Returns whether the current user name is different from the default one. */
private static boolean isCurrentNameInteresting(Context context, UserManager um) {
if (!um.isUserNameSet()) {
return false;
}
final String currentName = um.getUserName();
final String defaultName = um.isRestrictedProfile() || um.isProfile() ?
context.getString(com.android.settingslib.R.string.user_new_profile_name) :