Loading bliss/src/foundation/e/bliss/utils/Logger.kt +3 −0 Original line number Diff line number Diff line Loading @@ -9,10 +9,13 @@ package foundation.e.bliss.utils import android.util.Log as AndroidLog import com.android.launcher3.BuildConfig import timber.log.Timber object Logger { private val isDebug = BuildConfig.DEBUG @JvmStatic fun plant() = Timber.plant(Timber.DebugTree()) private fun log( tag: String, msg: String, Loading build.gradle +3 −0 Original line number Diff line number Diff line Loading @@ -209,6 +209,7 @@ android { configureEach { resValue("string", "quickstep_component", "${applicationId}/com.android.launcher3.uioverrides.QuickstepLauncher") resValue("string", "launcher_component", "${applicationId}/com.android.launcher3.Launcher") buildConfigField("String", "SENTRY_DSN", "\"${System.getenv("SENTRY_DSN")}\"") } } Loading Loading @@ -276,6 +277,8 @@ android { } } lintOptions { disable "LogNotTimber" } addFrameworkJar('framework-14.jar') } Loading src/com/android/launcher3/Launcher.java +32 −15 Original line number Diff line number Diff line Loading @@ -291,6 +291,8 @@ import foundation.e.bliss.multimode.MultiModeController; import foundation.e.bliss.utils.Logger; import foundation.e.bliss.widgets.RoundedWidgetView; import foundation.e.bliss.widgets.WidgetsDbHelper; import foundation.e.lib.telemetry.Telemetry; import timber.log.Timber; /** * Default launcher application. Loading Loading @@ -442,6 +444,16 @@ public class Launcher extends StatefulActivity<LauncherState> @Override @TargetApi(Build.VERSION_CODES.S) protected void onCreate(Bundle savedInstanceState) { Logger.plant(); if (!BuildConfig.DEBUG) { try { Telemetry.init(BuildConfig.SENTRY_DSN, getApplication(), true); } catch (Exception e) { Logger.e(TAG, "Failed to initialize Sentry"); } } mStartupLatencyLogger = createStartupLatencyLogger( sIsNewProcess ? LockedUserState.get(this).isUserUnlockedAtLauncherStartup() Loading Loading @@ -483,7 +495,7 @@ public class Launcher extends StatefulActivity<LauncherState> .build()); } if (Utilities.IS_DEBUG_DEVICE && FeatureFlags.NOTIFY_CRASHES.get()) { if (FeatureFlags.NOTIFY_CRASHES.get()) { final String notificationChannelId = "com.android.launcher3.Debug"; final String notificationChannelName = "Debug"; final String notificationTag = "Debug"; Loading @@ -497,6 +509,7 @@ public class Launcher extends StatefulActivity<LauncherState> Thread.currentThread().setUncaughtExceptionHandler((thread, throwable) -> { String stackTrace = Log.getStackTraceString(throwable); if (Utilities.IS_DEBUG_DEVICE) { Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(Intent.EXTRA_TEXT, stackTrace); Loading @@ -510,7 +523,11 @@ public class Launcher extends StatefulActivity<LauncherState> .setStyle(new Notification.BigTextStyle().bigText(stackTrace)) .addAction(android.R.drawable.ic_menu_share, "Share", sharePendingIntent) .build(); notificationManager.notify(notificationTag, notificationId, notification); } else { Timber.tag(TAG).e(throwable); } Thread.UncaughtExceptionHandler defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler(); Loading Loading
bliss/src/foundation/e/bliss/utils/Logger.kt +3 −0 Original line number Diff line number Diff line Loading @@ -9,10 +9,13 @@ package foundation.e.bliss.utils import android.util.Log as AndroidLog import com.android.launcher3.BuildConfig import timber.log.Timber object Logger { private val isDebug = BuildConfig.DEBUG @JvmStatic fun plant() = Timber.plant(Timber.DebugTree()) private fun log( tag: String, msg: String, Loading
build.gradle +3 −0 Original line number Diff line number Diff line Loading @@ -209,6 +209,7 @@ android { configureEach { resValue("string", "quickstep_component", "${applicationId}/com.android.launcher3.uioverrides.QuickstepLauncher") resValue("string", "launcher_component", "${applicationId}/com.android.launcher3.Launcher") buildConfigField("String", "SENTRY_DSN", "\"${System.getenv("SENTRY_DSN")}\"") } } Loading Loading @@ -276,6 +277,8 @@ android { } } lintOptions { disable "LogNotTimber" } addFrameworkJar('framework-14.jar') } Loading
src/com/android/launcher3/Launcher.java +32 −15 Original line number Diff line number Diff line Loading @@ -291,6 +291,8 @@ import foundation.e.bliss.multimode.MultiModeController; import foundation.e.bliss.utils.Logger; import foundation.e.bliss.widgets.RoundedWidgetView; import foundation.e.bliss.widgets.WidgetsDbHelper; import foundation.e.lib.telemetry.Telemetry; import timber.log.Timber; /** * Default launcher application. Loading Loading @@ -442,6 +444,16 @@ public class Launcher extends StatefulActivity<LauncherState> @Override @TargetApi(Build.VERSION_CODES.S) protected void onCreate(Bundle savedInstanceState) { Logger.plant(); if (!BuildConfig.DEBUG) { try { Telemetry.init(BuildConfig.SENTRY_DSN, getApplication(), true); } catch (Exception e) { Logger.e(TAG, "Failed to initialize Sentry"); } } mStartupLatencyLogger = createStartupLatencyLogger( sIsNewProcess ? LockedUserState.get(this).isUserUnlockedAtLauncherStartup() Loading Loading @@ -483,7 +495,7 @@ public class Launcher extends StatefulActivity<LauncherState> .build()); } if (Utilities.IS_DEBUG_DEVICE && FeatureFlags.NOTIFY_CRASHES.get()) { if (FeatureFlags.NOTIFY_CRASHES.get()) { final String notificationChannelId = "com.android.launcher3.Debug"; final String notificationChannelName = "Debug"; final String notificationTag = "Debug"; Loading @@ -497,6 +509,7 @@ public class Launcher extends StatefulActivity<LauncherState> Thread.currentThread().setUncaughtExceptionHandler((thread, throwable) -> { String stackTrace = Log.getStackTraceString(throwable); if (Utilities.IS_DEBUG_DEVICE) { Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(Intent.EXTRA_TEXT, stackTrace); Loading @@ -510,7 +523,11 @@ public class Launcher extends StatefulActivity<LauncherState> .setStyle(new Notification.BigTextStyle().bigText(stackTrace)) .addAction(android.R.drawable.ic_menu_share, "Share", sharePendingIntent) .build(); notificationManager.notify(notificationTag, notificationId, notification); } else { Timber.tag(TAG).e(throwable); } Thread.UncaughtExceptionHandler defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler(); Loading