1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 08:30:44 +00:00
This commit is contained in:
Isira Seneviratne 2024-11-21 06:56:10 +05:30
parent 3a9540b042
commit 9f4a33c7a8

View File

@ -195,7 +195,9 @@ open class App :
fun reportException(throwable: Throwable) { fun reportException(throwable: Throwable) {
// Throw uncaught exception that will trigger the report system // Throw uncaught exception that will trigger the report system
Thread.currentThread().uncaughtExceptionHandler Thread
.currentThread()
.uncaughtExceptionHandler
.uncaughtException(Thread.currentThread(), throwable) .uncaughtException(Thread.currentThread(), throwable)
} }
}, },
@ -220,41 +222,46 @@ open class App :
private fun initNotificationChannels() { private fun initNotificationChannels() {
// Keep the importance below DEFAULT to avoid making noise on every notification update for // Keep the importance below DEFAULT to avoid making noise on every notification update for
// the main and update channels // the main and update channels
val mainChannel = NotificationChannelCompat.Builder( val mainChannel =
getString(R.string.notification_channel_id), NotificationChannelCompat
NotificationManagerCompat.IMPORTANCE_LOW, .Builder(
) getString(R.string.notification_channel_id),
.setName(getString(R.string.notification_channel_name)) NotificationManagerCompat.IMPORTANCE_LOW,
.setDescription(getString(R.string.notification_channel_description)) ).setName(getString(R.string.notification_channel_name))
.build() .setDescription(getString(R.string.notification_channel_description))
val appUpdateChannel = NotificationChannelCompat.Builder( .build()
getString(R.string.app_update_notification_channel_id), val appUpdateChannel =
NotificationManagerCompat.IMPORTANCE_LOW, NotificationChannelCompat
) .Builder(
.setName(getString(R.string.app_update_notification_channel_name)) getString(R.string.app_update_notification_channel_id),
.setDescription(getString(R.string.app_update_notification_channel_description)) NotificationManagerCompat.IMPORTANCE_LOW,
.build() ).setName(getString(R.string.app_update_notification_channel_name))
val hashChannel = NotificationChannelCompat.Builder( .setDescription(getString(R.string.app_update_notification_channel_description))
getString(R.string.hash_channel_id), .build()
NotificationManagerCompat.IMPORTANCE_HIGH, val hashChannel =
) NotificationChannelCompat
.setName(getString(R.string.hash_channel_name)) .Builder(
.setDescription(getString(R.string.hash_channel_description)) getString(R.string.hash_channel_id),
.build() NotificationManagerCompat.IMPORTANCE_HIGH,
val errorReportChannel = NotificationChannelCompat.Builder( ).setName(getString(R.string.hash_channel_name))
getString(R.string.error_report_channel_id), .setDescription(getString(R.string.hash_channel_description))
NotificationManagerCompat.IMPORTANCE_LOW, .build()
) val errorReportChannel =
.setName(getString(R.string.error_report_channel_name)) NotificationChannelCompat
.setDescription(getString(R.string.error_report_channel_description)) .Builder(
.build() getString(R.string.error_report_channel_id),
val newStreamChannel = NotificationChannelCompat.Builder( NotificationManagerCompat.IMPORTANCE_LOW,
getString(R.string.streams_notification_channel_id), ).setName(getString(R.string.error_report_channel_name))
NotificationManagerCompat.IMPORTANCE_DEFAULT, .setDescription(getString(R.string.error_report_channel_description))
) .build()
.setName(getString(R.string.streams_notification_channel_name)) val newStreamChannel =
.setDescription(getString(R.string.streams_notification_channel_description)) NotificationChannelCompat
.build() .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) val channels = listOf(mainChannel, appUpdateChannel, hashChannel, errorReportChannel, newStreamChannel)