@Override public void onSuccess(Void info) { Log.d(LOG_TAG, "## deactivateAccount() : succeed -> clearing the application data "); // Clear crypto data // For security and because it will be no more useful as we will get a new device id // on the next log in enableCrypto(false, null); clear(context, new SimpleApiCallback<Void>(callback) { @Override public void onSuccess(Void info) { if (null != callback) { callback.onSuccess(null); } } }); } });
enableCrypto(false, null);
@Test public void test01_testCryptoNoDeviceId() throws Exception { Log.e(LOG_TAG, "test01_testCryptoNoDeviceId"); Context context = InstrumentationRegistry.getContext(); final Map<String, Object> results = new HashMap<>(); MXSession bobSession = mTestHelper.createAccount(TestConstants.USER_BOB, mCryptoTestHelper.getDefaultSessionParams()); Assert.assertNull(bobSession.getCrypto()); bobSession.getCredentials().deviceId = null; CountDownLatch lock1 = new CountDownLatch(1); bobSession.enableCrypto(true, new TestApiCallback<Void>(lock1) { @Override public void onSuccess(Void info) { results.put("enableCrypto", "enableCrypto"); super.onSuccess(info); } }); mTestHelper.await(lock1); Assert.assertTrue(results.containsKey("enableCrypto")); Assert.assertNotNull(bobSession.getCrypto()); Assert.assertNotNull(bobSession.getCredentials().deviceId); bobSession.clear(context); }
bobSession.enableCrypto(true, new TestApiCallback<Void>(lock0) { @Override public void onSuccess(Void info) {
aliceSession.enableCrypto(true, new TestApiCallback<Void>(lock0) { @Override public void onSuccess(Void info) { bobSession.enableCrypto(true, new TestApiCallback<Void>(lock2) { @Override public void onSuccess(Void info) {
aliceSession.enableCrypto(true, new TestApiCallback<Void>(lock00b) { @Override public void onSuccess(Void info) { bobSession.enableCrypto(true, new TestApiCallback<Void>(lock00b) { @Override public void onSuccess(Void info) {
aliceSession.enableCrypto(true, new TestApiCallback<Void>(lock_1)); bobSession.enableCrypto(true, new TestApiCallback<Void>(lock_1));
bobSession.enableCrypto(true, new TestApiCallback<Void>(lock0) { @Override public void onSuccess(Void info) {
aliceSession.enableCrypto(true, new TestApiCallback<Void>(lock0) { @Override public void onSuccess(Void info) { CountDownLatch lock2 = new CountDownLatch(1); bobSession.getCredentials().deviceId = "BobDevice"; bobSession.enableCrypto(true, new TestApiCallback<Void>(lock2) { @Override public void onSuccess(Void info) {