diff options
author | Gloria Wang <gwang@google.com> | 2011-02-24 14:51:45 -0800 |
---|---|---|
committer | Gloria Wang <gwang@google.com> | 2011-03-02 16:53:24 -0800 |
commit | 9b3f1521b521fd7248632fed71a81423e479a523 (patch) | |
tree | 0d441152de3df130c3334494289badb20b65d857 /media/libmediaplayerservice/MediaPlayerService.h | |
parent | 0528bc77948e49bd75cfd4082fb8fef3a7238626 (diff) | |
download | frameworks_base-9b3f1521b521fd7248632fed71a81423e479a523.zip frameworks_base-9b3f1521b521fd7248632fed71a81423e479a523.tar.gz frameworks_base-9b3f1521b521fd7248632fed71a81423e479a523.tar.bz2 |
- To track the usage of all audio output devices
- To track the currently used audio device
- The devices are separated as speaker and other audio devices
- Provide the collected data to battery application through pullBatteryData()
Change-Id: I374c755266b5ac6b1c6c630400f4daf901ea8acc
Diffstat (limited to 'media/libmediaplayerservice/MediaPlayerService.h')
-rw-r--r-- | media/libmediaplayerservice/MediaPlayerService.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/MediaPlayerService.h b/media/libmediaplayerservice/MediaPlayerService.h index 1175ed0..ff6ccf5 100644 --- a/media/libmediaplayerservice/MediaPlayerService.h +++ b/media/libmediaplayerservice/MediaPlayerService.h @@ -225,6 +225,25 @@ public: }; KeyedVector<int, BatteryUsageInfo> mBatteryData; + enum { + SPEAKER, + OTHER_AUDIO_DEVICE, + SPEAKER_AND_OTHER, + NUM_AUDIO_DEVICES + }; + + struct BatteryAudioFlingerUsageInfo { + int refCount; // how many audio streams are being played + int deviceOn[NUM_AUDIO_DEVICES]; // whether the device is currently used + int32_t lastTime[NUM_AUDIO_DEVICES]; // in ms + // totalTime[]: total time of audio output devices usage + int32_t totalTime[NUM_AUDIO_DEVICES]; // in ms + }; + + // This varialble is used to record the usage of audio output device + // for battery app + BatteryAudioFlingerUsageInfo mBatteryAudio; + // Collect info of the codec usage from media player and media recorder virtual void addBatteryData(uint32_t params); // API for the Battery app to pull the data of codecs usage |