Search in sources :

Example 1 with MXDeviceInfo

use of org.matrix.androidsdk.crypto.data.MXDeviceInfo in project matrix-android-sdk by matrix-org.

the class CryptoTest method test07_testAliceAndBobInACryptedRoom.

@Test
public void test07_testAliceAndBobInACryptedRoom() throws Exception {
    Log.e(LOG_TAG, "test07_testAliceAndBobInACryptedRoom");
    Context context = InstrumentationRegistry.getContext();
    final HashMap<String, Object> results = new HashMap<>();
    doE2ETestWithAliceAndBobInARoom(true);
    final String messageFromAlice = "Hello I'm Alice!";
    Room roomFromBobPOV = mBobSession.getDataHandler().getRoom(mRoomId);
    Room roomFromAlicePOV = mAliceSession.getDataHandler().getRoom(mRoomId);
    assertTrue(roomFromBobPOV.isEncrypted());
    assertTrue(roomFromAlicePOV.isEncrypted());
    final CountDownLatch lock1 = new CountDownLatch(1);
    roomFromAlicePOV.sendEvent(buildTextEvent(messageFromAlice, mAliceSession), new ApiCallback<Void>() {

        @Override
        public void onSuccess(Void info) {
            lock1.countDown();
        }

        @Override
        public void onNetworkError(Exception e) {
            lock1.countDown();
        }

        @Override
        public void onMatrixError(MatrixError e) {
            results.put("sendEventError", e);
            lock1.countDown();
        }

        @Override
        public void onUnexpectedError(Exception e) {
            lock1.countDown();
        }
    });
    lock1.await(2000, TimeUnit.MILLISECONDS);
    assertTrue(results.containsKey("sendEventError"));
    MXCryptoError error = (MXCryptoError) results.get("sendEventError");
    assertTrue(TextUtils.equals(error.errcode, MXCryptoError.UNKNOWN_DEVICES_CODE));
    MXUsersDevicesMap<MXDeviceInfo> unknownDevices = (MXUsersDevicesMap<MXDeviceInfo>) error.mExceptionData;
    List<String> deviceInfos = unknownDevices.getUserDeviceIds(mBobSession.getMyUserId());
    assertTrue(1 == deviceInfos.size());
    assertTrue(TextUtils.equals(deviceInfos.get(0), mBobSession.getCrypto().getMyDevice().deviceId));
    final CountDownLatch lock2 = new CountDownLatch(1);
    mAliceSession.getCrypto().setDevicesKnown(Arrays.asList(mBobSession.getCrypto().getMyDevice()), new ApiCallback<Void>() {

        @Override
        public void onSuccess(Void info) {
            results.put("setDevicesKnown", "setDevicesKnown");
            lock2.countDown();
        }

        @Override
        public void onNetworkError(Exception e) {
            lock2.countDown();
        }

        @Override
        public void onMatrixError(MatrixError e) {
            lock2.countDown();
        }

        @Override
        public void onUnexpectedError(Exception e) {
            lock2.countDown();
        }
    });
    lock2.await(2000, TimeUnit.MILLISECONDS);
    assertTrue(results.containsKey("setDevicesKnown"));
    final CountDownLatch lock3 = new CountDownLatch(3);
    MXEventListener eventListener = new MXEventListener() {

        @Override
        public void onLiveEvent(Event event, RoomState roomState) {
            try {
                if (TextUtils.equals(event.getType(), Event.EVENT_TYPE_MESSAGE)) {
                    if (checkEncryptedEvent(event, mRoomId, messageFromAlice, mAliceSession)) {
                        results.put("onLiveEvent", "onLiveEvent");
                        lock3.countDown();
                    }
                }
            } catch (Exception e) {
            }
        }
    };
    mBobSession.getDataHandler().addListener(new MXEventListener() {

        @Override
        public void onToDeviceEvent(Event event) {
            results.put("onToDeviceEvent", event);
            lock3.countDown();
        }
    });
    roomFromBobPOV.addEventListener(eventListener);
    roomFromAlicePOV.sendEvent(buildTextEvent(messageFromAlice, mAliceSession), new ApiCallback<Void>() {

        @Override
        public void onSuccess(Void info) {
            lock3.countDown();
        }

        @Override
        public void onNetworkError(Exception e) {
            lock3.countDown();
        }

        @Override
        public void onMatrixError(MatrixError e) {
            lock3.countDown();
        }

        @Override
        public void onUnexpectedError(Exception e) {
            lock3.countDown();
        }
    });
    lock3.await(2000, TimeUnit.MILLISECONDS);
    assertTrue(results.containsKey("onToDeviceEvent"));
    assertTrue(results.containsKey("onLiveEvent"));
    assertTrue(mBobSession.getCrypto().getDeviceTrackingStatus(mBobSession.getMyUserId()) == MXDeviceList.TRACKING_STATUS_UP_TO_DATE);
    assertTrue(mBobSession.getCrypto().getDeviceTrackingStatus(mAliceSession.getMyUserId()) == MXDeviceList.TRACKING_STATUS_UP_TO_DATE);
    assertTrue(mAliceSession.getCrypto().getDeviceTrackingStatus(mBobSession.getMyUserId()) == MXDeviceList.TRACKING_STATUS_UP_TO_DATE);
    assertTrue(mAliceSession.getCrypto().getDeviceTrackingStatus(mAliceSession.getMyUserId()) == MXDeviceList.TRACKING_STATUS_UP_TO_DATE);
    mBobSession.clear(context);
}
Also used : Context(android.content.Context) HashMap(java.util.HashMap) MXDeviceInfo(org.matrix.androidsdk.crypto.data.MXDeviceInfo) CountDownLatch(java.util.concurrent.CountDownLatch) MXUsersDevicesMap(org.matrix.androidsdk.crypto.data.MXUsersDevicesMap) MXEventListener(org.matrix.androidsdk.listeners.MXEventListener) Event(org.matrix.androidsdk.rest.model.Event) JsonObject(com.google.gson.JsonObject) MatrixError(org.matrix.androidsdk.rest.model.MatrixError) Room(org.matrix.androidsdk.data.Room) MXCryptoError(org.matrix.androidsdk.crypto.MXCryptoError) RoomState(org.matrix.androidsdk.data.RoomState) Test(org.junit.Test)

Example 2 with MXDeviceInfo

use of org.matrix.androidsdk.crypto.data.MXDeviceInfo in project matrix-android-sdk by matrix-org.

the class CryptoTest method test03_testKeysUploadAndDownload.

@Test
public void test03_testKeysUploadAndDownload() throws Exception {
    Log.e(LOG_TAG, "test03_testKeysUploadAndDownload");
    Context context = InstrumentationRegistry.getContext();
    final HashMap<String, Object> results = new HashMap<>();
    createAliceAccount();
    mAliceSession.getCredentials().deviceId = "AliceDevice";
    final CountDownLatch lock0 = new CountDownLatch(1);
    mAliceSession.enableCrypto(true, new ApiCallback<Void>() {

        @Override
        public void onSuccess(Void info) {
            results.put("enableCrypto", "enableCrypto");
            lock0.countDown();
        }

        @Override
        public void onNetworkError(Exception e) {
            lock0.countDown();
        }

        @Override
        public void onMatrixError(MatrixError e) {
            lock0.countDown();
        }

        @Override
        public void onUnexpectedError(Exception e) {
            lock0.countDown();
        }
    });
    lock0.await(1000, TimeUnit.MILLISECONDS);
    assertTrue(results.containsKey("enableCrypto"));
    createBobAccount();
    final CountDownLatch lock2 = new CountDownLatch(1);
    mBobSession.getCredentials().deviceId = "BobDevice";
    mBobSession.enableCrypto(true, new ApiCallback<Void>() {

        @Override
        public void onSuccess(Void info) {
            results.put("enableCrypto2", "enableCrypto2");
            lock2.countDown();
        }

        @Override
        public void onNetworkError(Exception e) {
            lock2.countDown();
        }

        @Override
        public void onMatrixError(MatrixError e) {
            lock2.countDown();
        }

        @Override
        public void onUnexpectedError(Exception e) {
            lock2.countDown();
        }
    });
    lock2.await(1000, TimeUnit.MILLISECONDS);
    assertTrue(results.containsKey("enableCrypto2"));
    final CountDownLatch lock3 = new CountDownLatch(1);
    mBobSession.getCrypto().getDeviceList().downloadKeys(Arrays.asList(mBobSession.getMyUserId(), mAliceSession.getMyUserId()), false, new ApiCallback<MXUsersDevicesMap<MXDeviceInfo>>() {

        @Override
        public void onSuccess(MXUsersDevicesMap<MXDeviceInfo> info) {
            results.put("downloadKeys", info);
            lock3.countDown();
        }

        @Override
        public void onNetworkError(Exception e) {
            lock3.countDown();
        }

        @Override
        public void onMatrixError(MatrixError e) {
            lock3.countDown();
        }

        @Override
        public void onUnexpectedError(Exception e) {
            lock3.countDown();
        }
    });
    lock3.await(1000, TimeUnit.MILLISECONDS);
    assertTrue(results.containsKey("downloadKeys"));
    MXUsersDevicesMap<MXDeviceInfo> usersDevicesInfoMap = (MXUsersDevicesMap<MXDeviceInfo>) results.get("downloadKeys");
    assertTrue(2 == usersDevicesInfoMap.getUserIds().size());
    assertTrue(1 == usersDevicesInfoMap.getUserDeviceIds(mAliceSession.getMyUserId()).size());
    MXDeviceInfo aliceDeviceFromBobPOV = usersDevicesInfoMap.getObject("AliceDevice", mAliceSession.getMyUserId());
    assertTrue(null != aliceDeviceFromBobPOV);
    assertTrue(TextUtils.equals(aliceDeviceFromBobPOV.fingerprint(), mAliceSession.getCrypto().getOlmDevice().getDeviceEd25519Key()));
    // Continue testing other methods
    assertTrue(null != mBobSession.getCrypto().deviceWithIdentityKey(mAliceSession.getCrypto().getOlmDevice().getDeviceCurve25519Key(), mAliceSession.getMyUserId(), MXCryptoAlgorithms.MXCRYPTO_ALGORITHM_OLM));
    assertTrue(aliceDeviceFromBobPOV.isUnknown());
    final CountDownLatch lock3a = new CountDownLatch(1);
    mBobSession.getCrypto().setDevicesKnown(Arrays.asList(aliceDeviceFromBobPOV), new ApiCallback<Void>() {

        @Override
        public void onSuccess(Void info) {
            results.put("setDevicesKnown", info);
            lock3a.countDown();
        }

        @Override
        public void onNetworkError(Exception e) {
            lock3a.countDown();
        }

        @Override
        public void onMatrixError(MatrixError e) {
            lock3a.countDown();
        }

        @Override
        public void onUnexpectedError(Exception e) {
            lock3a.countDown();
        }
    });
    lock3a.await(1000, TimeUnit.MILLISECONDS);
    assertTrue(results.containsKey("setDevicesKnown"));
    assertTrue(aliceDeviceFromBobPOV.isUnverified());
    final CountDownLatch lock3b = new CountDownLatch(1);
    mBobSession.getCrypto().setDeviceVerification(MXDeviceInfo.DEVICE_VERIFICATION_BLOCKED, aliceDeviceFromBobPOV.deviceId, mAliceSession.getMyUserId(), new ApiCallback<Void>() {

        @Override
        public void onSuccess(Void info) {
            results.put("setDeviceVerification1", info);
            lock3b.countDown();
        }

        @Override
        public void onNetworkError(Exception e) {
            lock3b.countDown();
        }

        @Override
        public void onMatrixError(MatrixError e) {
            lock3b.countDown();
        }

        @Override
        public void onUnexpectedError(Exception e) {
            lock3b.countDown();
        }
    });
    lock3b.await(1000, TimeUnit.MILLISECONDS);
    assertTrue(results.containsKey("setDeviceVerification1"));
    assertTrue(aliceDeviceFromBobPOV.isBlocked());
    Credentials bobCredentials = mBobSession.getCredentials();
    Uri uri = Uri.parse(CryptoTestHelper.TESTS_HOME_SERVER_URL);
    HomeServerConnectionConfig hs = new HomeServerConnectionConfig(uri);
    hs.setCredentials(bobCredentials);
    IMXStore store = new MXFileStore(hs, context);
    MXSession bobSession2 = new MXSession(hs, new MXDataHandler(store, bobCredentials), context);
    final CountDownLatch lock4 = new CountDownLatch(1);
    MXStoreListener listener = new MXStoreListener() {

        @Override
        public void postProcess(String accountId) {
        }

        @Override
        public void onStoreReady(String accountId) {
            results.put("onStoreReady", "onStoreReady");
            lock4.countDown();
        }

        @Override
        public void onStoreCorrupted(String accountId, String description) {
            lock4.countDown();
        }

        @Override
        public void onStoreOOM(String accountId, String description) {
            lock4.countDown();
        }
    };
    bobSession2.getDataHandler().getStore().addMXStoreListener(listener);
    bobSession2.getDataHandler().getStore().open();
    lock4.await(2000, TimeUnit.MILLISECONDS);
    assertTrue(results.containsKey("onStoreReady"));
    final CountDownLatch lock4b = new CountDownLatch(2);
    MXEventListener eventListener = new MXEventListener() {

        @Override
        public void onInitialSyncComplete(String toToken) {
            results.put("onInitialSyncComplete", "onInitialSyncComplete");
            lock4b.countDown();
        }

        @Override
        public void onCryptoSyncComplete() {
            results.put("onCryptoSyncComplete", "onCryptoSyncComplete");
            lock4b.countDown();
        }
    };
    bobSession2.getDataHandler().addListener(eventListener);
    bobSession2.startEventStream(null);
    lock4b.await(2000, TimeUnit.MILLISECONDS);
    assertTrue(results.containsKey("onInitialSyncComplete"));
    assertTrue(results.containsKey("onCryptoSyncComplete"));
    MXDeviceInfo aliceDeviceFromBobPOV2 = bobSession2.getCrypto().deviceWithIdentityKey(mAliceSession.getCrypto().getOlmDevice().getDeviceCurve25519Key(), mAliceSession.getMyUserId(), MXCryptoAlgorithms.MXCRYPTO_ALGORITHM_OLM);
    assertTrue(null != aliceDeviceFromBobPOV2);
    assertTrue(TextUtils.equals(aliceDeviceFromBobPOV2.fingerprint(), mAliceSession.getCrypto().getOlmDevice().getDeviceEd25519Key()));
    assertTrue(aliceDeviceFromBobPOV2.mVerified + " instead of " + MXDeviceInfo.DEVICE_VERIFICATION_BLOCKED, aliceDeviceFromBobPOV2.mVerified == MXDeviceInfo.DEVICE_VERIFICATION_BLOCKED);
    // Download again alice device
    final CountDownLatch lock5 = new CountDownLatch(1);
    bobSession2.getCrypto().getDeviceList().downloadKeys(Arrays.asList(mAliceSession.getMyUserId()), true, new ApiCallback<MXUsersDevicesMap<MXDeviceInfo>>() {

        @Override
        public void onSuccess(MXUsersDevicesMap<MXDeviceInfo> info) {
            results.put("downloadKeys2", info);
            lock5.countDown();
        }

        @Override
        public void onNetworkError(Exception e) {
            lock5.countDown();
        }

        @Override
        public void onMatrixError(MatrixError e) {
            lock5.countDown();
        }

        @Override
        public void onUnexpectedError(Exception e) {
            lock5.countDown();
        }
    });
    lock5.await(1000, TimeUnit.MILLISECONDS);
    assertTrue(results.containsKey("downloadKeys2"));
    MXDeviceInfo aliceDeviceFromBobPOV3 = bobSession2.getCrypto().deviceWithIdentityKey(mAliceSession.getCrypto().getOlmDevice().getDeviceCurve25519Key(), mAliceSession.getMyUserId(), MXCryptoAlgorithms.MXCRYPTO_ALGORITHM_OLM);
    assertTrue(null != aliceDeviceFromBobPOV3);
    assertTrue(TextUtils.equals(aliceDeviceFromBobPOV3.fingerprint(), mAliceSession.getCrypto().getOlmDevice().getDeviceEd25519Key()));
    assertTrue(aliceDeviceFromBobPOV3.isBlocked());
    mAliceSession.clear(context);
    mBobSession.clear(context);
    bobSession2.clear(context);
}
Also used : Context(android.content.Context) MXStoreListener(org.matrix.androidsdk.data.store.MXStoreListener) HashMap(java.util.HashMap) IMXStore(org.matrix.androidsdk.data.store.IMXStore) MXFileStore(org.matrix.androidsdk.data.store.MXFileStore) MXDeviceInfo(org.matrix.androidsdk.crypto.data.MXDeviceInfo) CountDownLatch(java.util.concurrent.CountDownLatch) MXUsersDevicesMap(org.matrix.androidsdk.crypto.data.MXUsersDevicesMap) Uri(android.net.Uri) MXEventListener(org.matrix.androidsdk.listeners.MXEventListener) JsonObject(com.google.gson.JsonObject) MatrixError(org.matrix.androidsdk.rest.model.MatrixError) Credentials(org.matrix.androidsdk.rest.model.login.Credentials) Test(org.junit.Test)

Example 3 with MXDeviceInfo

use of org.matrix.androidsdk.crypto.data.MXDeviceInfo in project matrix-android-sdk by matrix-org.

the class CryptoTest method test22_testDownloadKeysForUserWithNoDevice.

@Test
public void test22_testDownloadKeysForUserWithNoDevice() throws Exception {
    Log.e(LOG_TAG, "test22_testDownloadKeysForUserWithNoDevice");
    final HashMap<String, Object> results = new HashMap<>();
    doE2ETestWithAliceAndBobInARoom(false);
    mAliceSession.getCrypto().setWarnOnUnknownDevices(false);
    final CountDownLatch lock1 = new CountDownLatch(1);
    mAliceSession.getCrypto().getDeviceList().downloadKeys(Arrays.asList(mBobSession.getMyUserId()), false, new ApiCallback<MXUsersDevicesMap<MXDeviceInfo>>() {

        @Override
        public void onSuccess(MXUsersDevicesMap<MXDeviceInfo> info) {
            results.put("downloadKeys", info);
            lock1.countDown();
        }

        @Override
        public void onNetworkError(Exception e) {
            lock1.countDown();
        }

        @Override
        public void onMatrixError(MatrixError e) {
            lock1.countDown();
        }

        @Override
        public void onUnexpectedError(Exception e) {
            lock1.countDown();
        }
    });
    lock1.await(1000, TimeUnit.MILLISECONDS);
    assertTrue(results.containsKey("downloadKeys"));
    MXUsersDevicesMap<MXDeviceInfo> usersDevicesInfoMap = (MXUsersDevicesMap<MXDeviceInfo>) results.get("downloadKeys");
    // MXCrypto.downloadKeys should return @[] for Bob to distinguish him from an unknown user
    List<String> bobDevices = usersDevicesInfoMap.getUserDeviceIds(mBobSession.getMyUserId());
    assertTrue(null != bobDevices);
    assertTrue(0 == bobDevices.size());
    // try again
    // it should not failed
    final CountDownLatch lock2 = new CountDownLatch(1);
    mAliceSession.getCrypto().getDeviceList().downloadKeys(Arrays.asList(mBobSession.getMyUserId()), false, new ApiCallback<MXUsersDevicesMap<MXDeviceInfo>>() {

        @Override
        public void onSuccess(MXUsersDevicesMap<MXDeviceInfo> info) {
            results.put("downloadKeys2", info);
            lock2.countDown();
        }

        @Override
        public void onNetworkError(Exception e) {
            lock2.countDown();
        }

        @Override
        public void onMatrixError(MatrixError e) {
            lock2.countDown();
        }

        @Override
        public void onUnexpectedError(Exception e) {
            lock2.countDown();
        }
    });
    lock2.await(1000, TimeUnit.MILLISECONDS);
    assertTrue(results.containsKey("downloadKeys2"));
}
Also used : HashMap(java.util.HashMap) MXDeviceInfo(org.matrix.androidsdk.crypto.data.MXDeviceInfo) CountDownLatch(java.util.concurrent.CountDownLatch) MXUsersDevicesMap(org.matrix.androidsdk.crypto.data.MXUsersDevicesMap) JsonObject(com.google.gson.JsonObject) MatrixError(org.matrix.androidsdk.rest.model.MatrixError) Test(org.junit.Test)

Example 4 with MXDeviceInfo

use of org.matrix.androidsdk.crypto.data.MXDeviceInfo in project matrix-android-sdk by matrix-org.

the class MXCrypto method setDeviceVerification.

/**
 * Update the blocked/verified state of the given device.
 *
 * @param verificationStatus the new verification status
 * @param deviceId           the unique identifier for the device.
 * @param userId             the owner of the device
 * @param callback           the asynchronous callback
 */
public void setDeviceVerification(final int verificationStatus, final String deviceId, final String userId, final ApiCallback<Void> callback) {
    if (hasBeenReleased()) {
        return;
    }
    final ArrayList<String> userRoomIds = new ArrayList<>();
    Collection<Room> rooms = mSession.getDataHandler().getStore().getRooms();
    for (Room room : rooms) {
        if (room.isEncrypted()) {
            RoomMember roomMember = room.getMember(userId);
            // test if the user joins the room
            if ((null != roomMember) && TextUtils.equals(roomMember.membership, RoomMember.MEMBERSHIP_JOIN)) {
                userRoomIds.add(room.getRoomId());
            }
        }
    }
    getEncryptingThreadHandler().post(new Runnable() {

        @Override
        public void run() {
            MXDeviceInfo device = mCryptoStore.getUserDevice(deviceId, userId);
            // Sanity check
            if (null == device) {
                Log.e(LOG_TAG, "## setDeviceVerification() : Unknown device " + userId + ":" + deviceId);
                if (null != callback) {
                    getUIHandler().post(new Runnable() {

                        @Override
                        public void run() {
                            callback.onSuccess(null);
                        }
                    });
                }
                return;
            }
            if (device.mVerified != verificationStatus) {
                device.mVerified = verificationStatus;
                mCryptoStore.storeUserDevice(userId, device);
            }
            if (null != callback) {
                getUIHandler().post(new Runnable() {

                    @Override
                    public void run() {
                        callback.onSuccess(null);
                    }
                });
            }
        }
    });
}
Also used : RoomMember(org.matrix.androidsdk.rest.model.RoomMember) MXDeviceInfo(org.matrix.androidsdk.crypto.data.MXDeviceInfo) ArrayList(java.util.ArrayList) Room(org.matrix.androidsdk.data.Room)

Example 5 with MXDeviceInfo

use of org.matrix.androidsdk.crypto.data.MXDeviceInfo in project matrix-android-sdk by matrix-org.

the class MXCrypto method deviceWithIdentityKey.

/**
 * Find a device by curve25519 identity key
 *
 * @param userId    the owner of the device.
 * @param algorithm the encryption algorithm.
 * @param senderKey the curve25519 key to match.
 * @return the device info.
 */
public MXDeviceInfo deviceWithIdentityKey(final String senderKey, final String userId, final String algorithm) {
    if (!hasBeenReleased()) {
        if (!TextUtils.equals(algorithm, MXCryptoAlgorithms.MXCRYPTO_ALGORITHM_MEGOLM) && !TextUtils.equals(algorithm, MXCryptoAlgorithms.MXCRYPTO_ALGORITHM_OLM)) {
            // We only deal in olm keys
            return null;
        }
        if (!TextUtils.isEmpty(userId)) {
            final ArrayList<MXDeviceInfo> result = new ArrayList<>();
            final CountDownLatch lock = new CountDownLatch(1);
            getDecryptingThreadHandler().post(new Runnable() {

                @Override
                public void run() {
                    List<MXDeviceInfo> devices = getUserDevices(userId);
                    if (null != devices) {
                        for (MXDeviceInfo device : devices) {
                            Set<String> keys = device.keys.keySet();
                            for (String keyId : keys) {
                                if (keyId.startsWith("curve25519:")) {
                                    if (TextUtils.equals(senderKey, device.keys.get(keyId))) {
                                        result.add(device);
                                    }
                                }
                            }
                        }
                    }
                    lock.countDown();
                }
            });
            try {
                lock.await();
            } catch (Exception e) {
                Log.e(LOG_TAG, "## deviceWithIdentityKey() : failed " + e.getMessage());
            }
            return (result.size() > 0) ? result.get(0) : null;
        }
    }
    // Doesn't match a known device
    return null;
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) MXDeviceInfo(org.matrix.androidsdk.crypto.data.MXDeviceInfo) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) CountDownLatch(java.util.concurrent.CountDownLatch)

Aggregations

MXDeviceInfo (org.matrix.androidsdk.crypto.data.MXDeviceInfo)25 MatrixError (org.matrix.androidsdk.rest.model.MatrixError)17 HashMap (java.util.HashMap)15 MXUsersDevicesMap (org.matrix.androidsdk.crypto.data.MXUsersDevicesMap)13 ArrayList (java.util.ArrayList)12 CountDownLatch (java.util.concurrent.CountDownLatch)10 JsonObject (com.google.gson.JsonObject)8 Test (org.junit.Test)8 Context (android.content.Context)7 Room (org.matrix.androidsdk.data.Room)6 MXEventListener (org.matrix.androidsdk.listeners.MXEventListener)6 MXCryptoError (org.matrix.androidsdk.crypto.MXCryptoError)4 MXOlmSessionResult (org.matrix.androidsdk.crypto.data.MXOlmSessionResult)4 Uri (android.net.Uri)3 List (java.util.List)3 RoomState (org.matrix.androidsdk.data.RoomState)3 IMXStore (org.matrix.androidsdk.data.store.IMXStore)3 MXFileStore (org.matrix.androidsdk.data.store.MXFileStore)3 MXStoreListener (org.matrix.androidsdk.data.store.MXStoreListener)3 ApiCallback (org.matrix.androidsdk.rest.callback.ApiCallback)3