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

Skip to content
Commit 302c9e2f authored by Alden DSouza's avatar Alden DSouza Committed by Myles Watson
Browse files

Fix volume change nullpointer exception in AvrcpTargetService when configured as A2DP sink

When configured as an A2DP sink (i.e. A2dpService disabled, A2dpSinkService enabled),
media plays without issue, but sending a volume change command to device results in
a crash and BT disconnect, root-caused to a nullpointer exception in
AvrcpTargetService.java

Error message from bugreport:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.bluetooth.BluetoothDevice com.android.bluetooth.a2dp.A2dpService.getActiveDevice()' on a null object reference

Bug: 148421135
Test: In overlay/packages/apps/Bluetooth/res/values/config.xml:
 - Set profile_supported_a2dp to false
 - Set profile_supported_a2dp_sink to true
 - Set profile_supported_avrcp_target to true

Build/flash device, then connect to device, play media and change volume level.

Verified that after fix, BT service does not crash, volume changes work as expected.

Change-Id: I2f2b57d23b81b1d8a2e72dc0b7e087b2d5bd477a
parent d28e12f4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment