Added debug info source

pull/212/head
M66B 2 years ago
parent 3f61350477
commit cd150dfe41

@ -479,7 +479,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
new SimpleTask<Long>() { new SimpleTask<Long>() {
@Override @Override
protected Long onExecute(Context context, Bundle args) throws IOException, JSONException { 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 @Override

@ -1481,7 +1481,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
sb.append(line).append("\r\n"); 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 { } finally {
file.delete(); file.delete();
} }
@ -2210,7 +2210,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
@Override @Override
protected Long onExecute(Context context, Bundle args) throws IOException, JSONException { 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 @Override

@ -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(); StringBuilder sb = new StringBuilder();
sb.append(context.getString(title)).append("\n\n\n\n"); sb.append(context.getString(title)).append("\n\n\n\n");
sb.append(getAppInfo(context)); sb.append(getAppInfo(context));
@ -1813,7 +1813,8 @@ public class Log {
draft.thread = draft.msgid; draft.thread = draft.msgid;
draft.to = new Address[]{myAddress()}; draft.to = new Address[]{myAddress()};
draft.subject = context.getString(R.string.app_name) + " " + 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.received = new Date().getTime();
draft.seen = true; draft.seen = true;
draft.ui_seen = true; draft.ui_seen = true;
@ -1935,7 +1936,7 @@ public class Log {
new SimpleTask<Long>() { new SimpleTask<Long>() {
@Override @Override
protected Long onExecute(Context context, Bundle args) throws Throwable { 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 @Override

Loading…
Cancel
Save