3354 Commits

Author SHA1 Message Date
Jean-Michel Trivi
c2230a9d1a am ef417bb7: am 6a64a9cd: Merge "Prevent AudioService dead lock issue."
* commit 'ef417bb7a06b0d58faa21f42599d7dd4fd9e3ff2':
  Prevent AudioService dead lock issue.
2015-01-16 17:37:29 +00:00
Jean-Michel Trivi
6a64a9cd26 Merge "Prevent AudioService dead lock issue." 2015-01-16 17:23:36 +00:00
Eric Laurent
f076db4070 AudioManager: make AudioPortEventHandler static
Make AudioPortEventHandler and audio port and patch caches
static members of AudioManager. There is only one callback
per process in AudioSystem for audio port updates
and having those non static would not work when more than
one AudioManager instance exists in one app.

Bug: 18727023.
Change-Id: I4c1041dc6441d168be4efa066e14289cc5f41872
2015-01-15 10:13:52 -08:00
Eric Laurent
4fb3b60215 AudioService: handle stream mute by stream alias
Handle stream mute/unmute requests at the stream
alias level (like is done volume changes) to be consistent.
E.g a request to mute/unmute a stream will affect all streams
sharing the same alias for volume management.

Bug: 18844550.
Change-Id: Ie2e463c58df0371589150f0ebb9b36c38b14e1be
2015-01-13 12:19:53 -08:00
seunghwan.hong
4fe7795347 Prevent AudioService dead lock issue.
Dead lock sequence:
 1. called onSetA2dpConnectionState()
  1-1. synchronized(mConnectedDevices)
 2. called onServiceDisconnected()
  2-1. synchronized(mA2DPAvrcpLock)
 3. waiting to lock(mConnectedDevices) in onServiceDisconnected()
 4. waiting to lock(mA2DPAvrcpLock) in onSetA2dpConnectionState()

========================================================================================
- watchdog issue
----- pid 3306 at 2014-10-14 16:15:12 -----
Cmd line: system_server

"main" prio=5 tid=1 MONITOR
  - waiting to lock <0x4343e9b0> (a java.util.HashMap) held by tid=46 (AudioService)
      at android.bluetooth.BluetoothA2dp$2.onServiceDisconnected(BluetoothA2dp.java:529)

"AudioService" prio=5 tid=46 MONITOR
      - waiting to lock <0x42ab7a58> (a java.lang.Object) held by tid=1 (main)
========================================================================================

Signed-off-by: Seunghwan Hong <seunghwan.hong@lge.com>

Change-Id: I99e061c07be01aabcd26786ef2ebb71f46717b93
2015-01-13 08:22:26 +09:00
Eric Laurent
695233fe83 Merge "AudioService: send connection intent for HDMI ARC device" into lmp-mr1-dev 2015-01-12 15:39:45 +00:00
Rachad
6d3cff1264 Merge "MediaCodec: Added E-AC3 mime type (@hide)." into lmp-mr1-dev 2015-01-10 01:23:35 +00:00
Lajos Molnar
7f94b52fc7 Merge "MediaCodec/Image: handle null cropRect correctly" 2015-01-10 01:12:33 +00:00
Lajos Molnar
98840f2bd2 Merge "media: add support for 160-byte image info in MediaCodec" 2015-01-10 01:10:24 +00:00
Eric Laurent
6fa4245589 AudioService: send connection intent for HDMI ARC device
Bug: 18921279.
Change-Id: I1e23b5aed7a2835feb0fea2a412f3622c01cbe55
2015-01-09 15:09:40 -08:00
John Spurlock
af84e073bc Merge "Audio Policy: Clear calling identity for all paths setting ringer mode." into lmp-mr1-dev 2014-12-24 01:16:14 +00:00
Rachad
6564f5be74 MediaCodec: Added E-AC3 mime type (@hide).
Bug: 17883772
Change-Id: I48b2ab64812d860bb1a01d0a14e10690b86c4519
2014-12-23 16:12:44 -08:00
John Spurlock
af88a19165 Audio Policy: Clear calling identity for all paths setting ringer mode.
For proper appops bookkeeping and zen setting changes.

Bug: 18832923
Change-Id: Ic029d3226458ca1a9229a0bc5726bedd5e117ad7
2014-12-23 16:14:44 -05:00
Jean-Michel Trivi
996af72b0c Merge "AudioRecord: filter attributes" into lmp-mr1-dev 2014-12-22 18:55:40 +00:00
Jean-Michel Trivi
43bcd8fa74 AudioRecord: filter attributes
When creating an AudioRecord instance, filter the tags in the
  AudioAttributes to remove tags that are handled at the Java
  layer.

Bug: 18733215
Bug: 18736417

Change-Id: I16a3497742086deced4e8677bd6231290396c5f6
2014-12-22 18:15:32 +00:00
Eric Laurent
8d24fe235a Merge "AudioService: fix permission check." into lmp-mr1-dev 2014-12-19 17:11:28 +00:00
Oliver Woodman
69fd01d3e6 Merge "MediaSessionLegacyHelper uses global Application context" into lmp-mr1-dev 2014-12-19 11:37:04 +00:00
Eric Laurent
38edfda9bd AudioService: fix permission check.
Clear caller identity before calling TelecomManager.isInCall().

Bug: 18702149.
Change-Id: Ie057f3f261fc0a36dff51840cc8390408621d3bd
2014-12-18 17:40:43 -08:00
Jean-Michel Trivi
9b5257c9c9 MediaSessionLegacyHelper uses global Application context
MediaSessionLegacyHelper used a Context passed by an application
  which can cause a leak of Activity instances. Use the global
  Application context instead.
Also prevent crash if a null Context is supplied (method not
  documented as requesting a non-null Context).

Bug 18767503

Change-Id: I8281047d0af233a323f3fc11ababedff848829ec
2014-12-18 16:42:59 -08:00
John Spurlock
57627794b6 Audio policy: Fix deprecated shouldVibrate api.
And apply zen mode immediately to avoid race conditions
in tests.

Bug: 18702149
Change-Id: Iad156a29b9e6a5998e7c2dafa8b79a71447066f9
2014-12-17 12:34:00 -05:00
Jinsuk Kim
a2bc055eeb Merge "audioservice: Clear calling identity upon calling HdmiControlService" into lmp-mr1-dev 2014-12-13 23:41:48 +00:00
Chong Zhang
bb177db1fe Merge "parse bitrate range for video/audio caps" into lmp-mr1-dev 2014-12-12 20:49:36 +00:00
Chong Zhang
216e11dcbb parse bitrate range for video/audio caps
Bug: 18684228
Change-Id: Ib5c3682bb1dfa338b99352ea040edcb99d86ef0b
2014-12-12 11:34:42 -08:00
Jinsuk Kim
48cbf292ba audioservice: Clear calling identity upon calling HdmiControlService
This makes sure that accessing the HdmiControlService via audio service
should be possible without the system permission.

Bug: 18730526
Change-Id: I05b364d8e38218eb75f3c08972a06bb2d71a982b
2014-12-13 02:22:19 +09:00
Eric Laurent
65bc1125b4 Merge "AudioSystem JNI: Add audio policy custom mixes registration" into lmp-mr1-dev 2014-12-10 01:33:09 +00:00
Michael Wright
c6de3212c2 Merge "Don't try to scale the bitmaps for null MediaMetadata." into lmp-mr1-dev 2014-12-09 23:39:50 +00:00
Jeff Sharkey
1102e712c1 Merge "Throw IOException when missing default ringtone." into lmp-mr1-dev 2014-12-09 23:34:07 +00:00
Jeff Sharkey
87d76f6a3e Throw IOException when missing default ringtone.
This is caught by Ringtone, and we then fall back to built-in
ringtone, which matches the expected CTS behavior.

Bug: 18610451
Change-Id: I234d17f7cf623b9b0af434e5d367aed28f203b14
2014-12-09 15:27:25 -08:00
Ruben Brunk
3ef5033cda Merge "Camera2: Allow rendering to arbitrary surface sizes in LEGACY mode." into lmp-mr1-dev 2014-12-09 23:09:52 +00:00
Michael Wright
f32bd3c5cd Don't try to scale the bitmaps for null MediaMetadata.
Bug: 18586572
Change-Id: I133e58eeb05136ca82cbd35840b68ebedd9ec365
2014-12-09 13:23:44 -08:00
Ruben Brunk
f4a637d0be Camera2: Allow rendering to arbitrary surface sizes in LEGACY mode.
Bug: 16030677
Change-Id: Ida04e04f41983b9126609522dd12064a7bf9645f
2014-12-09 11:56:22 -08:00
John Spurlock
795a514697 Volume: Only play the new vibrate hint once per volume-down.
Bug: 18666334
Change-Id: Idfa1d0c104bb310548fde533932bffc2b41eafff
2014-12-08 14:09:35 -05:00
Lajos Molnar
9d6fa062a5 Merge "media: fix isSupportedFormat for integer frame rate" 2014-12-08 18:02:41 +00:00
Eric Laurent
7f5eb9fe3c AudioSystem JNI: Add audio policy custom mixes registration
Bug: 16009464.

Change-Id: I3763e79f4fa0331acb56d1d6f575c7a36e0bebd5
2014-12-08 09:37:30 -08:00
Jean-Michel Trivi
8638877f14 Merge "Support collaborative audio focus handling" into lmp-mr1-dev 2014-12-07 01:14:30 +00:00
Jean-Michel Trivi
0212be5150 Support collaborative audio focus handling
Add new flag for an app to define it doesn't duck, but rather
  pauses when losing focus with AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK.
  This flag is to be used when requesting focus.
Add support for AudioPolicy to specify whether it will implement
  ducking itself, rather than it being handled by an app.
When ducking is handled by a policy, do not notify focus owners
  when they lose audio focus with LOSS_TRANSIENT_CAN_DUCK, unless
  they would have paused, as expressed with the
  AUDIOFOCUS_FLAG_PAUSES_ON_DUCKABLE_LOSS flag.
Add a focus listener for a policy to be notified of focus changes
  so it can properly implement its own ducking.

Bug 16010554

Change-Id: I11d7cdb85c52fd086128a44f4d938aaa44db5c25
2014-12-05 18:41:28 -08:00
Jeff Tinker
846e712dc7 Unhide secure stop APIs
Change-Id: If25406a6657c8f9d558e659bf5af73bac9bc434c
related-to-bug: 18053197
related-to-bug: 18076411
2014-12-05 15:44:17 -08:00
RoboErik
d386d0f391 Merge "Route mute key events through MediaSessionService" into lmp-mr1-dev 2014-12-05 23:16:41 +00:00
RoboErik
7c82ced4fc Route mute key events through MediaSessionService
This sends mute keys to the MediaSessionService and handles them
by toggling the appropriate stream. Muting remote playback is still
not supported.

bug:17501993
Change-Id: I18c5b037cde2175acbb64b118dd708514acfd8c9
2014-12-05 12:41:34 -08:00
RoboErik
f58a909113 Merge "Make setting the session token in MediaBrowserService synchronous" into lmp-mr1-dev 2014-12-05 17:57:15 +00:00
Dongwon Kang
670de6b627 Merge "TIF: increase the time threshold for tune operation which was too harsh" into lmp-mr1-dev 2014-12-05 04:08:06 +00:00
Lajos Molnar
24ffac0135 MediaCodec/Image: handle null cropRect correctly
- allow Media.Image.setCropRect(null) to unset cropRect
- use full image if cropRect is null in MediaCodec$Image

Bug: 18124320
Change-Id: I7abb6175402a1fe913e16c0a682fabee79c55741
2014-12-04 16:33:57 -08:00
Lajos Molnar
32d8cc1429 media: fix isSupportedFormat for integer frame rate
Bug: 18473065
Change-Id: I670cc043d3cb117c26921cb639ff9eecc8f14b0a
2014-12-04 16:29:30 -08:00
Lajos Molnar
cea639cf3f media: add support for 160-byte image info in MediaCodec
Some 64-bit compilers now create 160-byte image structures.

Bug: 18513091
Change-Id: I355714affaac0fde0b03578d13ab8f373dd5aa81
2014-12-04 16:28:33 -08:00
Lajos Molnar
0ca248599c media: allow full range of Vorbis sampling rates
Bug: 18615604
Change-Id: I51f0c5c81145b94626f2b7e4505b905b63a572bf
2014-12-04 16:27:39 -08:00
Dongwon Kang
c0abc9cadb TIF: increase the time threshold for tune operation which was too harsh
Bug: 18612616
Change-Id: I62ddde2f9796f3b1dd8240f5c88fbff234b3618b
2014-12-05 08:57:48 +09:00
RoboErik
fd228a383c Make setting the session token in MediaBrowserService synchronous
The MusicDemo was depending on the fact that setting the session token
is done synchronously and that getSessionToken can be called immediately
after. This makes setting the token synchronous again but leaves the
post to update any MediaBrowsers that are waiting on a connection.

This does introduce a small race condition if an app tries to set it
twice from different threads, but this is a very unlikely situation
and MediaBrowserService is not guaranteed to be thread safe.

bug:18603085
Change-Id: Id934c9f3b6520225cd92d1d8a6e2b3d606b8c6c8
2014-12-04 14:48:38 -08:00
Lajos Molnar
610e288de6 media: allow full range of Vorbis sampling rates
Bug: 18615604
Change-Id: I51f0c5c81145b94626f2b7e4505b905b63a572bf
2014-12-04 09:50:54 -08:00
Dongwon Kang
b0bbaec8be Merge "TIF: call tune() in HardwareSession" into lmp-mr1-dev 2014-12-03 02:22:12 +00:00
Michael Wright
7081a5d1ae Merge "Correctly iterate through MediaProjection callbacks." into lmp-mr1-dev 2014-12-03 01:14:22 +00:00