Merge "Get HDMI CEC physical address with service thread, so TIF can get it for Player." am: 3f2521f194 am: 0fc137611e

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2219765

Change-Id: I9bda3bf4b95af008cca5c8bff2334d7ef5236c82
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Nathalie Le Clair
2022-09-23 12:46:06 +00:00
committed by Automerger Merge Worker

View File

@@ -266,6 +266,10 @@ public class HdmiControlService extends SystemService {
// Make sure HdmiCecConfig is instantiated and the XMLs are read.
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.
*/
@@ -2080,9 +2084,15 @@ public class HdmiControlService extends SystemService {
@Override
public int getPhysicalAddress() {
initBinderCall();
synchronized (mLock) {
return mHdmiCecNetwork.getPhysicalAddress();
}
runOnServiceThread(new Runnable() {
@Override
public void run() {
synchronized (mLock) {
mPhysicalAddress = mHdmiCecNetwork.getPhysicalAddress();
}
}
});
return mPhysicalAddress;
}
@Override