Depending on timing a race is possible between two
binder threads that will eventually try to disconnect
the camera device. The first is a regular disconnect call
and the second a binderDied notification in case the
connection terminates before disconnect is able to complete.
Avoid possible instabilities and skip flushing in case the
device is no longer initialized.
Bug: 116514106
Test: Camera CTS
Change-Id: I1a958b2f80d872de89275555e83ac32576cc6792
There is a suspicion that dumping HAL state for a recently closed
input stream can hang forever, blocking audioflinger and stucking
system boot.
In order to verify, we disable this dumping to see if it would
help with presubmit bots.
Bug: 116211629
Test: see steps in b/116211629#9
Change-Id: I189461187a2310c213278cc2b3af2469d1896965
* False positive static analyzer Warnings:
AString.cpp:134:11: Potential memory leak [clang-analyzer-unix.Malloc]
Potential leak of memory pointed to by '___res.mData' in calls to CHECK_LT(start, mSize)
* Simplify AString::clear to work with clang static analyzer.
* Simplify CHECK_OP macros to reduce copying of ___res.
Test: make with WITH_TIDY=1
Change-Id: I7fde7d4d932b37609893eb6f5c529d6727b0da7e
Could see a large block of items expire, which were all done under a
mutex. This blocks other media requests as well as causing long latency
for the current request. Change expiration so we do at most 50 at a
time, so the current thread can respond to its client. If more are due to expire,
fork a separate thread to continue in similar 50-element bursts,
allowing other clients insertion requests to enter between those bursts.
Bug: 109850816
Test: with shorter timeout and limits
Change-Id: I774a0a1bb7fbb81e12b14c540557d23fb055e3f1
Add FALLTHROUGH_INTENDED for clang compiler.
Bug: 112564944
Test: build with global -Wimplicit-fallthrough.
Change-Id: Ibf9aa0c2bf6ca13dbe96662061cb26b66e9e10d6
Add FALLTHROUGH_INTENDED for clang compiler.
Bug: 112564944
Test: build with global -Wimplicit-fallthrough.
Change-Id: I42918227a55029f46362d448c496012de9ad3670
The retroactive dump outputs historical snapshots of data that
correspond to important NBLog Events at the time they were read.
The standard printing format added is as follows: for each line, the
first column is the NBLog Event as a string, and the following columns
correspond to each field of the struct, or the type, that the NBLog
Event maps to. All columns are separated by commas.
Other changes:
Added option to Reader::getSnapshot() for flushing the buffer. This
makes it possible to always read the full buffer contents when doing a
dump of the raw log contents.
Test: dumpsys media.log with -r and --retro options
Bug: 68148948
Change-Id: I4bbbf6e2f9a3a86fae976986ac35a7eef79520de
-- Move deserialization traits classes into the .cpp file;
-- Use unique_ptr for managing libxml objects lifetime;
-- Define node and attribute names inline. This makes them
inlined in the code, but that's OK since they are typically
only used once.
-- Avoid using reference types for "out" parameters.
-- Check the status of deserializing collections.
-- Misc renamings and generalizations for clarity.
Test: Compare dumpsys media.audio_policy A/B, check audio
Change-Id: Ib188964dee94acbccd701a58d45d3df206487d81