From e9a4b99aa5b9d56e2eaac6ff32c7a7d573cf82c5 Mon Sep 17 00:00:00 2001 From: Alexander Capehart Date: Tue, 9 Apr 2024 15:35:36 -0600 Subject: [PATCH] service: dead code removal --- .../auxio/service/IndexerNotifications.kt | 14 ---- .../oxycblt/auxio/service/ServiceFragment.kt | 69 ------------------- 2 files changed, 83 deletions(-) delete mode 100644 app/src/main/java/org/oxycblt/auxio/service/ServiceFragment.kt diff --git a/app/src/main/java/org/oxycblt/auxio/service/IndexerNotifications.kt b/app/src/main/java/org/oxycblt/auxio/service/IndexerNotifications.kt index a59ba16b1..402c3703e 100644 --- a/app/src/main/java/org/oxycblt/auxio/service/IndexerNotifications.kt +++ b/app/src/main/java/org/oxycblt/auxio/service/IndexerNotifications.kt @@ -113,20 +113,6 @@ class ObservingNotification(context: Context) : get() = IntegerTable.INDEXER_NOTIFICATION_CODE } -class FakeNotification(context: Context) : ForegroundServiceNotification(context, indexerChannel) { - init { - setSmallIcon(R.drawable.ic_auxio_24) - setCategory(NotificationCompat.CATEGORY_SERVICE) - setShowWhen(false) - setSilent(true) - setContentIntent(context.newMainPendingIntent()) - setVisibility(NotificationCompat.VISIBILITY_PUBLIC) - } - - override val code: Int - get() = IntegerTable.INDEXER_NOTIFICATION_CODE -} - /** Notification channel shared by [IndexingNotification] and [ObservingNotification]. */ private val indexerChannel = ForegroundServiceNotification.ChannelInfo( diff --git a/app/src/main/java/org/oxycblt/auxio/service/ServiceFragment.kt b/app/src/main/java/org/oxycblt/auxio/service/ServiceFragment.kt deleted file mode 100644 index 9657b9585..000000000 --- a/app/src/main/java/org/oxycblt/auxio/service/ServiceFragment.kt +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2024 Auxio Project - * ServiceFragment.kt is part of Auxio. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.oxycblt.auxio.service - -import android.content.Context -import android.content.Intent - -abstract class ServiceFragment { - // private var handle: AuxioService? = null - - protected val context: Context - get() = throw NotImplementedError() - - var notification: ForegroundServiceNotification? = null - private set - - fun attach(handle: AuxioService) { - throw NotImplementedError() - onCreate(handle) - } - - fun release() { - notification = null - throw NotImplementedError() - onDestroy() - } - - fun handleIntent(intent: Intent) { - onStartCommand(intent) - } - - fun handleTaskRemoved() { - onTaskRemoved() - } - - protected open fun onCreate(context: Context) {} - - protected open fun onDestroy() {} - - protected open fun onStartCommand(intent: Intent) {} - - protected open fun onTaskRemoved() {} - - protected fun startForeground(notification: ForegroundServiceNotification) { - this.notification = notification - // requireNotNull(handle).refreshForeground() - } - - protected fun stopForeground() { - this.notification = null - // requireNotNull(handle).refreshForeground() - } -}