Skip to content

Commit

Permalink
* [android] Fix alibaba/weex#1200 . Revert commit 2b54731
Browse files Browse the repository at this point in the history
  • Loading branch information
YorkShen committed Nov 15, 2016
1 parent 7c24a08 commit 605fd25
Showing 1 changed file with 14 additions and 15 deletions.
Expand Up @@ -435,13 +435,9 @@ public void post(Runnable r, Object token) {
return;
}

if (isJSThread() && r != null) {
r.run();
} else {
Message m = Message.obtain(mJSHandler, WXThread.secure(r));
m.obj = token;
m.sendToTarget();
}
Message m = Message.obtain(mJSHandler, WXThread.secure(r));
m.obj = token;
m.sendToTarget();
}

void setTimeout(String callbackId, String time) {
Expand Down Expand Up @@ -1132,16 +1128,19 @@ private void execRegisterFailTask() {
*/

public void registerModules(final Map<String, Object> modules) {
if ( mJSHandler == null || modules == null
|| modules.size() == 0) {
return;
}
post(new Runnable() {
@Override
public void run() {
if (modules != null && modules.size() != 0) {
if(isJSThread()){
invokeRegisterModules(modules);
}
}, null);
else{
post(new Runnable() {
@Override
public void run() {
invokeRegisterModules(modules);
}
}, null);
}
}
}

/**
Expand Down

0 comments on commit 605fd25

Please sign in to comment.