Because callbacks are called from a looper thread, if the subscriber
unsubscribes and frees the callback, invalid memory access may occur from the
looper thread.
Address this by draining all pending callbacks at the time of listener
unregistration.
NOTE: There is rare chance that the wait on the condition times out,
still resulting in the original NPE issue. We intensionally allow that
to avoid deadlock, in case the application uses the same mutex lock for
callbacks and unregister functions.
Test: for i in {1..10}; do atest -it NativeImageReaderTest; done
Test: ACameraNdkVendorTest
Bug: 148976953
Change-Id: I92f5a02a4e3e63f2e72e8043ff4f4ac16c1eec5d
Duplicating outputs do not have an associated IOProfile and
getPolicyAudioPort() returns null.
Add a method to AudioIODescriptorInterface to query if the
input or output descriptor corresponds to MMAP IO profile or not.
Bug: 153849965
Test: repro steps in the bug
Change-Id: I300356880198f1785e3a5e1359ffd393c6ae4190
Scenario: startAudioSource (SW bridge) started, then stopped.
AF patch is released, so PlaybackThread has empty patch.
Next playback using the same sink will not recreate any patch
on AF as same device (and output desc has still valid patch handle)
Hence, ioconfichanged will get PORT NONE as sink device, no
onAudioDeviceUpdate cb can be fired.
This CL fixes this issue by reset of patch handle on the output
Bug: 136121584
Test: startAudioSource / stopAudioSource then playback on the same
sink. Ensure onAudioDeviceUpdate is fired
Test: atest RoutingTest
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
Change-Id: Ia9c2570f687166f38335ed7efae28920f7acc474
mDistortionMappers are used in callback thread and request thread.
However, callback thread does not query before calling mDistortionMappers[mId.c_str()],
this may cause insertion to the map and mDistortionMappers.find may run at the same time.
Bug: 153506800, 153457587
Test: Camera CTS
Change-Id: I899033bacd355113fbad3e8f7ec76482aa147158
With b/152655547, all aidl_interface modules are considered as stable
unless it is explicitly with "unstable: true". This change marks the
aidl_interface that are not used across updatable module bounraries
as unstable, so that the build system does not run the API
dumping/checking on them.
Bug: 152655547
Test: m
Change-Id: I5597f7d3fa0e2196dbfcf7ab9a33c71c15a33806
The internals of AData do exactly the type casting that upsets CFI
sanitizers, so disable CFI for those routines.
Bug: 153739236
Test: atest sf_foundation_test
Change-Id: I69ac7f064a8d3c874d7587598b450af657c4ba59
Add error checks for invalid number of coupled streams and channel
mapping values
Bug: 148771305
Test: test in bug
Change-Id: I0d8fcbaa514dfe55a94246f8f847be9a14be7a60
Instead of assuming stride to be a multiple of 64, use the value
returned by graphic view.
These codecs require chroma stride to be half of luma, hence the luma stride
should be a multiple of 32. Hence request for stride that is multiple of
32, then use returned stride.
This is needed where allcoated buffer has a stride that is multiple of
128.
Test: atest android.media.cts.DecoderTest
Test: Test decoding clips with dimensions that are not multiples of 16
Bug: 144190181
Change-Id: I08912396e495326fca787e8ae0b47256505210ca
Merged-In: I08912396e495326fca787e8ae0b47256505210ca
In order to support signalling lower levels, default dimensions
and frame rate are set to smaller values, such that minimum level
calculations done with default values still stay at lowest level
supported
Bug: 149360064
Bug: 151423508
Test: atest android.media.cts.MediaRecorderTest#\
testProfileAvcBaselineLevel1
Change-Id: Ic86e5d728d99652ea4e4a46df4f46b3ff3b357ac
Merged-In: Ic86e5d728d99652ea4e4a46df4f46b3ff3b357ac
This fixes a rebase issue between f72774b and 2a24a30.
Bug: 153120636
Test: Manually run ARC c2 e2e test app
Change-Id: I68987ff27f43380e7ad149c2776830219c42dba9
Only the primary HAL has to support mic mute function.
Ignore errors returned by other HALs in setMicMute() and
only report mic mute state from primary HAL in getMicMute().
Bug: 153103117
Test: CTS AudioManagerTest.testMicrophoneMute
Test: manual phone call and verify microphone mute.
Change-Id: Ic121c49e7e7cd75eeee9342249271c7fca7c1c2a
Without trunksize as restriction, function parseClearEncryptedSized()
can read the rest of file. If the file has a large number of saiz trunk,
large number of bytes will be copied, which can lead to high cost of
CPU time.
Bug: 124777526
Test: please see #3 and #8 in b/124777526: push senc.mp4 to devices's
sdcard, play with photo app, manuly print log. Also need to verify if
Dexter app (b/152531488) not crash.
Change-Id: I87f215cf04c5d002076e145f21c10556773f4bb2
If there is an issue where this is not loaded, we should know.
Bug: 146059841
Test: boot health check on devices
Change-Id: I3c50078b254e3caff5c824024909cb722dfb1aae
The old minimum was zero, which minimized latency
but was probably too aggressive for some devices.
It is better to avoid glitches.
Because of other changes in AAudio MMAP, this will
have the same latency as earlier version,
but better immunity from glitches.
Bug: 153589709
Test: launch OboeTester
Test: tap TEST OUTPUT
Test: tap OPEN and START
Test: notice that actual buffer size will be 1 * burstSize
Change-Id: Ie53352a0589c710be11f74e995bd12be4f7c45a8
Since the error callback ends up calling into Java,
there is a potential for a deadlock with Java code
that takes AudioSystem.class lock and calls into
native code that takes gLock in its own turn.
Bug: 152819012
Test: use audio on a phone, also
killing native audioserver while watching YT,
also while making cellular calls
Change-Id: Ib288ba96ae2f7b5ab36c1b0a1db4adde487d6a49
Camera metadata entries can become invalid
after updates. Avoid using the possibly
released entry pointer when extending
camera characteristics with dynamic depth
tags.
Additionally simplify rotate and crop
region checks.
Bug: 152240541
Test: cameraservice_test
Change-Id: I416739ed7e128f4ec94353ec2938b9bf226be182
add an interface to accept a list of additional policy files, instead of just a single file.
Also add TEST_MAPPING for presubmit.
Bug: 147914640
Test: boot with empty, 1, and 2 element lists, atest
Change-Id: I97e8e0ec7b68699838595c09a4a8e7c7eef657c3
Merged-In: I97e8e0ec7b68699838595c09a4a8e7c7eef657c3
(cherry picked from commit 11c1a68778c39564ed37e653d7af6881a2d11ea6)