Skip to content

Commit

Permalink
fix: exclude Google app by default
Browse files Browse the repository at this point in the history
  • Loading branch information
timschneeb committed Oct 11, 2022
1 parent 75421ec commit d276dc5
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ class MutedSessionManager(private val context: Context) {
private val changeCallbacks = mutableListOf<OnSessionChangeListener>()
private var sessionLossListener: OnSessionLossListener? = null
private var excludedUids = arrayOf<Int>()
private val excludedPackages = arrayOf(
context.packageName,
"com.google.android.googlequicksearchbox"
)

fun destroy()
{
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit d276dc5

Please sign in to comment.