Skip to content

Commit

Permalink
Merge branch 'android' of git://192.168.21.75/lightning into android
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarov-andrey committed Sep 11, 2012
2 parents 8108159 + ce1ff13 commit 9b311ea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Lightning.ml
Expand Up @@ -107,11 +107,11 @@ ELSE
IFDEF ANDROID THEN
external addExceptionInfo: string -> unit = "ml_addExceptionInfo";
external setSupportEmail: string -> unit = "ml_setSupportEmail";
ENDIF;

ELSE
value addExceptionInfo (_:string) = ();
value setSupportEmail (_:string) = ();
ENDIF;
ENDIF;

IFDEF ANDROID THEN

Expand Down
14 changes: 9 additions & 5 deletions src/android/java/src/ru/redspell/lightning/LightView.java
Expand Up @@ -442,11 +442,14 @@ public void openURL(String url){
}

private String supportEmail = "mail@redspell.ru";
public void setSupportEmail(String d){ supportEmail = d; }
public void mlSetSupportEmail(String d){ supportEmail = d; }

public void addExceptionInfo(String d) {
//openURL("mailto:".concat(supportEmail).concat("?subject=test&body=wtf"));
}
private String additionalExceptionInfo = "\n";
public void mlAddExceptionInfo(String d) {
additionalExceptionInfo += d;
Log.d("LIGHTNING", "additionalExceptionInfo now is" + additionalExceptionInfo + '\n');
//openURL("mailto:".concat(supportEmail).concat("?subject=test&body=wtf"));
}

public void mlUncaughtException(String exn,String[] bt) {
Context c = getContext();
Expand All @@ -464,6 +467,7 @@ public void mlUncaughtException(String exn,String[] bt) {
for (String b : bt) {
body.append(b);body.append('\n');
};
body.append(additionalExceptionInfo);
uri.append("&body=" + Uri.encode(body.toString()));
Log.d("LIGHTNING","URI: " + uri.toString());
Intent sendIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(uri.toString ()));
Expand Down Expand Up @@ -642,4 +646,4 @@ public void curlExternalLoaderError(int req, int errCode, int errMes) {
Log.d("LIGHTNING", "curlExternalLoaderError " + errCode + " " + errMes);
queueEvent(new CurlExternErrorCallbackRunnable(req, errCode, errMes));
}
}
}
2 changes: 1 addition & 1 deletion src/android/mlwrapper_android.c
Expand Up @@ -994,7 +994,7 @@ void ml_addExceptionInfo (value info){

void ml_setSupportEmail (value d){
JNIEnv *env;
DEBUG("set support email");
DEBUG("DDD: set support email");
(*gJavaVM)->GetEnv(gJavaVM, (void **)&env, JNI_VERSION_1_4);

char* cd = String_val(d);
Expand Down

0 comments on commit 9b311ea

Please sign in to comment.