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

Verified Commit e0f70047 authored by Yash Garg's avatar Yash Garg 💬
Browse files

Revert "cleanup: revert sentry integration"

This reverts commit 7f01cb51.
parent 980f5c3a
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -178,4 +178,5 @@ dependencies {

    // elib
    implementation(libs.elib)
    implementation(libs.telemetry)
}
+19 −1
Original line number Diff line number Diff line
@@ -8,6 +8,10 @@ import android.database.ContentObserver;
import android.net.Uri;
import android.os.Handler;
import android.provider.Settings;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import foundation.e.blisslauncher.core.DeviceProfile;
import foundation.e.blisslauncher.core.IconsHandler;
@@ -15,6 +19,7 @@ import foundation.e.blisslauncher.core.blur.BlurWallpaperProvider;
import foundation.e.blisslauncher.core.customviews.WidgetHost;
import foundation.e.blisslauncher.features.launcher.AppProvider;
import foundation.e.blisslauncher.features.notification.NotificationService;
import foundation.e.lib.telemetry.Telemetry;
import timber.log.Timber;

public class BlissLauncher extends Application {
@@ -46,8 +51,21 @@ public class BlissLauncher extends Application {
        };
        getContentResolver().registerContentObserver(NOTIFICATION_BADGING_URI, false, notificationSettingsObserver);

        if (!BuildConfig.DEBUG) {
            Telemetry.INSTANCE.init(BuildConfig.SENTRY_DSN, this);
            Timber.plant(new Timber.Tree() {
                @Override
                protected void log(int priority, @Nullable String tag, @NonNull String message, @Nullable Throwable t) {
                    Log.println(priority, tag, message);
                    if (priority == Log.WARN || priority == Log.ERROR) {
                        Telemetry.INSTANCE.reportMessage(tag + ": " + message);
                    }
                }
            });
        } else {
            Timber.plant(new Timber.DebugTree());
        }
    }

    private void onNotificationSettingsChanged() {
        boolean areNotificationDotsEnabled = Settings.Secure.getInt(getContentResolver(),