Search in sources :

Example 1 with StringMap

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);
}
Also used : StringMap(cx.ring.daemon.StringMap) HashMap(java.util.HashMap) Point(android.graphics.Point)

Example 2 with StringMap

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

Example 3 with StringMap

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

Example 4 with StringMap

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);
}
Also used : StringMap(cx.ring.daemon.StringMap) Point(android.graphics.Point)

Example 5 with StringMap

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

Aggregations

StringMap (cx.ring.daemon.StringMap)9 Account (cx.ring.model.Account)3 Point (android.graphics.Point)2 HashMap (java.util.HashMap)1 Callable (java.util.concurrent.Callable)1