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
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
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
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
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