diff options
author | Warren Rehman <wrehman@google.com> | 2015-03-09 06:15:53 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-03-09 06:15:55 +0000 |
commit | b9a23184272a75f1585e8dd64eeccc3a3e621d5f (patch) | |
tree | a9f1aa8ab2cb9e59cc76b52246b36a8691edf8a1 /media/libmediaplayerservice | |
parent | f9d19514b3e620b6339c98a442da833a702915ed (diff) | |
parent | ed849b8266824d4c5df15466e5c02e1471192461 (diff) | |
download | frameworks_av-b9a23184272a75f1585e8dd64eeccc3a3e621d5f.zip frameworks_av-b9a23184272a75f1585e8dd64eeccc3a3e621d5f.tar.gz frameworks_av-b9a23184272a75f1585e8dd64eeccc3a3e621d5f.tar.bz2 |
Merge "Defensively check for batterystats service instead of blocking to get it."
Diffstat (limited to 'media/libmediaplayerservice')
-rw-r--r-- | media/libmediaplayerservice/MediaPlayerService.cpp | 3 |
1 files changed, 2 insertions, 1 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(); |