use of cx.ring.daemon.StringMap in project ring-client-android by savoirfairelinux.
the class AccountService method setAccountDetails.
/**
* Sets the account details in the Daemon
*/
@SuppressWarnings("unchecked")
public // Hashmap runtime cast
void setAccountDetails(final String accountId, final Map map) {
Log.i(TAG, "setAccountDetails() " + map.get("Account.hostname"));
final StringMap swigmap = StringMap.toSwig(map);
FutureUtils.executeDaemonThreadCallable(mExecutor, mDeviceRuntimeService.provideDaemonThreadId(), false, () -> {
Ringservice.setAccountDetails(accountId, swigmap);
Log.i(TAG, "setAccountDetails() thread running... " + swigmap.get("Account.hostname"));
return true;
});
}
use of cx.ring.daemon.StringMap 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.daemon.StringMap in project ring-client-android by savoirfairelinux.
the class CallService method sendAccountTextMessage.
public Long sendAccountTextMessage(final String accountId, final String to, final String msg) {
return FutureUtils.executeDaemonThreadCallable(mExecutor, mDeviceRuntimeService.provideDaemonThreadId(), true, () -> {
Log.i(TAG, "sendAccountTextMessage() thread running... " + accountId + " " + to + " " + msg);
StringMap msgs = new StringMap();
msgs.setRaw("text/plain", Blob.fromString(msg));
return Ringservice.sendAccountTextMessage(accountId, to, msgs);
});
}
use of cx.ring.daemon.StringMap in project ring-client-android by savoirfairelinux.
the class CallService method sendTextMessage.
public void sendTextMessage(final String callId, final String msg) {
FutureUtils.executeDaemonThreadCallable(mExecutor, mDeviceRuntimeService.provideDaemonThreadId(), false, () -> {
Log.i(TAG, "sendTextMessage() thread running...");
StringMap messages = new StringMap();
messages.setRaw("text/plain", Blob.fromString(msg));
Ringservice.sendTextMessage(callId, messages, "", false);
return true;
});
}