|
|
|
@ -1020,10 +1020,15 @@ public class Log {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void unexpectedError(FragmentManager manager, Throwable ex) {
|
|
|
|
|
unexpectedError(manager, ex, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void unexpectedError(FragmentManager manager, Throwable ex, boolean report) {
|
|
|
|
|
Log.e(ex);
|
|
|
|
|
|
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
|
args.putSerializable("ex", ex);
|
|
|
|
|
args.putBoolean("report", report);
|
|
|
|
|
|
|
|
|
|
FragmentDialogUnexpected fragment = new FragmentDialogUnexpected();
|
|
|
|
|
fragment.setArguments(args);
|
|
|
|
@ -1035,12 +1040,15 @@ public class Log {
|
|
|
|
|
@Override
|
|
|
|
|
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
|
|
|
|
final Throwable ex = (Throwable) getArguments().getSerializable("ex");
|
|
|
|
|
boolean report = getArguments().getBoolean("report", true);
|
|
|
|
|
|
|
|
|
|
return new AlertDialog.Builder(getContext())
|
|
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(getContext())
|
|
|
|
|
.setTitle(R.string.title_unexpected_error)
|
|
|
|
|
.setMessage(Log.formatThrowable(ex, false))
|
|
|
|
|
.setPositiveButton(android.R.string.cancel, null)
|
|
|
|
|
.setNeutralButton(R.string.title_report, new DialogInterface.OnClickListener() {
|
|
|
|
|
.setPositiveButton(android.R.string.cancel, null);
|
|
|
|
|
|
|
|
|
|
if (report)
|
|
|
|
|
builder.setNeutralButton(R.string.title_report, new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
// Dialog will be dismissed
|
|
|
|
@ -1068,8 +1076,9 @@ public class Log {
|
|
|
|
|
}
|
|
|
|
|
}.execute(getContext(), getActivity(), new Bundle(), "error:unexpected");
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.create();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return builder.create();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|