author | Tellen Yu <tellen.yu@amlogic.com> | 2017-11-24 05:53:54 (GMT) |
---|---|---|
committer | Gerrit Code Review <gituser@scgit.amlogic.com> | 2017-11-24 05:53:54 (GMT) |
commit | 71b881fa4a8e5135aafc18ccc401ae5b4c7becc9 (patch) | |
tree | f35754481d969455ed2d6bc14825c8e60639cbf2 | |
parent | 324328bc2954086d3f4173ae8640b9b121bcfdb8 (diff) | |
parent | 3e22c2dfe6ed462785b301b85f87787dfba404d7 (diff) | |
download | frameworks-71b881fa4a8e5135aafc18ccc401ae5b4c7becc9.zip frameworks-71b881fa4a8e5135aafc18ccc401ae5b4c7becc9.tar.gz frameworks-71b881fa4a8e5135aafc18ccc401ae5b4c7becc9.tar.bz2 |
Merge "cec: use tryGetService to return immediately [1/1]" into o-amlogic
-rw-r--r-- | services/hdmicec/binder/HdmiCecHidlClient.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/hdmicec/binder/HdmiCecHidlClient.cpp b/services/hdmicec/binder/HdmiCecHidlClient.cpp index e3a94f0..51f3f93 100644 --- a/services/hdmicec/binder/HdmiCecHidlClient.cpp +++ b/services/hdmicec/binder/HdmiCecHidlClient.cpp @@ -234,8 +234,12 @@ sp<IDroidHdmiCEC> HdmiCecHidlClient::getHdmiCecService() Mutex::Autolock _l(mLock); #if 1//PLATFORM_SDK_VERSION >= 26 - sp<IDroidHdmiCEC> hdmicec = IDroidHdmiCEC::getService(); - + sp<IDroidHdmiCEC> hdmicec = IDroidHdmiCEC::tryGetService(); + while (hdmicec == nullptr) { + usleep(200*1000);//sleep 200ms + hdmicec = IDroidHdmiCEC::tryGetService(); + ALOGE("tryGet hdmicecd daemon Service"); + }; mDeathRecipient = new HdmiCecDaemonDeathRecipient(this); Return<bool> linked = hdmicec->linkToDeath(mDeathRecipient, /*cookie*/ 0); if (!linked.isOk()) { |