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

Commit 75fbb239 authored by eric_kuang.rs's avatar eric_kuang.rs
Browse files

Get HDMI CEC physical address with service thread, so TIF can get it for Player.

Change-Id: Ice88ddf519fbe0c1af0134bd8baecf643eac6ebf
Bug: 241318914
Test: manual test
parent d6a9de15
Loading
Loading
Loading
Loading
+13 −3
Original line number Original line Diff line number Diff line
@@ -266,6 +266,10 @@ public class HdmiControlService extends SystemService {
    // Make sure HdmiCecConfig is instantiated and the XMLs are read.
    // Make sure HdmiCecConfig is instantiated and the XMLs are read.
    private HdmiCecConfig mHdmiCecConfig;
    private HdmiCecConfig mHdmiCecConfig;


    // Last return value of getPhysicalAddress(). Only updated on calls of getPhysicalAddress().
    // Does not represent the current physical address at all times. Not to be used as a cache.
    private int mPhysicalAddress = Constants.INVALID_PHYSICAL_ADDRESS;

    /**
    /**
     * Interface to report send result.
     * Interface to report send result.
     */
     */
@@ -2080,9 +2084,15 @@ public class HdmiControlService extends SystemService {
        @Override
        @Override
        public int getPhysicalAddress() {
        public int getPhysicalAddress() {
            initBinderCall();
            initBinderCall();
            runOnServiceThread(new Runnable() {
                @Override
                public void run() {
                    synchronized (mLock) {
                    synchronized (mLock) {
                return mHdmiCecNetwork.getPhysicalAddress();
                        mPhysicalAddress = mHdmiCecNetwork.getPhysicalAddress();
                    }
                }
                }
            });
            return mPhysicalAddress;
        }
        }


        @Override
        @Override