Skip to content

Commit a400f79

Browse files
committed
fix onTaskEnd callback without param error
update sdk version to 1.1.4
1 parent e392cdb commit a400f79

File tree

9 files changed

+9
-13
lines changed

9 files changed

+9
-13
lines changed

mars/libraries/mars_android_sdk/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ PROJ_GROUP=com.tencent.mars
33
# 库的ID
44
PROJ_ARTIFACTID=mars-core
55
# 库的版本
6-
PROJ_VERSION=1.1.3
6+
PROJ_VERSION=1.1.4
77
### 最后 gradle引用的形式就是 $PROJ_GROUP:$PROJ_ARTIFACTID:$PROJ_VERSION
88

99
# 库名

samples/android/marsSampleChat/app/src/main/java/com/tencent/mars/sample/ConversationActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public void onPostDecode(Main.ConversationListResponse response) {
220220
}
221221

222222
@Override
223-
public void onTaskEnd() {
223+
public void onTaskEnd(int errType, int errCode) {
224224
runOnUiThread(new Runnable() {
225225

226226
@Override

samples/android/marsSampleChat/app/src/main/java/com/tencent/mars/sample/chat/TextMessageTask.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,12 @@ public void onPostDecode(Chat.SendMessageResponse response) {
7272
}
7373

7474
@Override
75-
public void onTaskEnd() {
75+
public void onTaskEnd(int errType, int errCode) {
7676
if (callback == null) {
7777
callback = onError;
7878
}
7979

8080
uiHandler.post(callback);
81-
super.onTaskEnd();
8281
}
8382

8483
public TextMessageTask onOK(Runnable onOK) {

samples/android/marsSampleChat/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ subprojects {
2323

2424
ext {
2525
GROUP = 'com.tencent.mars.sample'
26-
VERSION_NAME_PREFIX = '1.1.3'
26+
VERSION_NAME_PREFIX = '1.1.4'
2727
VERSION_NAME_SUFFIX = '' // '-SNAPSHOT'
2828

2929
minSdkVersion = 16

samples/android/marsSampleChat/wrapper/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PROJ_GROUP=com.tencent.mars
77
# 库的ID
88
PROJ_ARTIFACTID=mars-wrapper
99
# 库的版本
10-
PROJ_VERSION=1.1.3
10+
PROJ_VERSION=1.1.4
1111
### 最后 gradle引用的形式就是 $PROJ_GROUP:$PROJ_ARTIFACTID:$PROJ_VERSION
1212

1313
# 库名

samples/android/marsSampleChat/wrapper/src/main/aidl/com/tencent/mars/sample/wrapper/remote/MarsTaskWrapper.aidl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ interface MarsTaskWrapper {
1111

1212
int buf2resp(in byte[] buf);
1313

14-
void onTaskEnd();
14+
void onTaskEnd(in int errType, in int errCode);
1515
}

samples/android/marsSampleChat/wrapper/src/main/java/com/tencent/mars/sample/wrapper/remote/AbstractTaskWrapper.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ public Bundle getProperties() {
4848
}
4949

5050
@Override
51-
public void onTaskEnd() {
52-
// TODO: Running in client, need to complete onTaskEnd if service connection break
53-
// Nothing to do by defaults
54-
}
51+
public abstract void onTaskEnd(int errType, int errCode);
5552

5653
public AbstractTaskWrapper setHttpRequest(String host, String path) {
5754
properties.putString(MarsTaskProperty.OPTIONS_HOST, ("".equals(host) ? null : host));

samples/android/marsSampleChat/wrapper/src/main/java/com/tencent/mars/sample/wrapper/remote/MarsServiceProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private void cancelSpecifiedTaskWrapper(MarsTaskWrapper marsTaskWrapper) {
161161
if (queue.remove(marsTaskWrapper)) {
162162
// Remove from queue, not exec yet, call MarsTaskWrapper::onTaskEnd
163163
try {
164-
marsTaskWrapper.onTaskEnd();
164+
marsTaskWrapper.onTaskEnd(-1, -1);
165165

166166
} catch (RemoteException e) {
167167
// Called in client, ignore RemoteException

samples/android/marsSampleChat/wrapper/src/main/java/com/tencent/mars/sample/wrapper/service/MarsServiceStub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public int onTaskEnd(int taskID, Object userContext, int errType, int errCode) {
233233
}
234234

235235
try {
236-
wrapper.onTaskEnd();
236+
wrapper.onTaskEnd(errType, errCode);
237237

238238
} catch (RemoteException e) {
239239
e.printStackTrace();

0 commit comments

Comments
 (0)