It's possible that the following sequence happens:
1) hwbinder / binder thread T1: onResultReceived() starts -> promotes wp<CameraDevice> to sp<>;
2) Some other app thread T2 : ACameraDevice_close() -> delete ACameraDevice -> doesn't result in
CameraDevice's destructor running since mCameraDevice has another live
reference, app destroys some object O1.
3) T3 (callback looper thread): callback is received since looper is still running which accesses
dead app object O1 -> results in undefined behavior.
4) T1: onResultReceived completes and CameraDevice is destructed
We need to stop CameraDevice's looper thread (that waits for all callbacks queued to complete) in
~ACameraDevice() so we receive no callbacks after ACameraDevice is closed.
Bug: 135641415
Test: CTS native tests: no new failures
Test: AImageReaderVendorTest; enroll; while(1) auth;
Change-Id: Ia24de753f6ee409d941fff39616f09df2164880a
Merged-In: Ia24de753f6ee409d941fff39616f09df2164880a
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
(cherry picked from commit 174084011c)
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
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
OmxInfoBuilder would only add kFlagIsHardwareAccelerated to attr if
attribute::software-code exists in the node attributes
This change inverts this logic
Author: Michael Gonzalez <michgonz@codeaurora.org>
CRs-Fixed: 2430504
Bug: 132939417
Change-Id: I9813098c062732b2a992350d72d59e52fd67292b
Make sure 'jpeg_destroy_compress()' is always called
before leaving 'encodeGrayscaleJpeg()'.
Additionally fix misspelling of 'intrinsic'.
Bug: 135622974
Test: atest
cts/tests/camera/src/android/hardware/camera2/cts/StillCaptureTest.java#testDynamicDepth
--generate-baseline=12
Change-Id: I55c1f86881ba05aac6aac6981df5fcb276c9d4da
Do not interrupt apps when the system is slowed down transiently.
Bug: 134707995
Test: builds
Merged-In: I2cc946a5e3d66f64886954bb82e01dd5c72c0ffa
Change-Id: I2cc946a5e3d66f64886954bb82e01dd5c72c0ffa
This makes commit e3c87346e8 opt-in.
Also reworked this to do this on the looper vs the calling process to
avoid any race conditions.
Bug: 135390389
Change-Id: I9df20f1e60f0bd4ac4f8d8e7b5f02919b170682e
mLock and mDisconnect lock order interleaving,
which has potential risk of deadlock if other code locks/unlocks them in a different order.
Bug: 135211710
Test: (1) android.hardware.camera2.cts.FastBasicsTest#testCamera1
(2) android.media.cts.MediaPlayerFlakyNetworkTest
Change-Id: I9486f2c6780c2f246786299a3d6c7c2f7295b768
The fd cloned near the beginning of C2OMXNode::emptyBuffer
should last until this function goes out of scope, but we
are seeing the fd becomes invalid during this process.
This causes a crash during Component::queue when we try
to clone from this fd again.
Use unique_fd to guard most of the life span of this fd in
hope to catch the offender.
bug: 133254412
test: camera recording; cts VideoEncoderTest;EncodeDecodeTest.
Change-Id: I4bd7398c069e58915303bbc0f58b1471c2755e31
Migrate graphic buffers during surface change in order to avoid
BufferQueue handling complexity later on.
Test: Manually using Chrome and google photo app
Bug: 132302078
Bug: 130862880
Change-Id: Ifb348b5d6a8f5a89dcc10a9f0be075057a5d3a6d
Set voice volume to 0 when SCO volume index is 0 to
allow muting RX audio. when index is not 0, voice volume
is set to max to allow volume control by headset as before.
Bug: 111195322
Test: check call volume with SCO headset
Change-Id: I90466b01a9899929cd3e6fb1ac0a4985099497fc
Close a stream at the same time the callback
is trying to stop the stream. This replicates
a hang that was detected in SynthMark.
Bug: 134963902
Test: this is a test
Change-Id: I7c87ecfefa2498fd1f4f9a1e406118c42a78545b
Unlock and lock around the join() because the callback
thread that we are joining may be blocked by the lock.
Check for DISCONNECTED state so the error callback is
also joined correctly.
Remove unnecessary waitForStateChange that could cause
a timeout delay on DISCONNECT.
Bug: 134963902
Test: test_stop_hang (see bug report)
Change-Id: I5080fa655da35b3221234a2bcafb6ccd71d3ca27
Try to fail with error instead of crashing when the input buffer
handle to TWOmxNode::emptyBuffer is invalid. Save an unnecessary
handle clone, and let the convertTo to GraphicBuffer do the clone.
If the clone fails, return with error.
bug: 133254412
test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Change-Id: I6abb5526d8df1e57b70c96f5b32d132e4a5de389
Change-Id: If5ca8fae449a3cdf790c967add3713ad73369f03
Enable audio capture by the Assistant when RTT is ON during a call
similarly to when an accessibility service is in the foreground.
Also remove log when permission checked for hotword
and audio output capture fail as those checks are now done
systematically.
Also do not check permission to bypass interruption policy if
bypass flags are not set.
Bug: 132976361
Test: use voice input during a call with RTT enabled.
Change-Id: Iff45b0816dac889262ec29ea115f74dea4dc6b6d
If format doesn't contain CSD, then look for it when writing sample
data.
When CSD is present in both Format and sample data, the one in format
is used like MPEG4Writer.
Bug: 131747486
Bug: 134509194
Test: poc from bug
Change-Id: If2cab79d540688283afb4d74a6b043ea2e089ef0
With the new dataSpace/format override logic, during
finishConfiguration, we shouldn't check mDataSpaceOverride flag anymore
because now mDataSpaceOverride will be true for reconfigure.
Instead, we should check if the new override is the same as old
override.
Test: testPrepare on HAL device with dataSpace override
Bug: 134800141
Change-Id: I1ddc258100dfd7e3c2cc86f9e476d8d52c710e3f
[Context]
When a LOOPBACK dynamic audio policy mix PLAYER/RECORDER
is registered, first the REMOTE_SUBMIX device that will be
used by the app to capture/play respectively is activated.
Eg a mix RECORDER (used to inject audio to apps recording),
when registered will activate an OUT_REMOTE_SUBMIX.
Then the app can open a record/playback track on this
REMOTE_SUBMIX, which will trigger the other end of the pipe
to be activated.
Following this the playback/Record Tracks that match the
mix will be routed to the IN/OUT REMOTE_SUBMIX.
[Example for an app FUU]
1) App FUU register Playback/record mix
2) APM activates out/in remote submix
3) App FUU opens track to out/in remote submix
4) APM activates in/out remote submix
5) tracks matching mix are redirected to the out/in remote submix
When an OUT_REMOTE_SUBMIX is activated, it tries to check if it matches
a mix, if it does, it saves the output in the mix (in mOutput).
This output is then used to find a matching mix output in
getOutputForAttr(). If a mix has no output is is considered inactive.
Note that IN_REMOTE_SUBMIX do not save their input in the mix, the
input is queried by APM each time in its mAvailableInputDevices.
[Issue]
The issue is that in step (2), when an OUT_REMOTE_SUBMIX is
activated (thus for a MIX_TYPE_RECORDERS), no mix is matched because the
mix is of type IN_REMOTE_SUBMIX as it will be used to route AudioTracks
in step (5).
Thus no mix output is found in getOutputForAttr and the step (3) fails.
This is a recent regression as previously the type was not checked when
looking up for a mix in step (1).
The Change-Id of the patch that caused the regression is:
I4dc7f23bef19a7d47afc2998102da07dde41fbca, its sha1 is:
679172768d
[Workaround]
For now, given the release timing, implement a minimal fix that restore
the previous behavior for the OUT_REMOTE_SUBMIX output save lookup.
Aka, make sure to query for a IN_REMOTE_SUBMIX mix in step (2).
Step (4) is fine as the mix type is the same as the REMOTE_SUBMIX type.
As IN_REMOTE_SUBMIX do not attempt to save their output in the mix, no
issue is present on this code path.
A proper fix needs to be implemented on master, preferably by having the
same device save behaviour on both mix type.
Bug: 134068143
Test: Wifi calling call screening
Test: atest AudioPlaybackCaptureTest AudioHostTest
Change-Id: I1547948ae412dbdeb2d85cc62bf18f7ac5f1efc0
Signed-off-by: Kevin Rocard <krocard@google.com>
libhidltransport symbols are being moved into libhidlbase in order to
optimize linking/memory usage. libhidltransport will no longer be
required in the future (however removing references to it will come
separately).
Bug: 134961554
Test: boot
Change-Id: Ie8b9b03a53ae1f5672ce2565550768b4bcd321ee
Added mDisconnectLock to seperate it from mLock, used for protecting
mDataSource, mHttpSource and mDisconnected in order that disconnect()
won't be blocked by mLock.
Bug: 133900877
Test: android.media.cts.MediaPlayerFlakyNetworkTest
Change-Id: I15693c0a61f898aad4035d0fa55c8af25de4fc96
am: 537bb11d8d -s ours
am skip reason: change_id I33f476d94baec2feffc7bcccd0ad0481b8452518 with SHA1 9a44849c88 is in history
Change-Id: I7d942708538a3dff8a677b823a4dd8aa7dbad56c