From 99e69716215cd0665379bc90d708f2ea8689831d Mon Sep 17 00:00:00 2001 From: Ruben Brunk Date: Tue, 26 May 2015 17:25:07 -0700 Subject: Track camera and flashlight usage in battery stats. Bug: 15986092 Change-Id: I9dc6828332e4091fd93bf2d82839e8e3862a2fc2 --- media/libmediaplayerservice/Android.mk | 1 + media/libmediaplayerservice/MediaPlayerService.cpp | 16 ++++------------ 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'media/libmediaplayerservice') diff --git a/media/libmediaplayerservice/Android.mk b/media/libmediaplayerservice/Android.mk index 2c4e719..ce04505 100644 --- a/media/libmediaplayerservice/Android.mk +++ b/media/libmediaplayerservice/Android.mk @@ -33,6 +33,7 @@ LOCAL_SHARED_LIBRARIES := \ libdl \ libgui \ libmedia \ + libmediautils \ libsonivox \ libstagefright \ libstagefright_foundation \ diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp index 891a9e9..3e2d967 100644 --- a/media/libmediaplayerservice/MediaPlayerService.cpp +++ b/media/libmediaplayerservice/MediaPlayerService.cpp @@ -34,7 +34,6 @@ #include -#include #include #include #include @@ -60,6 +59,7 @@ #include #include #include +#include #include @@ -287,17 +287,9 @@ MediaPlayerService::MediaPlayerService() // reset battery stats // if the mediaserver has crashed, battery stats could be left // in bad state, reset the state upon service start. - const sp sm(defaultServiceManager()); - if (sm != NULL) { - const String16 name("batterystats"); - // use checkService() to avoid blocking if service is not up yet - sp batteryStats = - interface_cast(sm->checkService(name)); - if (batteryStats != NULL) { - batteryStats->noteResetVideo(); - batteryStats->noteResetAudio(); - } - } + BatteryNotifier& notifier(BatteryNotifier::getInstance()); + notifier.noteResetVideo(); + notifier.noteResetAudio(); MediaPlayerFactory::registerBuiltinFactories(); } -- cgit v1.1