Added debug info source

This commit is contained in:
M66B 2023-04-19 10:13:37 +02:00
parent 3f61350477
commit cd150dfe41
3 changed files with 7 additions and 6 deletions

View File

@ -479,7 +479,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
new SimpleTask<Long>() {
@Override
protected Long onExecute(Context context, Bundle args) throws IOException, JSONException {
return Log.getDebugInfo(context, R.string.title_debug_info_remark, null, null).id;
return Log.getDebugInfo(context, "setup", R.string.title_debug_info_remark, null, null).id;
}
@Override

View File

@ -1481,7 +1481,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
sb.append(line).append("\r\n");
}
return Log.getDebugInfo(context, R.string.title_crash_info_remark, null, sb.toString()).id;
return Log.getDebugInfo(context, "crash", R.string.title_crash_info_remark, null, sb.toString()).id;
} finally {
file.delete();
}
@ -2210,7 +2210,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
@Override
protected Long onExecute(Context context, Bundle args) throws IOException, JSONException {
return Log.getDebugInfo(context, R.string.title_debug_info_remark, null, null).id;
return Log.getDebugInfo(context, "main", R.string.title_debug_info_remark, null, null).id;
}
@Override

View File

@ -1780,7 +1780,7 @@ public class Log {
}
}
static EntityMessage getDebugInfo(Context context, int title, Throwable ex, String log) throws IOException, JSONException {
static EntityMessage getDebugInfo(Context context, String source, int title, Throwable ex, String log) throws IOException, JSONException {
StringBuilder sb = new StringBuilder();
sb.append(context.getString(title)).append("\n\n\n\n");
sb.append(getAppInfo(context));
@ -1813,7 +1813,8 @@ public class Log {
draft.thread = draft.msgid;
draft.to = new Address[]{myAddress()};
draft.subject = context.getString(R.string.app_name) + " " +
BuildConfig.VERSION_NAME + BuildConfig.REVISION + " debug info";
BuildConfig.VERSION_NAME + BuildConfig.REVISION +
" debug info - " + source;
draft.received = new Date().getTime();
draft.seen = true;
draft.ui_seen = true;
@ -1935,7 +1936,7 @@ public class Log {
new SimpleTask<Long>() {
@Override
protected Long onExecute(Context context, Bundle args) throws Throwable {
return Log.getDebugInfo(context, R.string.title_unexpected_info_remark, ex, null).id;
return Log.getDebugInfo(context, "report", R.string.title_unexpected_info_remark, ex, null).id;
}
@Override