refactor some mutex for how nuplayer sets up mediametrics data.
expanded locking to eliminate a couple race conditions.
Bug: 151644303
Bug: 151643722
Test: poc attached to bugs
Change-Id: I75f29a6254c5eab5d4f524ee7a7ef59f93a0b405
The unparceling code for face metadata in API1 dynamically allocates
a camera_metadata structure, and a recent fix forgot to delete that
structure in an error path.
Fix this by making the metadata structure statically allocated; it's
tiny anyway.
Test: atest CtsCameraTestCases
Bug: 155512103
Change-Id: I9b81cdb3ab47c7b6c94c6ed65213ddafef529dc9
Bug: 155096545
Test: adb shell dumpsys media.audio_flinger | more
Test: then search for "Device"
Test: There should be no garbage characters on the next line.
Change-Id: I798d914cede3f45151f97178de3ceee09b4e24c0
When a new device is attached to hardware module, query the HAL to get
the supported encapsulation modes and metadata types.
Test: atest EnumDevicesTest, manually
Test: atest audiofoundation_parcelable_test
Bug: 155799506
Change-Id: I903e46e35a44416c9f2d206c128face8a6c61dcb
Spawn a thread to handle the disconnects for onRoutingChanged()
and onTearDown(). This is to prevent deadlocks when calling back into
AudioFlinger.
Bug: 155819038
Test: See bug for repro steps with OboeTester
Test: Also run TEST DISCONNECT in OboeTester. It was failing.
Test: atest CtsNativeMediaAAudioTestCases
Change-Id: I83212fea140d3b6beca9aa737606a77a7c97b007
Chromebook sometimes runs 32 and 64-bit code together.
That caused messages between the code to be rejected because the
struct sizes did not match.
So we used alignas(8) to force members to 8 byte boundaries.
Bug: 155901581
Test: Launch OboeTester
Test: Tap TEST OUTPUT
Test: Tap OPEN and START
Test: You should get "MMAP YES" if MMAP is supported by the device.
Change-Id: I0cd6a59a974888ef17b06b38fa78f032d602cd57
Do not set CTA861_3 bit if content light level
fields are 0, these may indicate that CLL is
not present in the bitstream. Let display or
compositor use default if needed.
bug: 152581483
Change-Id: I6764623130f839df83fd6f5db1b97ab768a8642d
Merged-In: I6764623130f839df83fd6f5db1b97ab768a8642d
(cherry picked from commit cbbbfab2126050a84ab9067824c3cdb62d581e83)
- 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>
Instead of storing full cipher URIs, only store partial URIs, and
construct the full URI as needed.
Bug: 124940460
Test: CTS
Change-Id: Iedf84e2f6657c0abd5a3dafaa5cabb1b6e854579
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.
For now setting min_sdk_version doesn't change build outputs.
But build-time checks will be added soon.
This is one of two parts: covers mainline-related files.
Bug: 152655956
Test: m
Change-Id: I558b2d717d6cbae920db008d1b0f3ed61958937b
Force DIRECT flag if current playback thread is direct output thread.
This can happen when the playback is re-routed to direct output stream
by dynamic audio policy.
Bug: 130296239
Test: manual
Change-Id: I24efd87f74bacf6b769d3663e9521eb27b1704e9
This interim solution satisfies requirements of performance
tests (audioserver stopped together with zygote) and
requirements of VTS tests (audio HAL keeps running when
zygote stops).
Bug: 155364397
Test: atest VtsHalAudioV6_0TargetTest
atest VtsHalAudioEffectV6_0TargetTest
Change-Id: I111f0cc397024a38e146981d1e5299ce4f6bd5e2
If outBuffer is specificed, displayStride is the stride of the
outBuffer (line 595). Then, the "Output buffer too small" check
ends up comparing a buffer's width to the buffer's own stride
which effectively requires that a buffer's width is equal to it's stride.
Bug: 155485791
Test: cts -t android.media.cts.DecoderTest
Change-Id: Ia66591f816aac0d8aad5c1b5b9a0aeff2cc80185
Merged-In: Ia66591f816aac0d8aad5c1b5b9a0aeff2cc80185
common_time and mediadrm only has OWNERS file
for now, so no TEST_MAPPING FILE is added.
Bug: 155319496
Test: atest
Change-Id: Ie4d27837a3acdc554c4c4f259ad1ed25c1088e5b
If outBuffer is specificed, displayStride is the stride of the
outBuffer (line 526 for avc and line 521 for hevc). Then, the
"Output buffer too small" check ends up comparing a buffer's width
to the buffer's own stride which effectively requires that a
buffer's width is equal to it's stride.
For android.media.cts.DecoderTest#testCodecBasicHEVC, the test
has an outBuffer with width 720 and stride 768 which fails the
check.
Bug: b/146515640
Test: cts -t android.media.cts.DecoderTest
Change-Id: I732f77445cad5390895c8e43f46d11c423c9b2e4
An app (B) that asks for an exclusive stream can steal
an exclusive stream from an earlier app (A).
App B will be given the MMAP resource as a SHARED stream.
The stream for app A will be disconnected and released
by the service.
If app A reopens a stream then it will get a SHARED
stream.
The order of the opening of the streams is controlled by using a
recursive_mutex in AAudioService::openStream().
Bug: 129846760
Test: media/libaaudio/tests/test_steal_exclusive.cpp
Test: also
Test: Launch AudioTroubleMaker. It should say "EXCLUSIVE".
Test: Press Home button.
Test: Siren sound from AudioTroubleMaker should continue.
Test: Launch OboeTester
Test: TEST OUTPUT, then Open, Start
Test: You should get an MMAP SHARED stream on Pixel.
Test: Go back to AudioTroubleMaker. It should say "SHARED".
Change-Id: I7f8339d8ed62546520a9b46ed398418b41ca2832
This test starts an exclusive stream.
Then a few seconds later it starts a second exclusive stream.
The first stream should get stolen and they should both end up
as SHARED streams.
See comment at start of test_steal_exclusive.cpp for more information.
Bug: 129846760
Test: this is a test
Test: adb shell test_steal_exclusive
Change-Id: Idff0c394ccee2310dd2d38e7715f823e50955e73
Revert "Add isUidActiveOrForeground() for camera/audio to use."
Revert "Add isUidActiveOrForeground for camera/audio to use."
Revert submission 10829580-isUidForeground
Reason for revert: In CameraService.cpp, before this change, around "am.isUidActive", there was up to 300 ms retry. After this change, the code could move forward fast without retry, but at "mAppOpsManager->startOpNoThrow" call, for the same reason as uid is not updated fast enough, "mAppOpsManager->startOpNoThrow" could also fail.
This CL does not really fix the root cause, but it changes the timing and now the code fails at "mAppOpsManager->startOpNoThrow" call.
Also the timing change may also cause recent multiple CTS test failures.
Bug: 154570809, 155032617, 154849083
Reverted Changes:
Iffed63293:Add isUidActiveOrForeground() for camera/audio to ...
I3685e0c8d:Add isUidActiveOrForeground() for camera/audio to ...
I51ed1fe78:Add isUidActiveOrForeground for camera/audio to us...
Change-Id: I8acde2524201b6c6d0d5c0ff9cfb2053ffbcb8ef