1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-24 07:01:05 +00:00

Refactoring

This commit is contained in:
M66B 2019-08-12 16:18:41 +02:00
parent 25c7d1d33a
commit d1a921709a
2 changed files with 4 additions and 4 deletions

View file

@ -57,12 +57,12 @@ public class ApplicationEx extends Application {
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override @Override
public void uncaughtException(Thread thread, Throwable ex) { public void uncaughtException(Thread thread, Throwable ex) {
if (!crash_reports && Log.ownFault(ex)) { if (!crash_reports && Log.isOwnFault(ex)) {
Log.e(ex); Log.e(ex);
if (BuildConfig.BETA_RELEASE || if (BuildConfig.BETA_RELEASE ||
!Helper.isPlayStoreInstall(ApplicationEx.this)) !Helper.isPlayStoreInstall(ApplicationEx.this))
Log.writeCrash(ApplicationEx.this, ex); Log.writeCrashLog(ApplicationEx.this, ex);
if (prev != null) if (prev != null)
prev.uncaughtException(thread, ex); prev.uncaughtException(thread, ex);

View file

@ -322,7 +322,7 @@ public class Log {
Log.i(message + " " + mb + " MB" + " " + perc + " %"); Log.i(message + " " + mb + " MB" + " " + perc + " %");
} }
static boolean ownFault(Throwable ex) { static boolean isOwnFault(Throwable ex) {
if (ex instanceof OutOfMemoryError) if (ex instanceof OutOfMemoryError)
return false; return false;
@ -368,7 +368,7 @@ public class Log {
return false; return false;
} }
static void writeCrash(Context context, Throwable ex) { static void writeCrashLog(Context context, Throwable ex) {
File file = new File(context.getCacheDir(), "crash.log"); File file = new File(context.getCacheDir(), "crash.log");
Log.w("Writing exception to " + file); Log.w("Writing exception to " + file);