8682 Commits

Author SHA1 Message Date
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
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
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
Jean-Michel Trivi
57457b98cf Merge "AudioMix address and type, rule exclusion API, dynamic source" into lmp-mr1-dev 2014-12-02 17:09:30 +00:00
Jinsuk Kim
b4355ec3d0 Merge "audioservice: system audio control in master volume mode" into lmp-mr1-dev 2014-12-02 07:26:41 +00:00
Dongwon Kang
7cfe00f693 Merge "TIF: fix a race condition when TvInputManager is initialized" into lmp-mr1-dev 2014-12-02 07:26:07 +00:00
Sungsoo Lim
5a7445b00d Merge "Missing Javadoc update while API review" into lmp-mr1-dev 2014-12-02 03:29:10 +00:00
Dongwon Kang
993f81e238 TIF: fix a race condition when TvInputManager is initialized
Currently, TvInputManagerService notifies the initial state of each
input via TvInputManagetCallback#onInputStateChanged after TvInputManager
is created. However, this is racy because the client may call methods
like getTvInputState() before the initialization.

This patch makes sure that the client gets the control when the initialization
finishes completely.

Bug: 18419452
Change-Id: I5d8141c20984013e68f2809120710c670557c9ad
2014-12-02 09:30:57 +09:00
Zhijun He
e09dcdba71 ImageReader: free direct byte buffers once Image is returned
This can prevent apps from accessing an image byte buffer when it is closed.

Bug: 12528089
Change-Id: I04dccf1832204be2ae3aeb3bbe04f616886447e6
2014-12-01 23:57:11 +00:00
John Spurlock
21d68f4808 Merge "Volume: Improve inline volume controls used in settings." into lmp-mr1-dev 2014-12-01 17:06:14 +00:00
Jinsuk Kim
336cdb488f audioservice: system audio control in master volume mode
Volume control in master mode should be transformed to
CEC commands if system audio is activated to delegate
the control to the connected AV receiver.

Refactored to use the interface to CEC service for
both master and stream type volume control.

Bug: 18560079

Change-Id: I2aefdc94a1bc3091c14fab849f899a0dc37c47bc
2014-12-01 07:17:17 +00:00
Jean-Michel Trivi
1b3541d5ee AudioMix address and type, rule exclusion API, dynamic source
- Simplify API for defining an exclusion-based rule: don't define
  an exclusion rule, add instead a way to exclude a rule.
- API for defining rules for dynamic sources (rule match on capture
  preset).
- Verify mix type when creating AudioRecord or AudioTrack for a mix.
- Use hashcode of mix for generating the device address.
- AudioService dump prints info about registered policies.
- Annotate as SystemApi the audio policy-related APIs.
- Express mixing match and exclude rule constants as flags for
  future-proofness

Bug 16006090
Bug 16009464

Change-Id: I0dabe71204501acaffea7ef0ddbbab9700e1bd87
2014-11-30 14:33:29 -08:00
Wally Yau
da39290460 Set stream volume to max when userMasterVolume is set to true.
When useMasterVolume is set, we don't want to apply the volume
attenuation twice, once at the stream mixer and once at the master
volume control. It should only be applied once at the master volume
control.

Change-Id: Id5b1cf97571733515b5680c638f11cde8824cfc0
Fixed: b/18460548
2014-11-28 12:40:30 -08:00
John Spurlock
bcc1087af4 Volume: Improve inline volume controls used in settings.
- Make the system internal ringer mode change signal available to
   other system components via a standard intent, instead of a
   volume-controller-only binder call.
 - Update sysui to use new intent for icon policy.
 - Add proper muting state to the volumizer, to look more like
   the associated volume panel slider.
 - Add basic ringer mode state tracking for the notification-ring
   slider setting.

Bug: 17899613
Change-Id: Ie2df52edb070055ef59c74039162a0e785d2fdbb
2014-11-28 15:29:21 -05:00
Dongwon Kang
266143e1fb TIF: call tune() in HardwareSession
Background: The underlying passthrough TV input expects tune() command
to show video on the screen and call notifyVideoAvailable().

Bug: 18551619
Change-Id: I257db321c09d621e6bd3c0e69bfe0abfca5742a9
2014-11-28 19:40:36 +09:00
Sungsoo Lim
4e389e557e Missing Javadoc update while API review
Bug: 18550989
Change-Id: I766986fd429d58064fca6262a1c650cbcb19bddf
2014-11-28 16:57:16 +09:00
Jinsuk Kim
bc3226e21d Merge "Do not perform forceVolumeControlStream in master volume mode" into lmp-mr1-dev 2014-11-26 21:27:19 +00:00
Ryan Lothian
1e88cf0796 Fix broken @see javadoc in android.media.* classes
This CL fixes all android.media.* javadoc that includes an "ERROR(...)"
message when rendered to HTML.

Bug: 18537403
Change-Id: Ic60f7cfe4cf4961da163d955387d65a5d2011905
(cherry picked from commit d550f9028ee7f52018fbed3cfd2d0b18d6a7c4f0)
2014-11-26 18:49:01 +00:00
Jinsuk Kim
57d766f533 Do not perform forceVolumeControlStream in master volume mode
The method should be no-op when in master volume mode.

Bug: 18250921

Change-Id: Iaab806db935ef97aa1124c3447e228d3eaef7584
2014-11-26 17:02:18 +09:00
Andy Hung
f32d06d855 Merge "Allow set loop and position before write for static AudioTracks" into lmp-mr1-dev 2014-11-26 02:04:45 +00:00
Eric Laurent
e511ddce43 Merge "AudioService: use FEATURE_LEANBACK instead of FEATURE_TELEVSION." into lmp-mr1-dev 2014-11-25 22:28:17 +00:00
Lajos Molnar
3ed95fe258 Merge "media: add support for 160-byte image info in MediaCodec" into lmp-mr1-dev 2014-11-25 22:09:36 +00:00
John Spurlock
661f2cf458 VolumeZen: Introduce internal vs external ringer mode.
Stabilize mapping between ringer-mode=silent and zen=priority
by keeping track of two ringer modes:
 - Internal ringer mode: Used for underlying stream muting
 - External ringer mode: Reported to clients

The mapping between external ringer mode + zen is:
 - normal = all
 - vibrate = all
 - silent = priority (read-write) or none (read)

Changes include:
 - Remove "zen check" from audio service, back to audio
   service having no knowledge of zen.
 - Maintain a new external ringer mode in audio service,
   this is the ringer mode reported through AudioManager
   to callers, also mapped to the change intent.
 - Introduce a "ringer mode delegate" to the local
   audio manager interface, responsible for observing
   external / internal mode changes, and making changes
   if necessary.
 - Internal ringer mode changes are still interesting
   to the volume dialog, wire up a callback through
   the existing IVolumeController interface.
 - On devices without vibration, the mapping is the same
   but since no ringer mode change is possible, disable
   the icon toggle and remove the mute icon when volume=0.
 - On devices with vibration, volume down presses should
   pulse the vibrate icon (and vibrate) as a hint that this
   is as low as the device can go using the keys.  Since
   the mechanics are similar to the existing zen=none hint,
   pull into shared helper.
 - Log ringer mode changes to the zen log, include calling
   package information for issue diagnosis.
 - Include whether vibration is supported in the audio service
   dump.
 - Update the status bar icon policy to use the internal ringer
   mode, not the external mode (for vibrate icon).
 - Update the "Muted by <x>" logic, include current suppressor
   in dumpsys, ensure suppression icon is enabled & !clickable,
   regardless of zen mode.

Bug: 17884168
Bug: 15471679
Bug: 16824970
Change-Id: Ia7d3bb23ce6d1e37b24fb6521d1c1ab9bb8f60c0
2014-11-25 13:20:46 -05:00
Lajos Molnar
5037f945cd 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-11-24 21:54:27 -08:00
Andy Hung
78bfa6322b Allow set loop and position before write for static AudioTracks
Allow setPlaybackHeadPosition and setLoopPoints in STATE_NO_STATIC_DATA
for consistency with other setters and older Android versions (JB).

Bug: 18217633
Change-Id: Id8ada3056540c4dfcb89f8afa887159e48db0263
2014-11-24 17:29:52 -08:00
RoboErik
d9bb296b56 Merge "Delay calling onConnected until a session is set in MediaBrowser" into lmp-mr1-dev 2014-11-24 23:04:59 +00:00
RoboErik
d64c425f32 Delay calling onConnected until a session is set in MediaBrowser
This will delay all calls to onConnected from the MediaBrowserService
until a session token has been set. This also requires making it an
exception to try setting the session twice.

bug:18052336
Change-Id: Iecf186c53364183e1696af83a855c8db3294a5d0
2014-11-24 12:35:20 -08:00
Jean-Michel Trivi
958876fe55 Add support for audio focus locking
New API for a registered AudioPolicy to lock/unlock the audio
  focus stack and prevent any new grant of focus, similar to
  the way phone calls behave.

Bug 16010554

Change-Id: If34a58ca9bd43d5479e94a2a7b540750b4c6efe9
2014-11-24 10:46:12 -08:00