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

Commit f2c670b2 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Gerrit Code Review
Browse files

Merge "vc: Fix handling volume state change which can be without device"

parents 4dd9685b 61187be2
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -426,15 +426,18 @@ public class VolumeControlService extends ProfileService {
    }

    void messageFromNative(VolumeControlStackEvent stackEvent) {
        Objects.requireNonNull(stackEvent.device,
                "Device should never be null, event: " + stackEvent);

        Intent intent = null;
        if (stackEvent.type == VolumeControlStackEvent.EVENT_TYPE_VOLUME_STATE_CHANGED) {
            handleVolumeControlChanged(stackEvent.device, stackEvent.valueInt1,
                                       stackEvent.valueInt2, stackEvent.valueBool1);
          return;
        }

        Objects.requireNonNull(stackEvent.device,
                "Device should never be null, event: " + stackEvent);

        Intent intent = null;

        if (intent != null) {
            intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT
                    | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);