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

Commit 78bd201c authored by Jakub Tyszkowski's avatar Jakub Tyszkowski
Browse files

Fix unregistering callbacks

Bug: 150670922
Tag: #feature
Test: atest CtsBluetoothTestCases
Sponsor: jpawlowski@
Change-Id: Id0ee8eb31547c7b333619642717ee1d87c3c01fb
parent 8d26041b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -601,7 +601,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
        if (DBG) log("unregisterCallback");

        synchronized (mCallbackExecutorMap) {
            if (mCallbackExecutorMap.remove(callback) != null) {
            if (mCallbackExecutorMap.remove(callback) == null) {
                throw new IllegalArgumentException("This callback has not been registered");
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -1002,7 +1002,7 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable {
        if (DBG) log("unregisterCallback");

        synchronized (mCallbackExecutorMap) {
            if (mCallbackExecutorMap.remove(callback) != null) {
            if (mCallbackExecutorMap.remove(callback) == null) {
                throw new IllegalArgumentException("This callback has not been registered");
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -485,7 +485,7 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
        if (DBG) log("unregisterCallback");

        synchronized (mCallbackExecutorMap) {
            if (mCallbackExecutorMap.remove(callback) != null) {
            if (mCallbackExecutorMap.remove(callback) == null) {
                throw new IllegalArgumentException("This callback has not been registered");
            }
        }