Skip to content

Commit 709e744

Browse files
authored
Merge pull request #166 from jwfing/master
bugfix: AVUser#becomeWithSessionToken will throw NetworkOnMainThreadE…
2 parents bf6b61a + 29b7ea5 commit 709e744

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
Following is change logs for recently release versions, you can refer to [releases page](https://github.com/leancloud/java-unified-sdk/releases) for more details.
44

5+
## 7.2.4 release
6+
7+
#### Break changes
8+
- None
9+
10+
#### New features
11+
- None
12+
13+
#### Optimization and fixed bugs
14+
- fixed: AVUser#becomeWithSessionToken will throw NetworkOnMainThreadException on Android.
15+
516
## 7.2.3 release
617

718
#### Break changes

android-sdk/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ allprojects {
3030
}
3131

3232
ext {
33-
sdkVersion = "7.2.3"
33+
sdkVersion = "7.2.4"
3434
supportLibVersion = "26.1.0"
3535
converterVersion = "2.1.0"
3636
rxandroidVersion = "2.1.1"

android-sdk/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ org.gradle.jvmargs=-Xmx1536m
1515
# This option should only be used with decoupled projects. More details, visit
1616
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1717
# org.gradle.parallel=true
18-
VERSION_NAME=7.2.3
18+
VERSION_NAME=7.2.4
1919
VERSION_CODE=2695
2020
GROUP=cn.leancloud
2121

android-sdk/storage-sample-app/src/main/java/cn/leancloud/sample/testcase/UserDemoActivity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,11 @@ public void done(AVException e) {
286286
});
287287
}
288288

289+
public void testBecomeWithSessionToken() {
290+
AVUser user = AVUser.becomeWithSessionToken("thisisa fake session token");
291+
log("succeed to initiate user with a fake session token: " + user);
292+
}
293+
289294
public void testAnonymousUserLogin() {
290295
AVUser.logInAnonymously()
291296
.subscribe(ObserverBuilder.buildSingleObserver(new LogInCallback<AVUser>() {

core/src/main/java/cn/leancloud/core/StorageClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,8 @@ public Boolean apply(AVUser o) throws Exception {
461461
public <T extends AVUser> Observable<T> createUserBySession(String sessionToken, final Class<T> clazz) {
462462
Map<String, String> param = new HashMap<String, String>(1);
463463
param.put("session_token", sessionToken);
464-
return apiService.checkAuthenticated(sessionToken, param).map(new Function<AVUser, T>() {
464+
Observable<AVUser> result = wrapObservable(apiService.checkAuthenticated(sessionToken, param));
465+
return result.map(new Function<AVUser, T>() {
465466
public T apply(AVUser avUser) throws Exception {
466467
if (null == avUser) {
467468
LOGGER.e("The mapper function returned a null value.");

0 commit comments

Comments
 (0)