|
@@ -1,8 +1,11 @@
|
|
|
/*
|
|
|
- * ownCloud Android client application
|
|
|
+ * Nextcloud Android client application
|
|
|
*
|
|
|
* @author LukeOwncloud
|
|
|
+ * @author AndyScherzinger
|
|
|
* Copyright (C) 2016 ownCloud Inc.
|
|
|
+ * Copyright (C) 2016 LukeOwncloud
|
|
|
+ * Copyright (C) 2019 Andy Scherzinger
|
|
|
*
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
* it under the terms of the GNU General Public License version 2,
|
|
@@ -16,7 +19,7 @@
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
*/
|
|
|
-package com.owncloud.android.ui.errorhandling
|
|
|
+package com.nextcloud.client.errorhandling
|
|
|
|
|
|
import android.app.Activity
|
|
|
import android.content.Intent
|
|
@@ -25,11 +28,13 @@ import android.util.Log
|
|
|
|
|
|
import java.io.PrintWriter
|
|
|
import java.io.StringWriter
|
|
|
+import kotlin.system.exitProcess
|
|
|
|
|
|
class ExceptionHandler(private val context: Activity) : Thread.UncaughtExceptionHandler {
|
|
|
companion object {
|
|
|
private val TAG = ExceptionHandler::class.java.simpleName
|
|
|
private val LINE_SEPARATOR = "\n"
|
|
|
+ private val STATUS = 1000
|
|
|
}
|
|
|
|
|
|
override fun uncaughtException(thread: Thread, exception: Throwable) {
|
|
@@ -46,7 +51,7 @@ class ExceptionHandler(private val context: Activity) : Thread.UncaughtException
|
|
|
context.startActivity(intent)
|
|
|
|
|
|
android.os.Process.killProcess(android.os.Process.myPid())
|
|
|
- System.exit(1000)
|
|
|
+ exitProcess(STATUS)
|
|
|
}
|
|
|
|
|
|
private fun generateErrorReport(stackTrace: String): String {
|