Created
August 27, 2021 05:42
-
-
Save t4kemyh4nd/ce133b28168838e2978982be6e5e7ad8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String invoke(String str, String str2, String str3, String str4) { | |
if (!this.mPM.isValid(this.mPageContext.getUrl())) { | |
return new Response(203).toString(); | |
} | |
Request request = new Request(); | |
request.setAction(str2); | |
request.setRawParams(str3); | |
request.setPageContext(this.mPageContext); | |
request.setView(this.mView); | |
request.setNativeInterface(this.mNativeInterface); | |
try { | |
HybridFeature lookupFeature = this.mFM.lookupFeature(str); | |
HybridFeature.Mode invocationMode = lookupFeature.getInvocationMode(request); | |
if (invocationMode == HybridFeature.Mode.SYNC) { | |
Response invoke = lookupFeature.invoke(request); | |
callback(invoke, this.mPageContext, str4); | |
return invoke.toString(); | |
} else if (invocationMode == HybridFeature.Mode.ASYNC) { | |
sPool.execute(new AsyncInvocation(lookupFeature, request, str4)); | |
return new Response(2).toString(); | |
} else { | |
request.setCallback(new Callback(this, this.mPageContext, str4)); | |
sPool.execute(new AsyncInvocation(lookupFeature, request, str4)); | |
return new Response(3).toString(); | |
} | |
} catch (HybridException e) { | |
Response response = e.getResponse(); | |
callback(response, this.mPageContext, str4); | |
return response.toString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment