use of cx.ring.model.Settings in project ring-client-android by savoirfairelinux.
the class ContactService method findContactById.
/**
* Searches a contact in the local cache and then in the system repository
* In the last case, the contact is created and added to the local cache
*
* @return The found/created contact
*/
public CallContact findContactById(long id, String key) {
if (id <= CallContact.DEFAULT_ID) {
return null;
}
Settings settings = mPreferencesService.loadSettings();
CallContact contact = mContactList.get(id);
if (contact == null && (settings.isAllowSystemContacts() && mDeviceRuntimeService.hasContactPermission())) {
Log.w(TAG, "getContactById : cache miss for " + id);
contact = findContactByIdFromSystem(id, key);
if (contact != null) {
mContactList.put(id, contact);
}
}
return contact;
}
use of cx.ring.model.Settings in project ring-client-android by savoirfairelinux.
the class SettingsPresenter method loadSettings.
public void loadSettings() {
if (getView() == null) {
return;
}
// load the app settings
Settings settings = mPreferencesService.loadSettings();
// let the view display the associated ViewModel
getView().showViewModel(settings);
}
Aggregations