From d276dc58843281c34a8f4c08c9c13165a81a6c63 Mon Sep 17 00:00:00 2001 From: Tim Schneeberger Date: Tue, 11 Oct 2022 14:40:58 +0200 Subject: [PATCH] fix: exclude Google app by default --- .../rootlessjamesdsp/session/MutedSessionManager.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/me/timschneeberger/rootlessjamesdsp/session/MutedSessionManager.kt b/app/src/main/java/me/timschneeberger/rootlessjamesdsp/session/MutedSessionManager.kt index 5d6ac377a..294af4a22 100644 --- a/app/src/main/java/me/timschneeberger/rootlessjamesdsp/session/MutedSessionManager.kt +++ b/app/src/main/java/me/timschneeberger/rootlessjamesdsp/session/MutedSessionManager.kt @@ -17,6 +17,10 @@ class MutedSessionManager(private val context: Context) { private val changeCallbacks = mutableListOf() private var sessionLossListener: OnSessionLossListener? = null private var excludedUids = arrayOf() + private val excludedPackages = arrayOf( + context.packageName, + "com.google.android.googlequicksearchbox" + ) fun destroy() { @@ -50,8 +54,8 @@ class MutedSessionManager(private val context: Context) { val sid = it.key val data = it.value val name = context.packageManager.getNameForUid(it.value.uid) - if (data.uid == myUid() || name == context.packageName) { - Timber.tag(TAG).d("Skipped session $sid ($data)") + if (data.uid == myUid() || excludedPackages.contains(name)) { + Timber.tag(TAG).d("Skipped session $sid due to package name $name ($data)") return@next } if (sid == 0) {