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

Commit 740483c2 authored by winnichang's avatar winnichang Committed by Winni Chang
Browse files

Do not call setOption if mMhlController is null

[Root Cause]
The system crashes sometimes because we didn't check if mMhlController exists.

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.server.hdmi.HdmiMhlControllerStub.setOption(int, int)' on a null object reference

[Solution]
Check if mMhlController is null before calling setOption.

[Test Report]
AC off/on: PASS

Bug: 380905499
Flag: EXEMPT bugfix
Change-Id: Id21a35b8c9bb00e49a862ad2aca02ccbb3b0e9b9
parent 3902e53d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -710,8 +710,10 @@ public class HdmiControlService extends SystemService {
            // Register ContentObserver to monitor the settings change.
            registerContentObserver();
        }
        if (mMhlController != null) {
            mMhlController.setOption(OPTION_MHL_SERVICE_CONTROL, ENABLED);
        }
    }

    @VisibleForTesting
    void initService() {