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

Commit e81000ba authored by yaolu's avatar yaolu
Browse files

Show starred contacts from only selected groups in customized view

Bug: 31710454

Test: Manually verified
1. All starred contacts show in all contacts list;
2. No starred contacts show when no group is selected in customized
view;
3. Only starred contacts from selected groups show in customized
view.

Change-Id: I73672ea472753b5194856da2354e5c87a2549648
parent 942086e6
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -115,8 +115,15 @@ public class FavoritesAndContactsLoader extends CursorLoader {
    }

    private Cursor loadFavoritesContacts() {
        final StringBuilder selection = new StringBuilder();
        selection.append(Contacts.STARRED + "=?");
        final ContactListFilter filter =
                ContactListFilterController.getInstance(getContext()).getFilter();
        if (filter != null && filter.filterType == ContactListFilter.FILTER_TYPE_CUSTOM) {
            selection.append(" AND ").append(Contacts.IN_VISIBLE_GROUP + "=1");
        }
        return getContext().getContentResolver().query(
                Contacts.CONTENT_URI, mProjection, Contacts.STARRED + "=?", new String[]{"1"},
                Contacts.CONTENT_URI, mProjection, selection.toString(), new String[]{"1"},
                getSortOrder());
    }
}