in addition to the time-based expiration, enable count based expiration
and set it to 2000 records, about 5x the daily average. Caps the memory
footprint.
Bug: 135552978
Test: boot, enough traffic to force expirations
Change-Id: Ide96df24b00e8f115905678800c782f29a91bcba
take the collected media.metrics (as they arrive) and push a copy over
to statsd, the statistics logging subsystem.
gather data, wrap in protobufs apppropriately, and submit it to statsd.
Bug: 118782504
Test: statsd's test_drive app
Change-Id: Ieb82c43633851075e9eaf65d2a95c8cba87441ea
change from a blanket 'using namespace...' directive to a more
explicit qualification on the entities that prompted adding the using in
the first place.
Bug: 128606338
Test: compilation
Change-Id: Id8c8cfcd18801661b82b73d1c59952d1e75d3c7d
IMPORTANT NOTE:
CL depends on another CL in frameworks/base
https://partner-android-review.googlesource.com/c/platform/frameworks/base/+/1206275
AudioProductStrategies offers the possibility to dynamically
translate attributes to stream types (and vice versa) within
audio policy engine.
Legacy engine has hard coded rules to maintain the translation
service.
This patch removes the hardcoded translation within the helper
and replaces them by AudioProductStrategy APIs.
Test: AudioPolicyTests: AudioProductStrategiesAllStreamsTest
It loops on all stream types supported by strategy and ensures
device selection matches. Hard coded stuff would prevent right device
selection.
Test: CTS: AudioTrackTest AudioRecordTest
Test: audio smoke test on sailfish, walleye blueline
Change-Id: I76589df5555136ed49dbacc7aac9b0b5e828bef2
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
This converts mediaserver, mediametrics and screenrecord and the
libraries they depend on to Android.bp
See build/soong/README.md for more information.
Bug: 122331945
Bug: 80410283
Test: boot blueline
Test: youtube
Test: screenrecord
Change-Id: I132b8b4f7965449df68fb1544034a7241c594a63
Could see a large block of items expire, which were all done under a
mutex. This blocks other media requests as well as causing long latency
for the current request. Change expiration so we do at most 50 at a
time, so the current thread can respond to its client. If more are due to expire,
fork a separate thread to continue in similar 50-element bursts,
allowing other clients insertion requests to enter between those bursts.
Bug: 109850816
Test: with shorter timeout and limits
Change-Id: I774a0a1bb7fbb81e12b14c540557d23fb055e3f1
This commit removes includes that don't appear to be needed.
Test: build
Bug: 111055375
Merged-In: I72465d0af56e408c5e99c1fd304bf2e7ff6d9f83
Change-Id: I72465d0af56e408c5e99c1fd304bf2e7ff6d9f83
(cherry picked from commit c1a30c4d8a)
new fields in the media metrics 'audiorecord' record for more detail
length of time recorded, error conditions
add new media metrics type 'audiopolicy' that describes attempts to get
microphone access -- success, failure on contention, what type of access
was requested, and (important for the contention) which programs are
doing the requesting and holding of the microphones.
whitelist the 'audiopolicy' metrics type with the media.metrics service.
Bug: 78595399
Test: concurrent/serial recordings, dumpsys media.metrics
Change-Id: Ia17860940d4c329b0215b4cf97c6dacacb6a8e32
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
allow some more metrics through that are now being generated from
app-side contexts instead of within media services.
Bug: 71874383
Test: logcat/dumpsys
Remove the code from media metrics that provided a summarization
capability. It wasn't providing the information we wanted and
consumed more system RAM while being unhelpful. If we figure out
a better way to do this, we'll re-implement.
Bug: 71874635
Test: manual
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
makes sure that using "-proto #" option for dumpsys of the metrics
service doesn't leave the protocol set there; we want it to come
back to the defined default if there is no "-proto #" on subsequent
invocations.
Bug: 69797899
Test: multiple dumpsys invocations
Re-arranged several potential UAF accesses in the handling of saved
media.metrics items. Also avoids possible 'save and immediately
delete' behavior in certain queue situations.
Bug: 69002257
Test: watched dumpsys media.metrics
Change-Id: I8ab056f14d845aa27f3e65a77bc6c7dbfac24e4f
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
The aggregation, which tries to collect info for standard deviation,
used a 64-bit counter. But with a 4GB video file, when you square the
bytecount, you quickly run up against the 64 bit limit.
So we won't be aggregating those records any longer on-device.
Bug: 66226775
Test: dumpsys media.metrics -summary, no aggregated codec lines
Change-Id: I7c8347eba3d48dfd3b26916e9eb76de1c129817f
implement policy of not uploading package info when sideloaded
or through a non-playstore channel. Include versioncode information
when we do include a particular package.
Bug: 65027506
Test: watch logs and dumpsys for various package combinations
Change-Id: I8e601c899070b57c25181ba705e997f10ea052b4
Record the profile, level, max-width, max-height and
byte counts consumed for codecs.
Do summarization of byte-counts; the other fields are
differentiators forming the different buckets.
Bug: 65297728
Bug: 65250664
Test: observe 'dumpsys media.metrics'
Change-Id: Ie5bcfe2fd70891f8deeb116897adbb1041b799c7
Privacy workgroup recommended that we blur timestamps to
further improve anonymity of metrics records.
Bug: 65539819
Test: examination of dumpsys media.metrics
Change-Id: I337a66a66df733b4ece222b5b69a5732e78a3e35
specify a group for the media.metrics service.
the unspecified default is inappropriate.
Bug: 65334712
Test: examination of /proc info for metrics
Change-Id: I0e35a2d676586216bcfee672666803b7fa5eae4d
The app package name was not previously reported in drm metrics. This
change reports the app package name as returned from the vendor metrics.
This is part of the fix. The other change will go into another project.
Bug: 64584568
Test: Unit tests, GTS tests, and Google Play.
Change-Id: Iee36d5203364c5f80a8b0fe9d9bbf5c167abefd1
better management of how summarized records are managed.
Use differentiated names for the summations to avoid confusion with
individual records. Track values appropriate to calculating
min, max, mean, and standard deviation.
Bug: 65027360
Test: examination of dumpsys media.metrics -summary
Change-Id: I40d93d8a5a7cc2c188546574f59d557088d9c1e3
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
This fixes
warning: Potential leak of memory pointed to by 'only' [clang-analyzer-unix.Malloc]
Bug: None
Test: The warning is gone.
Change-Id: I596f422c2409241a47aba381c35da0a874f38c59
ASAN tools found an instance of holding a reference to a variable that
had gone out of scope, resulting in a use-after-free.
This code changes the constructs around a little and ensures that the
reference does not outlive the variable's scope.
Re-scanned other code added at the same time, but did not find any
other similar scoping issues.
Bug: 37276863
Test: boot and execute; no ASAN re-test
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
The summarizers collet similar records and bunch them to save space.
So a string of extractor operations that crack the same format audio
will be combined into a single record with a new "count=#" attribute.
Summarizers will sum appropriately. The current example is in the
Player summarizer -- it knows to sum the frame counts and times
(duration and playing) as part of the summarization.
Bug: 36736083
Test: lots of 'dumpsys -summary' manual examination
Change-Id: I325c2d2b25720d384bcc75b73c97e5b3d8fa9731
eliminate the size of a fixed length buffer for a potentially very
long record. Code was safe in that it didn't allow an overflow, but
we really wanted the information that was being truncated.
also some cleanup on parameters for "dumpsys media.metrics":
time units for "-since" and include a -help.
Bug: 34792286 34793404
Test: invoke dumpsys with assorted parameters to see output
Change-Id: If960afd52a509f277910e62c13d4ba60f9ed7e34
reflect the change from "media.analytics" to "media.metrics" in
what service names we use; bring the metrics service main code into the
service directory (vs an additional shared library).
Removed references to tentative binder functions that the service
won't be offering, at least not in the near future.
Bug: 34615027
Test: build, boot, new services run, clients talking to said services.
Change-Id: If17772a8f03c05b142e8d5779830d198710210c1
Rework some interfaces to avoid unnecessary sp<> mechanisms;
document which side of caller/callee owns pointers afterwards.
Rework internal attribute representation, add support routines.
Bug: 33547720
Test: Boot, ran subset of CTS media tests
Change-Id: Id0d65bd6a847704dc98d38be9aa5e1ce63c20e1c