in src/android/AudioPlayer.java [731:762]
private void sendStatusChange(int messageType, Integer additionalCode, Float value, String errorMessage) {
if (additionalCode != null && value != null) {
throw new IllegalArgumentException("Only one of additionalCode or value can be specified, not both");
}
if (errorMessage != null) {
LOG.d(LOG_TAG, errorMessage);
}
JSONObject statusDetails = new JSONObject();
try {
statusDetails.put("id", this.id);
statusDetails.put("msgType", messageType);
if (additionalCode != null) {
JSONObject code = new JSONObject();
code.put("code", additionalCode.intValue());
if (errorMessage != null) {
code.put("message", errorMessage);
}
statusDetails.put("value", code);
}
else if (value != null) {
statusDetails.put("value", value.floatValue());
}
} catch (JSONException e) {
LOG.e(LOG_TAG, "Failed to create status details", e);
}
this.handler.sendEventMessage("status", statusDetails);
}