From 9f4a33c7a801b29fced3d1abd8786217e12e2fe3 Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Thu, 21 Nov 2024 06:56:10 +0530 Subject: [PATCH] Fix lint --- app/src/main/java/org/schabi/newpipe/App.kt | 79 +++++++++++---------- 1 file changed, 43 insertions(+), 36 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/App.kt b/app/src/main/java/org/schabi/newpipe/App.kt index ec5ca5ab9..f3da05857 100644 --- a/app/src/main/java/org/schabi/newpipe/App.kt +++ b/app/src/main/java/org/schabi/newpipe/App.kt @@ -195,7 +195,9 @@ open class App : fun reportException(throwable: Throwable) { // Throw uncaught exception that will trigger the report system - Thread.currentThread().uncaughtExceptionHandler + Thread + .currentThread() + .uncaughtExceptionHandler .uncaughtException(Thread.currentThread(), throwable) } }, @@ -220,41 +222,46 @@ open class App : private fun initNotificationChannels() { // Keep the importance below DEFAULT to avoid making noise on every notification update for // the main and update channels - val mainChannel = NotificationChannelCompat.Builder( - getString(R.string.notification_channel_id), - NotificationManagerCompat.IMPORTANCE_LOW, - ) - .setName(getString(R.string.notification_channel_name)) - .setDescription(getString(R.string.notification_channel_description)) - .build() - val appUpdateChannel = NotificationChannelCompat.Builder( - getString(R.string.app_update_notification_channel_id), - NotificationManagerCompat.IMPORTANCE_LOW, - ) - .setName(getString(R.string.app_update_notification_channel_name)) - .setDescription(getString(R.string.app_update_notification_channel_description)) - .build() - val hashChannel = NotificationChannelCompat.Builder( - getString(R.string.hash_channel_id), - NotificationManagerCompat.IMPORTANCE_HIGH, - ) - .setName(getString(R.string.hash_channel_name)) - .setDescription(getString(R.string.hash_channel_description)) - .build() - val errorReportChannel = NotificationChannelCompat.Builder( - getString(R.string.error_report_channel_id), - NotificationManagerCompat.IMPORTANCE_LOW, - ) - .setName(getString(R.string.error_report_channel_name)) - .setDescription(getString(R.string.error_report_channel_description)) - .build() - val newStreamChannel = NotificationChannelCompat.Builder( - getString(R.string.streams_notification_channel_id), - NotificationManagerCompat.IMPORTANCE_DEFAULT, - ) - .setName(getString(R.string.streams_notification_channel_name)) - .setDescription(getString(R.string.streams_notification_channel_description)) - .build() + val mainChannel = + NotificationChannelCompat + .Builder( + getString(R.string.notification_channel_id), + NotificationManagerCompat.IMPORTANCE_LOW, + ).setName(getString(R.string.notification_channel_name)) + .setDescription(getString(R.string.notification_channel_description)) + .build() + val appUpdateChannel = + NotificationChannelCompat + .Builder( + getString(R.string.app_update_notification_channel_id), + NotificationManagerCompat.IMPORTANCE_LOW, + ).setName(getString(R.string.app_update_notification_channel_name)) + .setDescription(getString(R.string.app_update_notification_channel_description)) + .build() + val hashChannel = + NotificationChannelCompat + .Builder( + getString(R.string.hash_channel_id), + NotificationManagerCompat.IMPORTANCE_HIGH, + ).setName(getString(R.string.hash_channel_name)) + .setDescription(getString(R.string.hash_channel_description)) + .build() + val errorReportChannel = + NotificationChannelCompat + .Builder( + getString(R.string.error_report_channel_id), + NotificationManagerCompat.IMPORTANCE_LOW, + ).setName(getString(R.string.error_report_channel_name)) + .setDescription(getString(R.string.error_report_channel_description)) + .build() + val newStreamChannel = + NotificationChannelCompat + .Builder( + getString(R.string.streams_notification_channel_id), + NotificationManagerCompat.IMPORTANCE_DEFAULT, + ).setName(getString(R.string.streams_notification_channel_name)) + .setDescription(getString(R.string.streams_notification_channel_description)) + .build() val channels = listOf(mainChannel, appUpdateChannel, hashChannel, errorReportChannel, newStreamChannel)