Tabnine Logo
MXSession.clear
Code IndexAdd Tabnine to your IDE (free)

How to use
clear
method
in
org.matrix.androidsdk.MXSession

Best Java code snippets using org.matrix.androidsdk.MXSession.clear (Showing top 20 results out of 315)

origin: matrix-org/matrix-android-sdk

/**
 * Clear the session data synchronously.
 *
 * @param context the context
 */
public void clear(final Context context) {
  clear(context, null);
}
origin: matrix-org/matrix-android-sdk

private void clearData() {
  // required else the clear won't be done
  mIsAliveSession = true;
  clear(context, new SimpleApiCallback<Void>() {
    @Override
    public void onSuccess(Void info) {
      if (null != callback) {
        callback.onSuccess(null);
      }
    }
  });
}
origin: matrix-org/matrix-android-sdk

/**
 * Clear all provided sessions
 *
 * @param sessions the sessions to clear
 */
public void clearAllSessions(List<MXSession> sessions) {
  final Context context = InstrumentationRegistry.getContext();
  for (MXSession session : sessions) {
    session.clear(context);
  }
}
origin: matrix-org/matrix-android-sdk

  @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);
        }
      }
    });
  }
});
origin: matrix-org/matrix-android-sdk

@Test
public void test02_testOneTimeKeys() throws Exception {
  Context context = InstrumentationRegistry.getContext();
  final SessionTestParams testParams = new SessionTestParams(true);
  final MXSession bobSession = mTestHelper.createAccount(TestConstants.USER_BOB, testParams);
  final Map<String, Object> results = new HashMap<>();
  final Map<String, Object> otks = new HashMap<>();
  otks.put("curve25519:AAAABQ", "ueuHES/Q0P1MZ4J3IUpC8iQTkgQNX66ZpxVLUaTDuB8");
  otks.put("curve25519:AAAABA", "PmyaaB68Any+za9CuZXzFsQZW31s/TW6XbAB9akEpQs");
  CountDownLatch lock1 = new CountDownLatch(1);
  bobSession.getCryptoRestClient().uploadKeys(null, otks, "dev1", new TestApiCallback<KeysUploadResponse>(lock1) {
    @Override
    public void onSuccess(KeysUploadResponse keysUploadResponse) {
      results.put("keysUploadResponse", keysUploadResponse);
      super.onSuccess(keysUploadResponse);
    }
  });
  mTestHelper.await(lock1);
  KeysUploadResponse keysUploadResponse = (KeysUploadResponse) results.get("keysUploadResponse");
  Assert.assertNotNull(keysUploadResponse);
  Assert.assertNotNull(keysUploadResponse.oneTimeKeyCounts);
  Assert.assertEquals(1, keysUploadResponse.oneTimeKeyCounts.size());
  Assert.assertEquals(2, keysUploadResponse.oneTimeKeyCountsForAlgorithm("curve25519"));
  Assert.assertEquals(0, keysUploadResponse.oneTimeKeyCountsForAlgorithm("deded"));
  bobSession.clear(context);
}
origin: matrix-org/matrix-android-sdk

Assert.assertEquals(1, keys.size());
bobSession.clear(context);
aliceSession.clear(context);
origin: matrix-org/matrix-android-sdk

aliceSession.clear(context);
bobSession.clear(context);
samSession.clear(context);
origin: matrix-org/matrix-android-sdk

@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);
}
origin: matrix-org/matrix-android-sdk

bobSession.clear(context);
bobSession2.clear(context);
origin: matrix-org/matrix-android-sdk

Assert.assertEquals("dev1", bobDevice2.deviceId);
Assert.assertEquals(bobDevice2.userId, bobSession.getMyUserId());
bobSession.clear(context);
origin: matrix-org/matrix-android-sdk

bobSession.clear(context);
mCryptoTestHelper.checkEncryptedEvent(event, aliceRoomId, message2FromAlice, aliceSession);
aliceSession.clear(context);
bobSession.clear(context);
bobSession2.clear(context);
origin: matrix-org/matrix-android-sdk

Assert.assertEquals("AliceDevice", sessionWithAliceDevice2.mDevice.deviceId);
bobSession.clear(context);
aliceSession.clear(context);
bobSession2.clear(context);
origin: matrix-org/matrix-android-sdk

bobSession.clear(context);
mCryptoTestHelper.checkEncryptedEvent(event, aliceRoomId, message2FromAlice, aliceSession);
aliceSession.clear(context);
bobSession.clear(context);
bobSession2.clear(context);
origin: matrix-org/matrix-android-sdk

bobSession.clear(context);
origin: matrix-org/matrix-android-sdk

aliceSession2.clear(context);
origin: matrix-org/matrix-android-sdk

Assert.assertEquals(myUserDevices2.get(0).deviceId, myUserDevices.get(0).deviceId);
bobSession.clear(context);
bobSession2.clear(context);
origin: matrix-org/matrix-android-sdk

aliceSession.clear(context);
aliceSession2.clear(context);
origin: matrix-org/matrix-android-sdk

aliceSession.clear(context);
aliceSession2.clear(context);
origin: matrix-org/matrix-android-sdk

aliceSession.clear(context);
aliceSession2.clear(context);
origin: matrix-org/matrix-android-sdk

aliceSession2.clear(context);
org.matrix.androidsdkMXSessionclear

Javadoc

Clear the session data synchronously.

Popular methods of MXSession

  • getDataHandler
    Get the data handler.
  • getMyUserId
    Get the session's current userid.
  • startEventStream
    Start the event stream (events thread that listens for events) with an event listener.
  • <init>
  • createRoom
    Create a new room with given properties.
  • enableCrypto
    Enable / disable the crypto.
  • getCredentials
    Get the user credentials.
  • getCrypto
  • getCryptoRestClient
  • getRoomsApiClient
    Get the API client for requests to the rooms API.
  • isCryptoEnabled
  • stopEventStream
    Gracefully stop the event stream.
  • isCryptoEnabled,
  • stopEventStream,
  • addDirectChatRoomToAccountData,
  • checkCrypto,
  • checkIfAlive,
  • clearApplicationCaches,
  • convertFilterToFilterId,
  • createDirectMessageRoom,
  • createRoomDirectMessage

Popular in Java

  • Making http post requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • startActivity (Activity)
  • getContentResolver (Context)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Permission (java.security)
    Legacy security code; do not use.
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Notification (javax.management)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now