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

Commit ec0dc890 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

AudioService: fix wakelock when BT profile proxy is null

When the BT service communicates that a new BT device is active,
and the corresponding profile proxy for BT is null (bug),
the wakelock for the message handling wasn't released.

Bug: 319128812
Test: adb shell dumpys audio | grep "\- STREAM_MUSIC:" -A2
Change-Id: Iaa9e8338d99d1f897444d6246f415104bd78350b
parent a14da088
Loading
Loading
Loading
Loading
+15 −16
Original line number Diff line number Diff line
@@ -1812,9 +1812,7 @@ public class AudioDeviceBroker {
                                        "msg: MSG_L_SET_BT_ACTIVE_DEVICE "
                                            + "received with null profile proxy: "
                                            + btInfo)).printLog(TAG));
                                sendMsg(MSG_CHECK_MUTE_MUSIC, SENDMSG_REPLACE, 0 /*delay*/);
                                return;
                            }
                            } else {
                                @AudioSystem.AudioFormatNativeEnumForBtCodec final int codec =
                                        mBtHelper.getCodecWithFallback(btInfo.mDevice,
                                                btInfo.mProfile, btInfo.mIsLeOutput,
@@ -1831,6 +1829,7 @@ public class AudioDeviceBroker {
                                }
                            }
                        }
                    }
                    break;
                case MSG_BT_HEADSET_CNCT_FAILED:
                    synchronized (mSetModeLock) {
+1 −1
Original line number Diff line number Diff line
@@ -764,7 +764,7 @@ public class AudioDeviceInventory {
    /** only public for mocking/spying, do not call outside of AudioService */
    // @GuardedBy("mDeviceBroker.mSetModeLock")
    @VisibleForTesting
    @GuardedBy("mDeviceBroker.mDeviceStateLock")
    //@GuardedBy("AudioDeviceBroker.this.mDeviceStateLock")
    public void onSetBtActiveDevice(@NonNull AudioDeviceBroker.BtDeviceInfo btInfo,
                                    @AudioSystem.AudioFormatNativeEnumForBtCodec int codec,
                                    int streamType) {