diff options
| author | 2024-09-30 11:34:55 -0700 | |
|---|---|---|
| committer | 2024-10-02 22:57:39 +0000 | |
| commit | 010f5e7f0297437f087a209a3c84c5ce6d3bfee0 (patch) | |
| tree | 0a33971139c9ab6d9112ff69764afb1e986bed84 | |
| parent | 19533ea7e5379c6413353c4fa0ecf615af31c0c3 (diff) | |
AudioDeviceBroker: fix UID comparison for phone/bt process for HSUM
Compare app UID instead of UID to account for HSUM platforms where
the main user is not user 0.
Bug: 370537688
Flag: EXEMPT bugfix
Test: MT/MO call with SCO on
Change-Id: Ib702c7304d1873480b5e7acd9c5ba039fc6ad47b
| -rw-r--r-- | services/core/java/com/android/server/audio/AudioDeviceBroker.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/audio/AudioDeviceBroker.java b/services/core/java/com/android/server/audio/AudioDeviceBroker.java index 875041540f40..0475b94c784a 100644 --- a/services/core/java/com/android/server/audio/AudioDeviceBroker.java +++ b/services/core/java/com/android/server/audio/AudioDeviceBroker.java @@ -384,11 +384,12 @@ public class AudioDeviceBroker { /** * Indicates if a Bluetooth SCO activation request owner is controlling * the SCO audio state itself or not. - * @param uid the UI of the SOC request owner app + * @param uid the UID of the SOC request owner app * @return true if we should control SCO audio state, false otherwise */ private boolean shouldStartScoForUid(int uid) { - return !(uid == Process.BLUETOOTH_UID || uid == Process.PHONE_UID); + return !(UserHandle.isSameApp(uid, Process.BLUETOOTH_UID) + || UserHandle.isSameApp(uid, Process.PHONE_UID)); } @GuardedBy("mDeviceStateLock") |