use of cx.ring.daemon.StringMap in project ring-client-android by savoirfairelinux.
the class HardwareServiceImpl method setPreviewSettings.
@Override
public void setPreviewSettings() {
Map<String, StringMap> camSettings = new HashMap<>();
for (int i = 0; i < Camera.getNumberOfCameras(); i++) {
if (mNativeParams.get(i) != null) {
camSettings.put(Integer.toString(i), mNativeParams.get(i).toMap(mContext.getResources().getConfiguration().orientation));
Log.w(TAG, "setPreviewSettings camera:" + Integer.toString(i));
}
}
this.setPreviewSettings(camSettings);
}
use of cx.ring.daemon.StringMap in project ring-client-android by savoirfairelinux.
the class AccountService method enableRingProxy.
public void enableRingProxy() {
FutureUtils.executeDaemonThreadCallable(mExecutor, mDeviceRuntimeService.provideDaemonThreadId(), false, () -> {
for (Account acc : mAccountList) {
if (acc.isRing() && !acc.isDhtProxyEnabled()) {
Log.d(TAG, "Enabling proxy for account " + acc.getAccountID());
StringMap details = Ringservice.getAccountDetails(acc.getAccountID());
details.set(ConfigKey.PROXY_ENABLED.key(), "true");
Ringservice.setAccountDetails(acc.getAccountID(), details);
acc.setDhtProxyEnabled(true);
}
}
return true;
});
}
use of cx.ring.daemon.StringMap in project ring-client-android by savoirfairelinux.
the class RingAccountSummaryPresenter method handleKnownDevices.
private void handleKnownDevices(ServiceEvent event) {
String accountId = event.getEventInput(ServiceEvent.EventInput.ACCOUNT_ID, String.class);
Account currentAccount = mAccountService.getAccount(mAccountID);
if (currentAccount == null || !mAccountID.equals(accountId) || getView() == null) {
return;
}
final StringMap devices = event.getEventInput(ServiceEvent.EventInput.DEVICES, StringMap.class);
getView().updateDeviceList(devices.toNative(), currentAccount.getDeviceId());
}
use of cx.ring.daemon.StringMap in project ring-client-android by savoirfairelinux.
the class HardwareServiceImpl method switchInput.
@Override
public void switchInput(String id) {
Log.w(TAG, "switchInput " + id);
final int camId;
if (currentCamera == cameraBack) {
camId = cameraFront;
} else {
camId = cameraBack;
}
currentCamera = camId;
final String uri = "camera://" + camId;
final StringMap map = mNativeParams.get(camId).toMap(mContext.getResources().getConfiguration().orientation);
this.switchInput(id, uri, map);
}
use of cx.ring.daemon.StringMap in project ring-client-android by savoirfairelinux.
the class HardwareServiceImpl method restartCamera.
@Override
public void restartCamera(String id) {
stopCapture();
setPreviewSettings();
final String uri = "camera://" + currentCamera;
final StringMap map = mNativeParams.get(currentCamera).toMap(mContext.getResources().getConfiguration().orientation);
this.switchInput(id, uri, map);
}