From 91698742168f336131f20d5d0d47643747e7046d Mon Sep 17 00:00:00 2001 From: Tim Schneeberger Date: Tue, 26 Sep 2023 19:09:56 +0200 Subject: [PATCH] fix: prevent echo on some ROMs --- .../service/RootlessAudioProcessorService.kt | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/me/timschneeberger/rootlessjamesdsp/service/RootlessAudioProcessorService.kt b/app/src/main/java/me/timschneeberger/rootlessjamesdsp/service/RootlessAudioProcessorService.kt index 7b91ea0df..8b57a62e9 100644 --- a/app/src/main/java/me/timschneeberger/rootlessjamesdsp/service/RootlessAudioProcessorService.kt +++ b/app/src/main/java/me/timschneeberger/rootlessjamesdsp/service/RootlessAudioProcessorService.kt @@ -1,13 +1,26 @@ package me.timschneeberger.rootlessjamesdsp.service import android.annotation.SuppressLint -import android.app.* -import android.content.* +import android.app.Activity +import android.app.NotificationManager +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import android.content.IntentFilter +import android.content.SharedPreferences import android.content.pm.ServiceInfo -import android.media.* +import android.media.AudioAttributes +import android.media.AudioFormat +import android.media.AudioManager +import android.media.AudioPlaybackCaptureConfiguration +import android.media.AudioRecord +import android.media.AudioTrack import android.media.projection.MediaProjection import android.media.projection.MediaProjectionManager -import android.os.* +import android.os.Build +import android.os.Handler +import android.os.Looper +import android.os.Process import androidx.annotation.RequiresApi import androidx.core.content.getSystemService import androidx.core.math.MathUtils.clamp @@ -626,6 +639,7 @@ class RootlessAudioProcessorService : BaseAudioProcessorService() { blockedApps.value?.map { it.uid }?.let { excluded += it } + excluded += Process.myUid() excluded.forEach { configBuilder.excludeUid(it) } sessionManager.sessionDatabase.setExcludedUids(excluded.toTypedArray())