mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
Refactoring
This commit is contained in:
parent
1815e3f2bc
commit
4e822c6fe2
2 changed files with 8 additions and 5 deletions
|
@ -298,7 +298,8 @@ public class Log {
|
|||
public static int e(String msg) {
|
||||
if (BuildConfig.BETA_RELEASE)
|
||||
try {
|
||||
Throwable ex = new ThrowableWrapper(msg); // TODO CASA
|
||||
ThrowableWrapper ex = new ThrowableWrapper();
|
||||
ex.setMessage(msg);
|
||||
List<StackTraceElement> ss = new ArrayList<>(Arrays.asList(ex.getStackTrace()));
|
||||
ss.remove(0);
|
||||
ex.setStackTrace(ss.toArray(new StackTraceElement[0]));
|
||||
|
|
|
@ -25,8 +25,8 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
|
||||
public class ThrowableWrapper extends Throwable {
|
||||
private String msg;
|
||||
private final Throwable ex;
|
||||
private final String msg;
|
||||
|
||||
public static native String jni_get_safe_message(Throwable ex);
|
||||
|
||||
|
@ -38,14 +38,16 @@ public class ThrowableWrapper extends Throwable {
|
|||
System.loadLibrary("fairemail");
|
||||
}
|
||||
|
||||
ThrowableWrapper(String msg) {
|
||||
ThrowableWrapper() {
|
||||
this.ex = new Throwable();
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
ThrowableWrapper(Throwable ex) {
|
||||
this.ex = ex;
|
||||
this.msg = null;
|
||||
}
|
||||
|
||||
void setMessage(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getSafeMessage() {
|
||||
|
|
Loading…
Reference in a new issue