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

Commit ad91e7ef authored by Shuichi.Noguchi's avatar Shuichi.Noguchi
Browse files

Fix NPE by pressing Volume Up/Down

There was NPE when AVR is just after detected and volume key
is pressed. Volume will be changed only after AVR has been detected.

Test: Sanity Test connected to AVR

Change-Id: I56a294a45d805b430007f3599dd79972cf43e466
parent 2610ad05
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1018,6 +1018,10 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
    @ServiceThreadOnly
    void changeVolume(int curVolume, int delta, int maxVolume) {
        assertRunOnServiceThread();
        if (getAvrDeviceInfo() == null) {
            // On initialization process, getAvrDeviceInfo() may return null and cause exception
            return;
        }
        if (delta == 0 || !isSystemAudioActivated()) {
            return;
        }
@@ -1047,6 +1051,10 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
    @ServiceThreadOnly
    void changeMute(boolean mute) {
        assertRunOnServiceThread();
        if (getAvrDeviceInfo() == null) {
            // On initialization process, getAvrDeviceInfo() may return null and cause exception
            return;
        }
        HdmiLogger.debug("[A]:Change mute:%b", mute);
        synchronized (mLock) {
            if (mSystemAudioMute == mute) {