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

Commit 0236850

Browse files
committed
Merge branch 'release/0.9.11'
2 parents e6f0976 + d3cb3b6 commit 0236850

File tree

5 files changed

+42
-55
lines changed

5 files changed

+42
-55
lines changed

CHANGES.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Changes to Matrix Android SDK in 0.9.11 (2018-10-10)
2+
=======================================================
3+
4+
Bugfix:
5+
- Add a setter to set MXDataHandler to MXFileStore
6+
17
Changes to Matrix Android SDK in 0.9.10 (2018-10-08)
28
=======================================================
39

README.md

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=matrix.android.sdk&metric=alert_status)](https://sonarcloud.io/dashboard?id=matrix.android.sdk) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=matrix.android.sdk&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=matrix.android.sdk) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=matrix.android.sdk&metric=bugs)](https://sonarcloud.io/dashboard?id=matrix.android.sdk)
1+
[![Jenkins](https://img.shields.io/jenkins/s/https/matrix.org/jenkins/view/MatrixView/job/MatrixAndroidSDKDevelop.svg)](https://matrix.org/jenkins/view/MatrixView/job/MatrixAndroidSDKDevelop/)
2+
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=matrix.android.sdk&metric=alert_status)](https://sonarcloud.io/dashboard?id=matrix.android.sdk)
3+
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=matrix.android.sdk&metric=vulnerabilities)](https://sonarcloud.io/project/issues?id=matrix.android.sdk&resolved=false&types=VULNERABILITY)
4+
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=matrix.android.sdk&metric=bugs)](https://sonarcloud.io/project/issues?id=matrix.android.sdk&resolved=false&types=BUG)
25

36
matrix-android-sdk
47
==================
@@ -19,20 +22,14 @@ Basic usage is:
1922

2023
Bugs / Feature Requests
2124
-----------------------
22-
Think you've found a bug? Want a new feature on the client? Please open an issue
23-
on JIRA:
24-
25-
- Create an account and login to https://matrix.org/jira
26-
- Navigate to the ``SYAND`` project.
27-
- Click **Create Issue** - Please be as descriptive as possible, with reproduction
28-
steps if possible.
29-
30-
All issues in JIRA are **public**.
25+
Think you've found a bug? Please check if an issue
26+
does not exist yet, then, if not, open an issue on this Github repo. If an issue already
27+
exists, feel free to upvote for it.
3128

3229
Contributing
3330
------------
34-
Want to fix a bug or add a new feature? Check JIRA first to see if someone else is
35-
handling this issue. If no one is actively working on the issue, then please fork
31+
Want to fix a bug or add a new feature? Check if there is an corresponding opened issue.
32+
If no one is actively working on the issue, then please fork
3633
the ``develop`` branch when writing your fix, and open a pull request when you're
3734
ready. Do not base your pull requests off ``master``.
3835

@@ -41,7 +38,9 @@ Logging in
4138
To log in, use an instance of the login API client.
4239

4340
```java
44-
HomeServerConnectionConfig hsConfig = new HomeServerConnectionConfig(Uri.parse("https://matrix.org"));
41+
HomeServerConnectionConfig hsConfig = new HomeServerConnectionConfig.Builder()
42+
.withHomeServerUri(Uri.parse("https://matrix.org"))
43+
.build();
4544
new LoginRestClient(hsConfig).loginWithUser(username, password, new SimpleApiCallback<Credentials>());
4645
```
4746

@@ -52,7 +51,8 @@ Starting the matrix session
5251
The session represents one user's session with a particular home server. There can potentially be multiple sessions for handling multiple accounts.
5352

5453
```java
55-
MXSession session = new MXSession(hsConfig, new MXDataHandler(store, credentials), getApplicationContext());
54+
MXSession session = new MXSession.Builder(hsConfig, new MXDataHandler(store, credentials), getApplicationContext())
55+
.build();
5656
```
5757

5858
sets up a session for interacting with the home server.
@@ -109,18 +109,6 @@ MXDataHandler dataHandler = new MXDataHandler(new MXMemoryStore());
109109

110110
creates a data handler with the default in-memory storage implementation.
111111

112-
### Setting up the session
113-
114-
```java
115-
MXSession session = new MXSession(credentials, dataHandler);
116-
```
117-
118-
### Starting the event stream
119-
120-
```java
121-
session.startEventStream();
122-
```
123-
124112
### Registering a listener
125113
To be informed of events, the app needs to implement an event listener.
126114

@@ -217,9 +205,13 @@ content can now be found.
217205

218206
**See the sample app and Javadoc for more details.**
219207

208+
References
209+
----------
210+
- [Matrix home page](https://matrix.org)
211+
- [Matrix api documentation](https://matrix.org/docs/spec/client_server/latest.html)
212+
- [Matrix api](https://matrix.org/docs/api/client-server/)
213+
220214
License
221215
-------
222216
Apache 2.0
223217

224-
[Matrix]:http://matrix.org
225-
[matrix api]:http://matrix.org/docs/api/client-server/

matrix-sdk/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ android {
1414
defaultConfig {
1515
minSdkVersion 16
1616
targetSdkVersion 26
17-
versionCode 910
18-
versionName "0.9.10"
17+
versionCode 911
18+
versionName "0.9.11"
1919
resValue "string", "flavor_description", "SDKApp"
2020
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
2121
}

matrix-sdk/src/main/java/org/matrix/androidsdk/data/store/MXFileStore.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020

2121
import android.content.Context;
2222
import android.os.HandlerThread;
23+
import android.support.annotation.NonNull;
2324
import android.support.annotation.Nullable;
2425
import android.text.TextUtils;
2526

2627
import org.matrix.androidsdk.HomeServerConnectionConfig;
28+
import org.matrix.androidsdk.MXDataHandler;
2729
import org.matrix.androidsdk.data.Room;
2830
import org.matrix.androidsdk.data.RoomAccountData;
2931
import org.matrix.androidsdk.data.RoomState;
@@ -145,6 +147,9 @@ public class MXFileStore extends MXMemoryStore {
145147
// True if file encryption is enabled
146148
private final boolean mEnableFileEncryption;
147149

150+
// The dataHandler
151+
private MXDataHandler mMXDataHandler;
152+
148153
/**
149154
* Create the file store dirtrees
150155
*/
@@ -221,7 +226,9 @@ private void createDirTree(String userId) {
221226
* @param enableFileEncryption set to true to enable file encryption.
222227
* @param context the context.
223228
*/
224-
public MXFileStore(HomeServerConnectionConfig hsConfig, boolean enableFileEncryption, Context context) {
229+
public MXFileStore(HomeServerConnectionConfig hsConfig,
230+
boolean enableFileEncryption,
231+
Context context) {
225232
setContext(context);
226233

227234
mEnableFileEncryption = enableFileEncryption;
@@ -275,6 +282,10 @@ public MXFileStore(HomeServerConnectionConfig hsConfig, boolean enableFileEncryp
275282
}
276283
}
277284

285+
public void setDataHandler(@NonNull final MXDataHandler dataHandler) {
286+
mMXDataHandler = dataHandler;
287+
}
288+
278289
/**
279290
* Killed the background thread.
280291
*
@@ -1239,7 +1250,7 @@ private boolean loadRoomMessages(final String roomId) {
12391250
// succeeds to extract the message list
12401251
if (null != events) {
12411252
// create the room object
1242-
final Room room = new Room(getDataHandler(), this, roomId);
1253+
final Room room = new Room(mMXDataHandler, this, roomId);
12431254
// do not wait that the live state update
12441255
room.setReadyState(true);
12451256
storeRoom(room);
@@ -1355,7 +1366,7 @@ private boolean loadRoomsMessages() {
13551366

13561367
} catch (Exception e) {
13571368
succeed = false;
1358-
Log.e(LOG_TAG, "loadRoomToken failed : " + e.getMessage(), e);
1369+
Log.e(LOG_TAG, "loadRoomsMessages failed : " + e.getMessage(), e);
13591370
}
13601371

13611372
return succeed;

matrix-sdk/src/main/java/org/matrix/androidsdk/data/store/MXMemoryStore.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import android.support.annotation.Nullable;
2525
import android.text.TextUtils;
2626

27-
import org.matrix.androidsdk.MXDataHandler;
2827
import org.matrix.androidsdk.data.Room;
2928
import org.matrix.androidsdk.data.RoomAccountData;
3029
import org.matrix.androidsdk.data.RoomSummary;
@@ -107,9 +106,6 @@ public class MXMemoryStore implements IMXStore {
107106
protected long mUserDisplayNameTs;
108107
protected long mUserAvatarUrlTs;
109108

110-
// DataHandler -- added waiting to be refactored
111-
private MXDataHandler mDataHandler;
112-
113109
/**
114110
* Initialization method.
115111
*/
@@ -1645,22 +1641,4 @@ public String getAntivirusServerPublicKey() {
16451641
public void setMetricsListener(MetricsListener metricsListener) {
16461642
mMetricsListener = metricsListener;
16471643
}
1648-
1649-
/**
1650-
* Get the associated dataHandler
1651-
*
1652-
* @return the associated dataHandler
1653-
*/
1654-
protected MXDataHandler getDataHandler() {
1655-
return mDataHandler;
1656-
}
1657-
1658-
/**
1659-
* Update the associated dataHandler
1660-
*
1661-
* @param dataHandler the dataHandler
1662-
*/
1663-
public void setDataHandler(final MXDataHandler dataHandler) {
1664-
mDataHandler = dataHandler;
1665-
}
16661644
}

0 commit comments

Comments
 (0)