summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
Diffstat (limited to 'media')
-rw-r--r--media/libmediaplayerservice/MediaPlayerService.cpp3
-rw-r--r--media/libmediaplayerservice/tests/DrmSessionManager_test.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp
index 5e5d099..3a399af 100644
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -290,8 +290,9 @@ MediaPlayerService::MediaPlayerService()
const sp<IServiceManager> sm(defaultServiceManager());
if (sm != NULL) {
const String16 name("batterystats");
+ // use checkService() to avoid blocking if service is not up yet
sp<IBatteryStats> batteryStats =
- interface_cast<IBatteryStats>(sm->getService(name));
+ interface_cast<IBatteryStats>(sm->checkService(name));
if (batteryStats != NULL) {
batteryStats->noteResetVideo();
batteryStats->noteResetAudio();
diff --git a/media/libmediaplayerservice/tests/DrmSessionManager_test.cpp b/media/libmediaplayerservice/tests/DrmSessionManager_test.cpp
index a199ee1..fa002b8 100644
--- a/media/libmediaplayerservice/tests/DrmSessionManager_test.cpp
+++ b/media/libmediaplayerservice/tests/DrmSessionManager_test.cpp
@@ -220,7 +220,7 @@ TEST_F(DrmSessionManagerTest, reclaimSession) {
// add a session from a higher priority process.
sp<FakeDrm> drm = new FakeDrm;
- const uint8_t ids[] = {456, 7890, 123};
+ const uint8_t ids[] = {1, 3, 5};
Vector<uint8_t> sessionId;
GetSessionId(ids, ARRAY_SIZE(ids), &sessionId);
mDrmSessionManager->addSession(30, drm, sessionId);