* changes:
UsbManager: Hide APIs not needed for USB host or accessory support.
Remove MtpClient class from framework and public API
UsbDevice: Move IO related methods to new UsbDeviceConnection class
After reviewing this class I decided it would be best not to include it in the public API
since it adds no functionality that cannot be done using MtpDevice and other APIs directly.
So I am moving it to the CameraBrowser sample instead.
Also changed CameraBrowser to build against the SDK to ensure all the necessary APIs for
PTP support have been made public.
Bug: 4067029
Change-Id: I585b06104084953176d018ced08bba0cb4607490
Signed-off-by: Mike Lockwood <lockwood@android.com>
UsbDevice is now just an immutable parcelable object like UsbInterface and
UsbEndpoint.
All IO related functionality is now contained in UsbDeviceConnection
and UsbRequest.
Bug: 4067029
Change-Id: Ia84da0b512a697acc940eee0c3566711c62e1a68
Signed-off-by: Mike Lockwood <lockwood@android.com>
Modifies Stagefright to verify that there is a hardware-protected path
to video sink for DRM content.
Change-Id: I18b8741390e803a05a88c7f180b860a24ba88a10
* changes:
MTP: Convert date created and modified values from seconds to milliseconds
Update USB accessory compatibility library to support new requestPermission API
UsbService: Don't require permissions for UsbManager.getCurrentAccessory()
New APIs:
UsbManager.hasPermission returns true if the caller has permission
for the given device or accessory
UsbManager.requestPermission poses a dialog to allow the user to give the caller
permission for the device or accessory.
Result is returned via a PendingIntent.
No dialog is displayed if the caller already has permission.
Also moved UsbResolverActivity to SystemUI package
BUG: 4069037
Change-Id: I93be769501a8776b49ac26e468af19f8fa2114c9
This change fixes the stability problems experienced when using
a bluetooth headset supporting both A2DP and SCO. Problems occur
when starting the video chat at which time the A2DP output is being
stopped to start SCO. At that time, active AudioTracks are invalidated
by AudioFlinger so that a new AudioTrack binder interface can be
recreated by the client process on the new mixer thread with correct parameters.
The problem was that the process to restore the binder interface was not
protected against concurrent requests which caused 2 binder interfaces
to be created sometimes. This could lead to permanent client deadlock
if one of the client threads was waiting for a condition of the first
created binder interface while the second one was created (as the AudioFlinger
would only signal conditions on the last one created).
This concurrent request situation is more likely to happen when a client
uses the JAVA AudioTrack as the JNI implementation uses simultaneously the
native AudioTrack callback and write push mechanisms. By doing so, the code
that checks if the binder interface should be restored (in obtainBuffer()) is
much more likely to be called concurrently from two different threads.
The fix consists in protecting the critical binder interface restore phase
with a flag in the AudioTrack control block. The first thread acting upon the binder
interface restore request will raise the flag and the second thread will just wait for
a condition to be signaled when the restore process is complete.
Also protected all accesses to the AudioTrack control block by a mutex to prevent
access while the track is being destroyed and restored. If a mutex cannot be held
(e.g because we call a callback function), acquire a strong reference on the IAudioTrack
to prevent its destruction while the cblk is being accessed.
Modified AudioTrack JNI to use GetByteArrayElements() instead of
GetPrimitiveArrayCritical() when writing audio buffers. Entering a critical section would
cause the JNI to abort if a mediaserver crash occurs during a write due to the AudioSystem
callback being called during the critical section when media server process restarts.
Anyway with current JNI implementation, either versions do not copy data most of the times
and the criticial version does not guaranty no data copy.
The same modifications have been made to AudioRecord.
Change-Id: Idc5aa711a04c3eee180cdd03f44fe17f3c4dcb52
Use a death handler when audio focus changes are caused by audio
mode changes.
The bug comes from the fact that audio focus clients that use the
audio mode for automatic focus handling didn't register a death
handler, which was set to null. When such a client died, this
handler was compared against the one to remove from the
audio focus stack, which resulted in an NPE.
The fix consists in registering a valid IBinder object in the
audio focus stack, even for clients whose focus requests originate
from a change in audio mode, as implemented in the
handleFocusForCalls() method.
Change-Id: Id9e1d3d10afcd99969285f6d60fc4d7dde1e4a10
sqlite3 is overkill for what we are doing here, and more fragile.
BUG: 3512856
Change-Id: I83d86127949d894a3887db3456d91b013060e852
Signed-off-by: Mike Lockwood <lockwood@android.com>
For some mp3 files, the mode can be changed from one audio frame to another. Without
the capability to switch modes, the decoded audio may have lots of artifacts.
bug - 3253310
Change-Id: Id57bb1f204642d15e38a800c72214f6794cfaa37
- To track the currently used audio device
- The devices are separated as speaker and other audio devices
- Provide the collected data to battery application through pullBatteryData()
Change-Id: I374c755266b5ac6b1c6c630400f4daf901ea8acc
Make sure that NumberEffectsEnabled is decremented at the same time as
SamplesToExitCountBb reaches 0 in Effect_process(). Not doing so
causes NumberEffectsEnabled not being decremented if Effect_setEnabled()
is called after SamplesToExitCountBb reaches 0 and before next Effect_process() is called.
Change-Id: Id827a301f93a5a09ecd9995a0c7d731ef526711a