mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
Removed debugging output.
This commit is contained in:
parent
03b974ee3f
commit
15a5c89e86
@ -26,7 +26,6 @@ import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
|
||||
public class BinaryEcho extends CordovaPlugin {
|
||||
|
||||
@ -43,15 +42,11 @@ public class BinaryEcho extends CordovaPlugin {
|
||||
if (action.equals("echo")) {
|
||||
//CordovaJSONArray cdvArgs = (CordovaJSONArray) args;
|
||||
//byte[] data = cdvArgs.getArrayBuffer(0);
|
||||
Log.i("Braden", "BinaryEcho top");
|
||||
byte[] data = Base64.decode(args.getString(0), Base64.DEFAULT);
|
||||
Log.i("Braden", "byte[] retrieved: " + data.length);
|
||||
|
||||
// Don't return any result now, since status results will be sent when events come in from broadcast receiver
|
||||
PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, data);
|
||||
Log.i("Braden", "PluginResult created");
|
||||
callbackContext.sendPluginResult(pluginResult);
|
||||
Log.i("Braden", "sendPluginResult() complete");
|
||||
return true;
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
|
@ -131,12 +131,9 @@ public class NativeToJsMessageQueue {
|
||||
|
||||
private void packMessage(JsMessage message, StringBuilder sb) {
|
||||
int len = message.calculateEncodedLength();
|
||||
Log.i("Braden", "Length " + len);
|
||||
sb.append(len)
|
||||
.append(' ');
|
||||
message.encodeAsMessage(sb);
|
||||
Log.i("Braden", "End of packMessage");
|
||||
Log.i("Braden", sb.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -455,11 +452,8 @@ public class NativeToJsMessageQueue {
|
||||
sb.append(pluginResult.getStrMessage());
|
||||
break;
|
||||
case PluginResult.MESSAGE_TYPE_ARRAYBUFFER:
|
||||
Log.i("Braden", "ArrayBuffer response encoding");
|
||||
sb.append('A');
|
||||
String temp = pluginResult.getMessage();
|
||||
Log.i("Braden", temp);
|
||||
sb.append(temp);
|
||||
sb.append(pluginResult.getMessage());
|
||||
break;
|
||||
case PluginResult.MESSAGE_TYPE_JSON:
|
||||
default:
|
||||
|
@ -22,7 +22,6 @@ import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
|
||||
public class PluginResult {
|
||||
private final int status;
|
||||
@ -75,7 +74,6 @@ public class PluginResult {
|
||||
this.status = status.ordinal();
|
||||
this.messageType = MESSAGE_TYPE_ARRAYBUFFER;
|
||||
this.encodedMessage = Base64.encodeToString(data, Base64.NO_WRAP);
|
||||
Log.i("Braden", "Message.length() = " + this.encodedMessage.length());
|
||||
}
|
||||
|
||||
public void setKeepCallback(boolean b) {
|
||||
|
Loading…
Reference in New Issue
Block a user