public void callResult(MtopResult result) {
Message msg = Message.obtain();
msg.what = 500;
msg.obj = result;
this.mHandler.sendMessage(msg);
}
public boolean handleMessage(Message msg) {
switch (msg.what) {
case 0:
if (this.isUserLogin) {
MtopResult result = new MtopResult();
result.addData(ApiConstants.RET, new JSONArray().put("ERR_SID_INVALID"));
if (this.jsContext instanceof WVCallBackContext) {
((WVCallBackContext) this.jsContext).error(result.toString());
}
if (TaoLog.getLogStatus()) {
TaoLog.d("WVServer", "login fail, call result, " + result.toString());
}
this.isUserLogin = false;
}
notifyNext();
return true;
case 1:
notifyNext();
this.isUserLogin = false;
this.singleExecutor.execute(new ServerRequestTask(this.jsContext, this.mParams));
if (!TaoLog.getLogStatus()) {
return true;
}
TaoLog.d("WVServer", "login success, execute task, mParams:" + this.mParams);
return true;
case 500:
if (msg.obj instanceof MtopResult) {
MtopResult result2 = (MtopResult) msg.obj;
if (result2.isSuccess()) {
if (result2.getJsContext() instanceof WVCallBackContext) {
((WVCallBackContext) result2.getJsContext()).success(result2.toString());
}
} else if (result2.getJsContext() instanceof WVCallBackContext) {
((WVCallBackContext) result2.getJsContext()).error(result2.toString());
}
if (TaoLog.getLogStatus()) {
TaoLog.d("WVServer", "call result, retString: " + result2.toString());
}
}
notifyNext();
return true;
case NOT_REG_LOGIN /*510*/:
MtopResult result3 = new MtopResult();
result3.addData(ApiConstants.RET, new JSONArray().put("HY_FAILED"));
result3.addData("code", "-1");
if (this.jsContext instanceof WVCallBackContext) {
((WVCallBackContext) this.jsContext).error(result3.toString());
}
if (TaoLog.getLogStatus()) {
TaoLog.d("WVServer", "not reg login, call fail, " + result3.toString());
}
notifyNext();
return true;
default:
return false;
}
}
这里的WVCALLBACKCONTEXT 估计是啥意思?