- Trigger audio power usage logging when
1. endAudioIntervalGroup event for track/record
2. setMode to NORMAL for telephony
- Aggregate audio usage by type and device
- Send audiousage data every 24hrs by default, using property
persist.media.audio_power_metrics.interval_hr to config the interval
- Add property persist.media.audio_power_metrics.disable to disable
audio power metrics
Bug: 121318157
Bug: 140909217
Test: atest mediametrics_tests
Test: adb shell dumpsys media.metrics --all
Change-Id: I94ff00a5609a49c96a14827d3260d481c1310abe
Signed-off-by: Robert Lee <lerobert@google.com>
Compute summary statistics based on the current device
rather than the entire AudioTrack or AudioRecord duration.
Test: adb shell dumpsys media.metrics
Bug: 149850236
Change-Id: Ia3a5707c43c4530f5a6ac90f52901bd2e0bd0bab
And also to AudioRecord.
Then log the callerName using MediaMetrics from the destructor.
This can be used to tell whether AAudio or OpenSL ES
or Java created the object.
Bug: 154543374
Test: adb shell dumpsys media.metrics --clear
Test: Run an app that uses audio.
Test: adb shell dumpsys media.metrics
Test: Look for "callerName" in the dump.
Change-Id: I000346e72f581d2e40ef4fd0410b579d2a1224e2
Log events from service.
Log start, stop, disconnect and other events.
Log underruns and bufferSize.
Bug: 154543374
Test: adb shell dumpsys media.metrics --clear
Test: run an app that uses MMAP, like OboeTester
Test: adb shell dumpsys media.metrics
Test: Expect to see lots of "audio.stream" events.
Change-Id: I690e5226b695d53d038d644f4438c759e08f9fbb
The duplicate log allowed suffix ! (e.g. "event!") looked more like
"not equals" so changing from ! to #.
Test: adb shell dumpsys media.metrics
Bug: 138583596
Change-Id: I642334770ed8f5ff0d1f1e187e25eca596603252
Remove extraneous right brace in Time Machine dump.
Do not suppress repeated EVENT properties in the Time Machine.
Use "--" prefix instead of "-" for long dumpsys argv options.
Test: atest mediametrics_tests
Test: adb shell dumpsys media.metrics
Bug: 138583596
Change-Id: I874be909ac08641b14dd12fb2c83de7a276a1796
Previously, it assumed that the user had included other header files.
Now you can use it on its own, which is important for an API ("include
what you use").
Test: builds OK
Change-Id: Ib64eec20576dcf5a5dffe1ed670465cb590ef9e3
As the dumpsys no longer needs to be parseable by a program
convert to a more human readable form.
1) Make default time REALTIME consistently.
2) Dump time as a human readable string.
3) Remove dumpsys versioning code.
4) Delimiter changes.
Test: atest mediametrics_tests
Test: adb shell dumpsys media.metrics
Bug: 138583596
Change-Id: I6ee7d81a18e0e220b258c722d232c05805118abb
Factor out common analytics code from audio specifics.
Allow for saving and clearing analytics state if audioserver crashes.
Test: atest mediametrics_tests
Test: instrumented check on audioserver restart
Bug: 138583596
Change-Id: I1073f3ef95f44a383a7f14b0c2ea6f978a84ee24
This is a helper which assists logging on exit of a method.
Test: atest mediametrics_tests
Bug: 138583596
Change-Id: I73c0e7e469dc9fd1b29934ef308f9d2f15146bec
Move methods into Prop class.
Use const for getters.
Test: mediametrics_tests and dumpsys media.metrics
Change-Id: I76cdcce4f966ce74c44d4db019b4ce0096e567de
Remove the unused session id to improve speed and clarity.
Test: dumpsys media.metrics sanity, mediametrics_tests
Change-Id: Ide5e9218811e110997fed19f43eb6a5fdc5812ec
C interface is more stable across upgrades than C++
and simplifies cross-package interfaces in upgradeable components.
Bug: 119675363
Test: parallel metrics generation from nuplayer
Change-Id: I36beeade82a208be64af0860eb6f175a2801b27f
the 'finalized' concept didn't pan out -- remove references to it.
Simplifies the code flow.
Also purged some uses of generateSessionID().
Bug: 71874686
Test: logcat/dumpsys
Change-Id: I39e48526a5696158d8195f47154881ca6ecda266
change from AString to std::string for how media.metrics handles
strings. This severs the dependency on libstagefright_foundation,
where AString is implemented, so we can integrate into places
which do not want to introduce a dependency on libstagefright_foundation.
Bug: 70805723
Test: compilation/linking, CTS subset
Change-Id: I66de971b6ec354444e06112607a2d7614084cef8
Change scope of locking to avoid a window of vulnerability on queue
manipulation and item merging. Also cleans up a string manipulation
error exposed by the poc for the queue bug.
Bug: 68015343
Test: repeated running of PoC without crash
Change-Id: Iafa82936e6ec2e25793187e0fa17c2a23085f58f
Add code to use binder's linkToDeath() so that our clients learn when
(infrequently, we hope) the media.metrics service dies for some
reason. When this happens, arrange for the client to re-establish
its connection to the service.
Bug: 66948389
Test: kill media.metrics, watch logcat for reestablishment messages
Change-Id: Ic518b955ce6816698b21e6a9c844587cef2e2712
Enhances the media.metrics subsystem to track the pkg name & version
so analysis can move from "error rate has climbed" to "error rate has
climbed within app X".
Changes include fields to hold package name/version, the dump protocol
to emit those fields to upload, and better management of metrics data on
device (time and quantity).
Bug: 65027506
Test: review output of dumpsys media.metrics
Change-Id: Ia55b859d903835c84f7d43883f959dc1cdefb081
Changes for the new HAL structure have brought about a build time
circular dependency between libmedia and libmediadrm. This set of
changes the media metrics code into its own library and arranges
for the relevant consumers of the media metrics code to link
to this new library (where they had previously picked it up by
including libmedia).
Bug: 36990807
Test: build, boot.
Change-Id: I81768eecca88d5e59e6e6e547f29308a94e30c7b