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

Commit 3c669ca9 authored by Etienne Ruffieux's avatar Etienne Ruffieux
Browse files

Fix crash in AvrcpTargetService PlayerSettings

PlayerSettings can be updated before the native interface
is created, or right after it's destroyed. Added null
check to prevent crash.

Bug: 287537221
Tag: #feature
Test: ON/OFF BT while changing player settings
Test: m aosp_bramble-userdebug
Change-Id: Ie5e3cae39e2ca63189728209bf6605d07081e4ae
parent 3e0aebc3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -504,6 +504,11 @@ public class AvrcpTargetService extends ProfileService {
     * Called from player callback to indicate new settings to remote device.
     */
    public void sendPlayerSettings(int repeatMode, int shuffleMode) {
        if (mNativeInterface == null) {
            Log.i(TAG, "Tried to send Player Settings while native interface is null");
            return;
        }

        mNativeInterface.sendPlayerSettings(repeatMode, shuffleMode);
    }