mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-14 18:26:11 -04:00
refactor: Drop per-emission flow logger and redundant widget logs
This commit is contained in:
@@ -16,7 +16,6 @@ import kotlinx.coroutines.flow.conflate
|
||||
import kotlinx.coroutines.flow.drop
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.onCompletion
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.flow.onStart
|
||||
import kotlinx.coroutines.flow.scan
|
||||
import kotlinx.coroutines.flow.shareIn
|
||||
@@ -54,7 +53,6 @@ fun <T> Flow<T>.takeUntilAfter(predicate: suspend (T) -> Boolean) = transformWhi
|
||||
|
||||
fun <T> Flow<T>.setupCommonEventHandlers(tag: String, identifier: () -> String) = this
|
||||
.onStart { log(tag, VERBOSE) { "${identifier()}.onStart()" } }
|
||||
.onEach { log(tag, VERBOSE) { "${identifier()}.onEach(): $it" } }
|
||||
.onCompletion { log(tag, VERBOSE) { "${identifier()}.onCompletion()" } }
|
||||
.catch {
|
||||
if (it.hasCause(CancellationException::class)) {
|
||||
|
||||
@@ -3,9 +3,6 @@ package eu.darken.capod.main.ui.widget
|
||||
import android.content.Context
|
||||
import androidx.glance.appwidget.updateAll
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import eu.darken.capod.common.debug.logging.Logging.Priority.VERBOSE
|
||||
import eu.darken.capod.common.debug.logging.log
|
||||
import eu.darken.capod.common.debug.logging.logTag
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@@ -16,12 +13,7 @@ class WidgetManager @Inject constructor(
|
||||
) {
|
||||
|
||||
suspend fun refreshWidgets() {
|
||||
log(TAG, VERBOSE) { "refreshWidgets()" }
|
||||
BatteryGlanceWidget().updateAll(context)
|
||||
AncGlanceWidget().updateAll(context)
|
||||
}
|
||||
|
||||
companion object {
|
||||
val TAG = logTag("Widget", "Manager")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,12 +36,8 @@ class WidgetSettings @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun getWidgetProfile(widgetId: Int): ProfileId? {
|
||||
val profileId = runBlocking {
|
||||
dataStore.data.first()[stringPreferencesKey(getWidgetProfileKey(widgetId))]
|
||||
}
|
||||
log(TAG, VERBOSE) { "getWidgetProfile(widgetId=$widgetId) = $profileId" }
|
||||
return profileId
|
||||
fun getWidgetProfile(widgetId: Int): ProfileId? = runBlocking {
|
||||
dataStore.data.first()[stringPreferencesKey(getWidgetProfileKey(widgetId))]
|
||||
}
|
||||
|
||||
fun removeWidget(widgetId: Int) {
|
||||
|
||||
Reference in New Issue
Block a user