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

Commit 53de9046 authored by Dmitri Plotnikov's avatar Dmitri Plotnikov
Browse files

Adding support for "contact counts grouped by the first letter

of the sort key".

This is needed for two purposes:
1. To fix the A-Z index, specifically non-English ones and
address the issue of messed up index when sort order does not match
display order.

2. Take the first step toward the introduction of a scrolling
cursor.  When we have a scrolling cursor, we will _have_ to
build the index independently of fetching all of the data.

Bug: 2407129
Change-Id: Ie2979ff8e67446329ea6d1c2f5c9f4f215e6ec89
parent f7c56989
Loading
Loading
Loading
Loading
+39 −1
Original line number Diff line number Diff line
@@ -607,6 +607,45 @@ public final class ContactsContract {
        public static final String SORT_KEY_ALTERNATIVE = "sort_key_alt";
    }

    /**
     * URI parameter and cursor extras that return counts of rows grouped by the
     * address book index, which is usually the first letter of the sort key.
     * When this parameter is supplied, the row counts are returned in the
     * cursor extras bundle.
     *
     * @hide
     */
    public final static class ContactCounts {

        /**
         * Add this query parameter to a URI to get back row counts grouped by
         * the address book index as cursor extras. For most languages it is the
         * first letter of the sort key. This parameter does not affect the main
         * content of the cursor.
         *
         * @hide
         */
        public static final String ADDRESS_BOOK_INDEX_EXTRAS = "address_book_index_extras";

        /**
         * The array of address book index titles, which are returned in the
         * same order as the data in the cursor.
         * <p>TYPE: String[]</p>
         *
         * @hide
         */
        public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "address_book_index_titles";

        /**
         * The array of group counts for the corresponding group.  Contains the same number
         * of elements as the EXTRA_ADDRESS_BOOK_INDEX_TITLES array.
         * <p>TYPE: int[]</p>
         *
         * @hide
         */
        public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "address_book_index_counts";
    }

    /**
     * Constants for the contacts table, which contains a record per aggregate
     * of raw contacts representing the same person.
@@ -5695,5 +5734,4 @@ public final class ContactsContract {
            public static final String IM_ISPRIMARY = "im_isprimary";
        }
    }

}