Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.9.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
ganfra committed Aug 9, 2018
2 parents e70d316 + 4d8e660 commit d0d7c4b
Show file tree
Hide file tree
Showing 117 changed files with 3,421 additions and 1,754 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ cache:

# Just build the project for now
script:
- ./gradlew clean lintRelease test assembleRelease --stacktrace
- ./gradlew clean lintRelease test assembleRelease assembleAndroidTest --stacktrace
- ./tools/check/check_code_quality.sh
- ./tools/travis/check_pr.sh
35 changes: 35 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
Changes to Matrix Android SDK in 0.9.7 (2018-08-09)
=======================================================

Features:
- Add MetricsListener to measure some startup and stats metrics
- Implements ReplyTo feature. When sending an event, you can now pass another Event to reply to it. (vector-im/riot-android#2390)
- Manage room versioning

Improvements:
- MXCrypto: Encrypt the messages for invited members according to the history visibility (if the option is enabled in MXCryptoConfig).
- Upgrade olm-sdk.aar from version 2.2.2 to version 2.3.0
- Add a method to MediaScanRestClient to get the public key of the media scanner server
- Add support for the scanning and downloading of unencrypted thumbnails
- Set user agent on manual HttpConnection (i.e. not using a RestClient)
- Bullet points look esthetically bad (#2462)

Bugfix:
- Send Access Token as a header instead of a url parameter to upload content (#311)
- Add API CallSoundsManager.startRingingSilently() to fix issue when incoming call sound is disable (vector-im/riot-android#2417)
- Use same TxId when resending an event. The eventId is used as a TxId. (vector-im/riot-android#1997)
- Fix bad bing on '@room' pattern. (vector-im/riot-android#2461)
- Fix Crash loop reported by RageShake (vector-im/riot-android#2501)

API Change:
- Parameter historyVisibility removed from MxSession.createRoom(). It had no effect.
- New API: CreateRoomParams.setHistoryVisibility(String historyVisibility) to force the history visibility during Room creation.
- Room.getLiveState() has been removed, please use Room.getState() (#310)
- new API: Room.canReplyTo(Event) to know if replying to this event is supported.
- New APIs PermalinkUtils.createPermalink() to create matrix permalink for an event, a room, a user, etc.
- New API: add hasMembership(String membership) to simplify test on room membership

Others:
- Do not log DEBUG messages in release versions (PR #304)
- Rename some internal classes to change 'Bing' to 'Push'

Changes to Matrix Android SDK in 0.9.6 (2018-07-03)
=======================================================

Expand Down
6 changes: 3 additions & 3 deletions matrix-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ android {
minSdkVersion 16
targetSdkVersion 26
// use version to define a version code.
versionCode 906
version "0.9.6"
versionName "0.9.6"
versionCode 907
version "0.9.7"
versionName "0.9.7"
resValue "string", "flavor_description", "SDKApp"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Expand Down
Binary file modified matrix-sdk/libs/olm-sdk.aar
Binary file not shown.
386 changes: 229 additions & 157 deletions matrix-sdk/src/androidTest/java/org/matrix/androidsdk/CryptoTest.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

import android.content.Context;
import android.net.Uri;
import android.support.annotation.Nullable;

import org.junit.Assert;
import org.matrix.androidsdk.data.store.IMXStore;
import org.matrix.androidsdk.data.store.MXFileStore;
import org.matrix.androidsdk.listeners.MXEventListener;
import org.matrix.androidsdk.rest.callback.ApiCallback;
import org.matrix.androidsdk.rest.client.LoginRestClient;
import org.matrix.androidsdk.rest.model.MatrixError;
import org.matrix.androidsdk.rest.model.login.Credentials;
Expand All @@ -38,7 +38,23 @@
import java.util.concurrent.TimeUnit;

public class CryptoTestHelper {
public static final String TESTS_HOME_SERVER_URL = "http://10.0.2.2:8080";
private static final String TESTS_HOME_SERVER_URL = "http://10.0.2.2:8080";

/**
* Create a Home server configuration, with Http connection allowed for test
*
* @param credentials
* @return
*/
public static HomeServerConnectionConfig createHomeServerConfig(@Nullable Credentials credentials) {
HomeServerConnectionConfig hs = new HomeServerConnectionConfig(Uri.parse(TESTS_HOME_SERVER_URL));

hs.allowHttpConnection();

hs.setCredentials(credentials);

return hs;
}

/**
* Create an account and a dedicated session
Expand All @@ -50,8 +66,8 @@ public class CryptoTestHelper {
* @throws Exception an exception if the account creation failed
*/
public static MXSession createAccountAndSync(Context context, String userName, String password, boolean startSession) throws Exception {
Uri uri = Uri.parse(TESTS_HOME_SERVER_URL);
HomeServerConnectionConfig hs = new HomeServerConnectionConfig(uri);
HomeServerConnectionConfig hs = createHomeServerConfig(null);

LoginRestClient loginRestClient = new LoginRestClient(hs);

final Map<String, Object> params = new HashMap<>();
Expand Down Expand Up @@ -151,8 +167,8 @@ public void onInitialSyncComplete(String toToken) {
* @throws Exception an exception if the account cannot be synced
*/
public static MXSession logAccountAndSync(Context context, String userName, String password) throws Exception {
Uri uri = Uri.parse(TESTS_HOME_SERVER_URL);
HomeServerConnectionConfig hs = new HomeServerConnectionConfig(uri);
HomeServerConnectionConfig hs = createHomeServerConfig(null);

LoginRestClient loginRestClient = new LoginRestClient(hs);

final Map<String, Object> params = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.matrix.androidsdk.rest.callback.ApiCallback;
import org.matrix.androidsdk.rest.model.MatrixError;
import org.matrix.androidsdk.util.Log;

import java.util.concurrent.CountDownLatch;

Expand All @@ -47,18 +48,24 @@ public void onSuccess(T info) {
@CallSuper
@Override
public void onNetworkError(Exception e) {
Log.e("TestApiCallback", e.getMessage(), e);

mCountDownLatch.countDown();
}

@CallSuper
@Override
public void onMatrixError(MatrixError e) {
Log.e("TestApiCallback", e.getMessage() + " " + e.errcode);

mCountDownLatch.countDown();
}

@CallSuper
@Override
public void onUnexpectedError(Exception e) {
Log.e("TestApiCallback", e.getMessage(), e);

mCountDownLatch.countDown();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import android.net.Uri;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;

import org.json.JSONArray;
import org.json.JSONException;
Expand Down Expand Up @@ -56,6 +57,8 @@ public class HomeServerConnectionConfig {
private List<CipherSuite> mTlsCipherSuites;
// should accept TLS extensions
private boolean mShouldAcceptTlsExtensions;
// allow Http connection
private boolean mAllowHttpExtension;

/**
* @param hsUri The URI to use to connect to the homeserver
Expand Down Expand Up @@ -271,6 +274,21 @@ public boolean shouldAcceptTlsExtensions() {
return mShouldAcceptTlsExtensions;
}

/**
* For test only: allow Http connection
*/
@VisibleForTesting()
public void allowHttpConnection() {
mAllowHttpExtension = true;
}

/**
* @return true if Http connection is allowed (false by default).
*/
public boolean isHttpConnectionAllowed() {
return mAllowHttpExtension;
}

@Override
public String toString() {
return "HomeserverConnectionConfig{" +
Expand Down
Loading

0 comments on commit d0d7c4b

Please sign in to comment.