Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ecbebc78 authored by thilo's avatar thilo
Browse files

reemoved bugsnag

parent b4a0ee0b
Loading
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -34,8 +34,6 @@ android {
        versionCode 194
        versionName "3.6.4"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        buildConfigField "String", "BUGSNAG_API_KEY", "\"${System.getenv("BUGSNAG_API_KEY")}\""
    }

    buildTypes {
@@ -164,7 +162,6 @@ dependencies {
    testImplementation "org.mockito:mockito-core:$mockito_version"

    implementation "com.android.billingclient:billing:1.0"
    implementation "com.bugsnag:bugsnag-android:4.1.1"
    implementation "com.github.chrisbanes:PhotoView:2.0.0"
    implementation "com.f2prateek.rx.preferences2:rx-preferences:$rx_preferences_version"
    implementation "com.google.android:flexbox:0.3.1"
+0 −18
Original line number Diff line number Diff line
@@ -26,11 +26,7 @@ import androidx.core.provider.FontRequest
import androidx.emoji.text.EmojiCompat
import androidx.emoji.text.FontRequestEmojiCompatConfig
import com.akaita.java.rxjava2debug.RxJava2Debug
import com.bugsnag.android.Bugsnag
import com.bugsnag.android.Configuration
import com.moez.QKSMS.BuildConfig
import com.moez.QKSMS.R
import com.moez.QKSMS.common.util.BugsnagTree
import com.moez.QKSMS.common.util.FileLoggingTree
import com.moez.QKSMS.injection.AppComponentManager
import com.moez.QKSMS.injection.appComponent
@@ -66,11 +62,6 @@ class QKApplication : Application(), HasActivityInjector, HasBroadcastReceiverIn
    override fun onCreate() {
        super.onCreate()

        Bugsnag.init(this, Configuration(BuildConfig.BUGSNAG_API_KEY).apply {
            appVersion = BuildConfig.VERSION_NAME
            projectPackages = packages
        })

        RxJava2Debug.enableRxJava2AssemblyTracking()

        Realm.init(this)
@@ -89,15 +80,6 @@ class QKApplication : Application(), HasActivityInjector, HasBroadcastReceiverIn

        nightModeManager.updateCurrentTheme()

        val fontRequest = FontRequest(
                "com.google.android.gms.fonts",
                "com.google.android.gms",
                "Noto Color Emoji Compat",
                R.array.com_google_android_gms_fonts_certs)

        EmojiCompat.init(FontRequestEmojiCompatConfig(this, fontRequest))

        Timber.plant(Timber.DebugTree(), BugsnagTree(), fileLoggingTree)
    }

    override fun activityInjector(): AndroidInjector<Activity> {
+0 −41
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
 *
 * This file is part of QKSMS.
 *
 * QKSMS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * QKSMS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with QKSMS.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.moez.QKSMS.common.util

import android.util.Log
import com.bugsnag.android.Bugsnag
import com.bugsnag.android.Severity
import timber.log.Timber

/**
 * If an exception is logged with the [Log.WARN] or [Log.ERROR] priority, the exception will be
 * sent to Bugsnag
 */
class BugsnagTree : Timber.Tree() {

    override fun isLoggable(tag: String?, priority: Int): Boolean {
        return priority == Log.WARN || priority == Log.ERROR
    }

    override fun log(priority: Int, tag: String?, message: String?, throwable: Throwable?) {
        val severity = if (priority == Log.ERROR) Severity.ERROR else Severity.WARNING
        throwable?.run { Bugsnag.notify(this, severity) }
    }

}
 No newline at end of file