Search in sources :

Example 6 with Settings

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;
}
Also used : Settings(cx.ring.model.Settings) CallContact(cx.ring.model.CallContact)

Example 7 with Settings

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);
}
Also used : Settings(cx.ring.model.Settings)

Aggregations

Settings (cx.ring.model.Settings)7 CallContact (cx.ring.model.CallContact)3 SharedPreferences (android.content.SharedPreferences)1 ServiceEvent (cx.ring.model.ServiceEvent)1 ArrayList (java.util.ArrayList)1