service: dead code removal
This commit is contained in:
parent
e926a54890
commit
e9a4b99aa5
2 changed files with 0 additions and 83 deletions
|
@ -113,20 +113,6 @@ class ObservingNotification(context: Context) :
|
||||||
get() = IntegerTable.INDEXER_NOTIFICATION_CODE
|
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]. */
|
/** Notification channel shared by [IndexingNotification] and [ObservingNotification]. */
|
||||||
private val indexerChannel =
|
private val indexerChannel =
|
||||||
ForegroundServiceNotification.ChannelInfo(
|
ForegroundServiceNotification.ChannelInfo(
|
||||||
|
|
|
@ -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 <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
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()
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue