Search in sources :

Example 31 with Account

use of cx.ring.model.Account in project ring-client-android by savoirfairelinux.

the class AccountService method incomingTrustRequest.

public void incomingTrustRequest(String accountId, String from, String message, long received) {
    Log.d(TAG, "incomingTrustRequest: " + accountId + ", " + from + ", " + message + ", " + received);
    Account account = getAccount(accountId);
    if (account != null) {
        TrustRequest request = new TrustRequest(accountId, from, received, message);
        account.addRequest(request);
        lookupAddress(accountId, "", from);
    }
}
Also used : Account(cx.ring.model.Account) TrustRequest(cx.ring.model.TrustRequest)

Example 32 with Account

use of cx.ring.model.Account in project ring-client-android by savoirfairelinux.

the class AccountService method renameDevice.

/**
 * @param accountId id of the account used with the device
 * @param newName   new device name
 */
public void renameDevice(final String accountId, final String newName) {
    final Account account = getAccount(accountId);
    account.setDevices(FutureUtils.executeDaemonThreadCallable(mExecutor, mDeviceRuntimeService.provideDaemonThreadId(), true, (Callable<Map<String, String>>) () -> {
        Log.i(TAG, "renameDevice() thread running... " + newName);
        StringMap details = Ringservice.getAccountDetails(accountId);
        details.set(ConfigKey.ACCOUNT_DEVICE_NAME.key(), newName);
        Ringservice.setAccountDetails(accountId, details);
        return Ringservice.getKnownRingDevices(accountId).toNative();
    }));
    account.setDetail(ConfigKey.ACCOUNT_DEVICE_NAME, newName);
}
Also used : Account(cx.ring.model.Account) StringMap(cx.ring.daemon.StringMap) Callable(java.util.concurrent.Callable)

Example 33 with Account

use of cx.ring.model.Account in project ring-client-android by savoirfairelinux.

the class RingNavigationPresenter method updateUser.

public void updateUser() {
    if (getView() == null) {
        return;
    }
    Account currentAccount = mAccountService.getCurrentAccount();
    getView().showViewModel(new RingNavigationViewModel(currentAccount, mAccountService.getAccounts()));
}
Also used : Account(cx.ring.model.Account)

Example 34 with Account

use of cx.ring.model.Account in project ring-client-android by savoirfairelinux.

the class RingAccountSummaryPresenter method registerName.

public void registerName(String name, String password) {
    final Account account = mAccountService.getAccount(mAccountID);
    if (account == null || getView() == null) {
        return;
    }
    mAccountService.registerName(account, password, name);
    getView().accountChanged(account);
}
Also used : Account(cx.ring.model.Account)

Example 35 with Account

use of cx.ring.model.Account in project ring-client-android by savoirfairelinux.

the class RingAccountSummaryPresenter method enableAccount.

public void enableAccount(boolean newValue) {
    Account account = mAccountService.getAccount(mAccountID);
    if (account == null) {
        Log.w(TAG, "account not found!");
        return;
    }
    account.setEnabled(newValue);
    mAccountService.setCredentials(account.getAccountID(), account.getCredentialsHashMapList());
    mAccountService.setAccountDetails(account.getAccountID(), account.getDetails());
}
Also used : Account(cx.ring.model.Account)

Aggregations

Account (cx.ring.model.Account)39 ServiceEvent (cx.ring.model.ServiceEvent)13 CallContact (cx.ring.model.CallContact)7 Uri (cx.ring.model.Uri)6 StringMap (cx.ring.daemon.StringMap)5 ArrayList (java.util.ArrayList)5 Conversation (cx.ring.model.Conversation)4 TrustRequest (cx.ring.model.TrustRequest)4 HashMap (java.util.HashMap)3 List (java.util.List)3 Map (java.util.Map)3 Conference (cx.ring.model.Conference)2 SecureSipCall (cx.ring.model.SecureSipCall)2 SipCall (cx.ring.model.SipCall)2 NameLookupInputHandler (cx.ring.utils.NameLookupInputHandler)2 Drawable (android.graphics.drawable.Drawable)1 LayoutInflater (android.view.LayoutInflater)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1