From 899df3612f2446e7e3f0759fd001954b57b27de7 Mon Sep 17 00:00:00 2001 From: Lakoja Date: Sat, 18 Jan 2025 23:10:58 +0100 Subject: [PATCH] Appease linter --- .../com/keylesspalace/tusky/MainActivity.kt | 2 +- .../keylesspalace/tusky/TuskyApplication.kt | 1 - .../NotificationService.kt | 22 ++++++++++--------- .../receiver/UnifiedPushBroadcastReceiver.kt | 1 - 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt b/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt index a3bb0edde8..2a9ec4afac 100644 --- a/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt @@ -15,7 +15,6 @@ package com.keylesspalace.tusky -import android.Manifest import android.annotation.SuppressLint import android.app.NotificationManager import android.content.Context @@ -27,6 +26,7 @@ import android.graphics.Color import android.graphics.drawable.Animatable import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable +import android.Manifest import android.net.Uri import android.os.Build import android.os.Bundle diff --git a/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.kt b/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.kt index 0daa768bcf..d40e8967af 100644 --- a/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.kt +++ b/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.kt @@ -16,7 +16,6 @@ package com.keylesspalace.tusky import android.app.Application -import android.content.Context import android.content.SharedPreferences import android.util.Log import androidx.hilt.work.HiltWorkerFactory diff --git a/app/src/main/java/com/keylesspalace/tusky/components/systemnotifications/NotificationService.kt b/app/src/main/java/com/keylesspalace/tusky/components/systemnotifications/NotificationService.kt index a0b11a7877..ea3ba7715b 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/systemnotifications/NotificationService.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/systemnotifications/NotificationService.kt @@ -67,7 +67,7 @@ class NotificationService @Inject constructor( private val api: MastodonApi, @ApplicationContext private val context: Context, ) { - private var notificationId:Int = NOTIFICATION_ID_PRUNE_CACHE + 1 + private var notificationId: Int = NOTIFICATION_ID_PRUNE_CACHE + 1 init { createWorkerNotificationChannel() @@ -196,8 +196,10 @@ class NotificationService @Inject constructor( val workRequest: WorkRequest = PeriodicWorkRequest.Builder( NotificationWorker::class.java, - PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS, TimeUnit.MILLISECONDS, - PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS, TimeUnit.MILLISECONDS + PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS, + TimeUnit.MILLISECONDS, + PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS, + TimeUnit.MILLISECONDS, ) .addTag(NOTIFICATION_PULL_TAG) .setConstraints(Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build()) @@ -372,11 +374,13 @@ class NotificationService @Inject constructor( builder.addAction(composeAction) } - builder.addExtras(Bundle().apply { - // Add the sending account's name, so it can be used also later when summarising this notification - putString(EXTRA_ACCOUNT_NAME, body.account.name) - putString(EXTRA_NOTIFICATION_TYPE, body.type.name) - }) + builder.addExtras( + Bundle().apply { + // Add the sending account's name, so it can be used also later when summarising this notification + putString(EXTRA_ACCOUNT_NAME, body.account.name) + putString(EXTRA_NOTIFICATION_TYPE, body.type.name) + } + ) return builder.build() } @@ -738,7 +742,6 @@ class NotificationService @Inject constructor( disablePullNotifications() } - // // Push notification section // @@ -881,7 +884,6 @@ class NotificationService @Inject constructor( } } - companion object { const val TAG = "NotificationService" diff --git a/app/src/main/java/com/keylesspalace/tusky/receiver/UnifiedPushBroadcastReceiver.kt b/app/src/main/java/com/keylesspalace/tusky/receiver/UnifiedPushBroadcastReceiver.kt index e7ea8303ce..6ba44aeabd 100644 --- a/app/src/main/java/com/keylesspalace/tusky/receiver/UnifiedPushBroadcastReceiver.kt +++ b/app/src/main/java/com/keylesspalace/tusky/receiver/UnifiedPushBroadcastReceiver.kt @@ -71,6 +71,5 @@ class UnifiedPushBroadcastReceiver : MessagingReceiver() { companion object { const val TAG = "UnifiedPush" - } }