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

Commit caa04684 authored by Alice Kuo's avatar Alice Kuo
Browse files

SetDeviceUnauthorized with non-LE audio device for PTS GMCS test

PTS GMCS test is for GMCS standlone, so it's non-LE audio device.
We depend on the PTS test property to setDeviceUnauthorized for PTS test

Bug: 235354262
Test: GMCS PTS all test
Change-Id: I62ad7797fc9e45b43b659d68f2ee335c80ad365b
Merged-In: I62ad7797fc9e45b43b659d68f2ee335c80ad365b
(cherry picked from commit 3ed91363)
parent c0f756c2
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -176,6 +176,11 @@ public class McpService extends ProfileService {
    }

    public void onDeviceUnauthorized(BluetoothDevice device) {
        if (Utils.isPtsTestMode()) {
            Log.d(TAG, "PTS test: setDeviceAuthorized");
            setDeviceAuthorized(device, true);
            return;
        }
        Log.w(TAG, "onDeviceUnauthorized - authorization notification not implemented yet ");
    }

@@ -194,9 +199,10 @@ public class McpService extends ProfileService {
    }

    public int getDeviceAuthorization(BluetoothDevice device) {
        // TODO: For now just reject authorization for other than LeAudio device already authorized.
        //       Consider intent based authorization mechanism for non-LeAudio devices.
        return mDeviceAuthorizations.getOrDefault(device, BluetoothDevice.ACCESS_UNKNOWN);
        // TODO: For now just reject authorization for other than LeAudio device already authorized
        // except for PTS. Consider intent based authorization mechanism for non-LeAudio devices.
        return mDeviceAuthorizations.getOrDefault(device, Utils.isPtsTestMode()
                ? BluetoothDevice.ACCESS_ALLOWED : BluetoothDevice.ACCESS_UNKNOWN);
    }

    @GuardedBy("mLock")