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

Commit c6bd4a3c authored by Mutyala N V Durga Ashok's avatar Mutyala N V Durga Ashok
Browse files

Fix BT Profile Binder Proxies Leak when BT is OFF

Bug: 225780275
Test: BT OFF -> Call getProfileProxy() -> Observe dumpsys
Sponsor: @wescande

Change-Id: I71c1a4faf877a2423855a74de87b6d5dbac165bd
parent ebacf381
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3473,7 +3473,10 @@ public final class BluetoothAdapter {
        if (context == null || listener == null) {
            return false;
        }

        // Do not create proxies when BT is OFF
        if (getState() != STATE_ON) {
            return false;
        }
        if (profile == BluetoothProfile.HEADSET) {
            BluetoothHeadset headset = new BluetoothHeadset(context, listener, this);
            return true;