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

Commit 4b9b26ec authored by Isaac Katzenelson's avatar Isaac Katzenelson
Browse files

Sort people in group view according to sort settings

Bug: 5364236 People within groups are sorted alphabetically by last name
Change-Id: I808393fbbb07b9f618b8b8f46355bfe2c938e6a8
parent ca38a37f
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.contacts;

import com.android.contacts.list.ContactListAdapter;
import com.android.contacts.preference.ContactsPreferences;

import android.content.Context;
import android.content.CursorLoader;
@@ -81,8 +82,14 @@ public final class GroupMemberLoader extends CursorLoader {
        setProjection(PROJECTION_DATA);
        setSelection(createSelection());
        setSelectionArgs(createSelectionArgs());

        ContactsPreferences prefs = new ContactsPreferences(context);
        if (prefs.getSortOrder() == ContactsContract.Preferences.SORT_ORDER_PRIMARY) {
            setSortOrder(Contacts.SORT_KEY_PRIMARY);
        } else {
            setSortOrder(Contacts.SORT_KEY_ALTERNATIVE);
        }
    }

    private Uri createUri() {
        Uri uri = Data.CONTENT_URI;