DrmManagerClient: query drm service without blocking
Bug: 194889768
Bug: 195732578
Test: atest DRMTest#testForwardLockAccess
Change-Id: If0165fe89ba69659d9e451c0cf0cc28ca2c70616
(cherry picked from commit 5450ceb552822d270c1eb653973e5595f5183ad6)
diff --git a/drm/libdrmframework/DrmManagerClientImpl.cpp b/drm/libdrmframework/DrmManagerClientImpl.cpp
index a2cac3f..6cb0a99 100644
--- a/drm/libdrmframework/DrmManagerClientImpl.cpp
+++ b/drm/libdrmframework/DrmManagerClientImpl.cpp
@@ -53,10 +53,8 @@
Mutex::Autolock lock(sMutex);
if (NULL == sDrmManagerService.get()) {
sp<IServiceManager> sm = defaultServiceManager();
- sp<IBinder> binder = sm->getService(String16("drm.drmManager"));
+ sp<IBinder> binder = sm->checkService(String16("drm.drmManager"));
if (binder == NULL) {
- // Do NOT retry; IServiceManager already waits for ~5 seconds
- // in getService if a service doesn't yet exist.
return sDrmManagerService;
}
if (NULL == sDeathNotifier.get()) {