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

Commit 9b34a4e5 authored by Yorke Lee's avatar Yorke Lee
Browse files

Make ContactPreferences use SharedPreferences instead of System settings (1/5)

* Move constants that originally lived in the framework into ContactsCommon
* Use SharedPreferences instead of System settings to persist preferences
* Use a SharedPreferenceListener to monitor changes instead of a content observer
on system settings
* Move DisplayOrderPreference and SortOrderPreference into ContactsCommon so that
it can be used by Dialer
* Create base DialerSettingsActivity in Dialer, and make GoogleDialerSettingsActivity
extend it
Bug: 16153186

Change-Id: I14edf1e2277441b2d2a8f004b651ebd97bc06aa9
parent bc2b9d30
Loading
Loading
Loading
Loading
+0 −51
Original line number Diff line number Diff line
@@ -246,57 +246,6 @@ public final class ContactsContract {
        public static final String KEY_AUTHORIZED_URI = "authorized_uri";
    }

    /**
     * @hide
     */
    public static final class Preferences {

        /**
         * A key in the {@link android.provider.Settings android.provider.Settings} provider
         * that stores the preferred sorting order for contacts (by given name vs. by family name).
         *
         * @hide
         */
        public static final String SORT_ORDER = "android.contacts.SORT_ORDER";

        /**
         * The value for the SORT_ORDER key corresponding to sorting by given name first.
         *
         * @hide
         */
        public static final int SORT_ORDER_PRIMARY = 1;

        /**
         * The value for the SORT_ORDER key corresponding to sorting by family name first.
         *
         * @hide
         */
        public static final int SORT_ORDER_ALTERNATIVE = 2;

        /**
         * A key in the {@link android.provider.Settings android.provider.Settings} provider
         * that stores the preferred display order for contacts (given name first vs. family
         * name first).
         *
         * @hide
         */
        public static final String DISPLAY_ORDER = "android.contacts.DISPLAY_ORDER";

        /**
         * The value for the DISPLAY_ORDER key corresponding to showing the given name first.
         *
         * @hide
         */
        public static final int DISPLAY_ORDER_PRIMARY = 1;

        /**
         * The value for the DISPLAY_ORDER key corresponding to showing the family name first.
         *
         * @hide
         */
        public static final int DISPLAY_ORDER_ALTERNATIVE = 2;
    }

    /**
     * A Directory represents a contacts corpus, e.g. Local contacts,
     * Google Apps Global Address List or Corporate Global Address List.