Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 010f5e7f authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

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
parent 19533ea7
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -384,11 +384,12 @@ public class AudioDeviceBroker {
    /**
    /**
     * Indicates if a Bluetooth SCO activation request owner is controlling
     * Indicates if a Bluetooth SCO activation request owner is controlling
     * the SCO audio state itself or not.
     * 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
     * @return true if we should control SCO audio state, false otherwise
     */
     */
    private boolean shouldStartScoForUid(int uid) {
    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")
    @GuardedBy("mDeviceStateLock")