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>
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