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);
}
}
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);
}
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()));
}
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);
}
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());
}
Aggregations