Skip to content

Commit

Permalink
fix onTaskEnd callback without param error
Browse files Browse the repository at this point in the history
update sdk version to 1.1.4
  • Loading branch information
shockcao authored and garryyan committed Jan 11, 2017
1 parent 9128d6b commit 969c71d
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion mars/libraries/mars_android_sdk/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PROJ_GROUP=com.tencent.mars
# 库的ID
PROJ_ARTIFACTID=mars-core
# 库的版本
PROJ_VERSION=1.1.3
PROJ_VERSION=1.1.4
### 最后 gradle引用的形式就是 $PROJ_GROUP:$PROJ_ARTIFACTID:$PROJ_VERSION

# 库名
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public void onPostDecode(Main.ConversationListResponse response) {
}

@Override
public void onTaskEnd() {
public void onTaskEnd(int errType, int errCode) {
runOnUiThread(new Runnable() {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,12 @@ public void onPostDecode(Chat.SendMessageResponse response) {
}

@Override
public void onTaskEnd() {
public void onTaskEnd(int errType, int errCode) {
if (callback == null) {
callback = onError;
}

uiHandler.post(callback);
super.onTaskEnd();
}

public TextMessageTask onOK(Runnable onOK) {
Expand Down
2 changes: 1 addition & 1 deletion samples/android/marsSampleChat/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ subprojects {

ext {
GROUP = 'com.tencent.mars.sample'
VERSION_NAME_PREFIX = '1.1.3'
VERSION_NAME_PREFIX = '1.1.4'
VERSION_NAME_SUFFIX = '' // '-SNAPSHOT'

minSdkVersion = 16
Expand Down
2 changes: 1 addition & 1 deletion samples/android/marsSampleChat/wrapper/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PROJ_GROUP=com.tencent.mars
# 库的ID
PROJ_ARTIFACTID=mars-wrapper
# 库的版本
PROJ_VERSION=1.1.3
PROJ_VERSION=1.1.4
### 最后 gradle引用的形式就是 $PROJ_GROUP:$PROJ_ARTIFACTID:$PROJ_VERSION

# 库名
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ interface MarsTaskWrapper {

int buf2resp(in byte[] buf);

void onTaskEnd();
void onTaskEnd(in int errType, in int errCode);
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ public Bundle getProperties() {
}

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

public AbstractTaskWrapper setHttpRequest(String host, String path) {
properties.putString(MarsTaskProperty.OPTIONS_HOST, ("".equals(host) ? null : host));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private void cancelSpecifiedTaskWrapper(MarsTaskWrapper marsTaskWrapper) {
if (queue.remove(marsTaskWrapper)) {
// Remove from queue, not exec yet, call MarsTaskWrapper::onTaskEnd
try {
marsTaskWrapper.onTaskEnd();
marsTaskWrapper.onTaskEnd(-1, -1);

} catch (RemoteException e) {
// Called in client, ignore RemoteException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public int onTaskEnd(int taskID, Object userContext, int errType, int errCode) {
}

try {
wrapper.onTaskEnd();
wrapper.onTaskEnd(errType, errCode);

} catch (RemoteException e) {
e.printStackTrace();
Expand Down

0 comments on commit 969c71d

Please sign in to comment.