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

Commit 97620e66 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "SetDeviceUnauthorized with non-LE audio device for PTS GMCS test" am:...

Merge "SetDeviceUnauthorized with non-LE audio device for PTS GMCS test" am: 08ad28bb am: 138ecafe am: c185ad64

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2120893



Change-Id: Ibf9c5a21f660dd73c532ea1b683bd62bc6b61ba9
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f6d7dfa7 c185ad64
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -176,6 +176,11 @@ public class McpService extends ProfileService {
    }
    }


    public void onDeviceUnauthorized(BluetoothDevice device) {
    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 ");
        Log.w(TAG, "onDeviceUnauthorized - authorization notification not implemented yet ");
    }
    }


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


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


    @GuardedBy("mLock")
    @GuardedBy("mLock")