/** * Try to obtain ContactListFilter object saved in SharedPreference. * If there's no info there, return ALL filter instead. */ public static ContactListFilter restoreDefaultPreferences(SharedPreferences prefs) { ContactListFilter filter = restoreFromPreferences(prefs); if (filter == null) { filter = ContactListFilter.createFilterWithType(FILTER_TYPE_ALL_ACCOUNTS); } // "Group" filter is obsolete and thus is not exposed anymore. The "single contact mode" // should also not be stored in preferences anymore since it is a temporary state. if (filter.filterType == FILTER_TYPE_GROUP || filter.filterType == FILTER_TYPE_SINGLE_CONTACT) { filter = ContactListFilter.createFilterWithType(FILTER_TYPE_ALL_ACCOUNTS); } return filter; }