Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74044ef4 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Settings: Jump to contacts when set photo of user."

parents a93d1323 6a956f37
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -57,18 +57,11 @@ public class ProfileUpdateReceiver extends BroadcastReceiver {
    }

    static void copyProfileName(Context context) {
        SharedPreferences prefs = context.getSharedPreferences("profile", Context.MODE_PRIVATE);
        if (prefs.contains(KEY_PROFILE_NAME_COPIED_ONCE)) {
            return;
        }

        int userId = UserHandle.myUserId();
        UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
        String profileName = Utils.getMeProfileName(context, false /* partial name */);
        if (profileName != null && profileName.length() > 0) {
            um.setUserName(userId, profileName);
            // Flag that we've written the profile one time at least. No need to do it in the future.
            prefs.edit().putBoolean(KEY_PROFILE_NAME_COPIED_ONCE, true).commit();
        }
    }
}
+5 −1
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import android.os.UserManager;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceGroup;
import android.provider.ContactsContract;
import android.provider.Settings;
import android.provider.Settings.Secure;
import android.util.Log;
@@ -884,7 +885,10 @@ public class UserSettings extends SettingsPreferenceFragment
            if (mUserManager.isLinkedUser()) {
                onManageUserClicked(UserHandle.myUserId(), false);
            } else {
                showDialog(DIALOG_USER_PROFILE_EDITOR);
                Intent intent = ContactsContract.QuickContact.composeQuickContactsIntent(
                        getActivity(), getView(), ContactsContract.Profile.CONTENT_URI,
                        ContactsContract.QuickContact.MODE_LARGE, null);
                getActivity().startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT));
            }
        } else if (pref instanceof UserPreference) {
            int userId = ((UserPreference) pref).getUserId();