diff options
| author | 2022-09-23 12:14:08 +0000 | |
|---|---|---|
| committer | 2022-09-23 12:14:08 +0000 | |
| commit | 0fc137611e9eeea801296cac9a2df0911f11e6cc (patch) | |
| tree | 17a28087e00ded5be94982f387b372723f1e5000 | |
| parent | 80a173aca9ee9a0a1b627180f54dccf31fdc067f (diff) | |
| parent | 3f2521f1941d6926cfbeead8e663649cee283f99 (diff) | |
Merge "Get HDMI CEC physical address with service thread, so TIF can get it for Player." am: 3f2521f194
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2219765
Change-Id: I4b31cb4091a924012342cc9c16af198a35196aed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | services/core/java/com/android/server/hdmi/HdmiControlService.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java index f8a74f4f3f55..7d35fc5c8bd5 100644 --- a/services/core/java/com/android/server/hdmi/HdmiControlService.java +++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java @@ -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 |