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

Commit 45487924 authored by Jakub Tyszkowski's avatar Jakub Tyszkowski
Browse files

MCP: Fix device unauthorizing

When device is explicitly unathorized we should not try other
authorization methods.

Bug: 254713359
Tag: #feature
Test: atest BluetoothInstrumentationTests:com.android.bluetooth.mcp.McpServiceTest#testAuthorization
Change-Id: I9ea7630d09f0ec8ce8048a3d63b1c51b9aa9fdc7
parent 1d70665a
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -206,10 +206,10 @@ public class McpService extends ProfileService {
         * 2. authorized devices
         * 3. Any LeAudio devices which are allowed to connect
         */
        if (mDeviceAuthorizations.getOrDefault(device, Utils.isPtsTestMode()
                ? BluetoothDevice.ACCESS_ALLOWED : BluetoothDevice.ACCESS_UNKNOWN)
                        == BluetoothDevice.ACCESS_ALLOWED) {
            return BluetoothDevice.ACCESS_ALLOWED;
        int authorization = mDeviceAuthorizations.getOrDefault(device, Utils.isPtsTestMode()
                ? BluetoothDevice.ACCESS_ALLOWED : BluetoothDevice.ACCESS_UNKNOWN);
        if (authorization != BluetoothDevice.ACCESS_UNKNOWN) {
            return authorization;
        }

        LeAudioService leAudioService = LeAudioService.getLeAudioService();