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

Commit a7761edc authored by David Li's avatar David Li Committed by Android Build Cherrypicker Worker
Browse files

fix null access on mBluetoothA2dp

Bug: 303004264
Test: mm
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:8bb0cead1b9d4f1041ef8ac6437d44ef7074f7d0)
Merged-In: If3e8a37fbc9ee2580e4a043ce809bffa3e47cd1f
Change-Id: If3e8a37fbc9ee2580e4a043ce809bffa3e47cd1f
parent 5708d191
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -1221,10 +1221,15 @@ status_t DeviceHalAidl::filterAndRetrieveBtA2dpParameters(
    TIME_CHECK();
    if (String8 key = String8(AudioParameter::keyReconfigA2dpSupported); keys.containsKey(key)) {
        keys.remove(key);
        if (mBluetoothA2dp != nullptr) {
            bool supports;
            RETURN_STATUS_IF_ERROR(statusTFromBinderStatus(
                            mBluetoothA2dp->supportsOffloadReconfiguration(&supports)));
            result->addInt(key, supports ? 1 : 0);
        } else {
            ALOGI("%s: no IBluetoothA2dp on %s", __func__, mInstance.c_str());
            result->addInt(key, 0);
        }
    }
    return OK;
}