Commit Graph

5937 Commits

Author SHA1 Message Date
Sungsoo
972f27b938 Restore the selected route when an app starts to make sound
Limitation: When two apps make sound simultaneously while one uses a BT
route and the other uses the default route, switching activities between
the two different apps will not change the BT A2DP status until one of
the apps changes its playback status to inactive.

Bug: 32958908, Bug: 35567695, Bug: 33186346
Test: Passed MediaRouter/MediaSession test, and manually varified that
      the b/33186346 is fixed.
Change-Id: I1da97dcb74fa2095425b311ad62cdd00f8118cea
(cherry picked from commit b3658569e9)
2017-07-26 11:02:21 +09:00
TreeHugger Robot
7b3bd1d547 Merge "MediaRouter: Introduce and use getFallbackRoute method" into oc-dr1-dev 2017-07-20 00:18:20 +00:00
Sungsoo Lim
9bfb46f6ff Type check before casting from CookieHandler to CookieManager
CookieHandler.getDefault() doesn't always return CookieManager.

Bug: 63638018
Test: pass StreamingMediaPlayerTest#testHlsWithHeadersCookies
Test: manual with a test app
Change-Id: Ie7c19d38f779813f3fffb9abbcb3188a0fca3f45
2017-07-19 18:40:16 +00:00
Sungsoo Lim
59579ce59d MediaRouter: Introduce and use getFallbackRoute method
Instead of selecting default route, select the fallback route to avoid
making sound via the default route while a BT route is available.

Bug: 63582431
Test: manual
Change-Id: I2cb8fbf6c518294fcec2bf14a5d8175c7302396f
2017-07-17 23:21:34 +00:00
Eric Laurent
403bd3429b audioservice: modify default music volume
Default music volume is changed from 3/4 of max to 1/3 of max to
reduce initial volume over headphones percieved as too agressive.

Also add a property ro.config.media_vol_default to modify this
default value.

Bug: 62608451
Test: verify default music volume over headphones after factory reset.
Change-Id: Icadb99e1bafe88984d3a3a05014d4d4648830693
2017-07-11 16:21:44 -07:00
Jean-Michel Trivi
92ed7bf412 AudioService: internal API for disabling audio playback for a UID
Internal API, available through AudioManagerInternal, to flag
  a UID as having lost the ability to play audio. When that
  happens, all players associated with this UID are paused, and
  future players are immediately paused when they report they
  started.
Users of this API must "enable" a previously banned UID when
  it is no longer in use.

Test: upcoming manual test with background apps
Bug: 34471029
Change-Id: Ic1c103aabe8f3897072b3ce938d84cb949540e23
2017-06-27 17:57:34 -07:00
TreeHugger Robot
f05929af73 Merge "Consider double tap of the play/pause as the next track" into oc-dr1-dev 2017-06-25 01:26:49 +00:00
TreeHugger Robot
e2e01f7795 Merge "AudioSystem: Add missing DEVICE_USB_HEADSET to DEVICE_USB_ALL" into oc-dr1-dev 2017-06-24 01:58:38 +00:00
Eric Laurent
5c51bb9919 AudioSystem: Add missing DEVICE_USB_HEADSET to DEVICE_USB_ALL
Bug: 36220140
Test: verify AUDIO_BECOMING_NOISY intent is broacast when a USB_HEADSET
device is disconnected.

Change-Id: I6bfafc0174d5a02cc64862074f60e073407337d3
2017-06-23 11:08:37 -07:00
Jaewan Kim
74d002be26 Consider double tap of the play/pause as the next track
See following document for the details
https://source.android.com/devices/accessories/headset/usb-headset-spec#control-function-mapping

Bug: 36575213
Test: Run Cts (MediaSessionTest)
Change-Id: I3f9f641a4f6aeb36f03758f05e15bc062cda85f3
2017-06-23 17:19:30 +09:00
Jean-Michel Trivi
f1cd71a3b2 Total Silence vs VoIP
Do not suppress VoIP audio in any DnD mode.

Test: start a VoIP app and enter Total Silence mode, verify comm audio is still heard.
Bug: 37742663
Change-Id: I40de67b45713f476a2e07b05ac84bd6663f50fdf
2017-06-22 19:30:29 -07:00
Jean-Michel Trivi
34bc810b0b Merge "DnD: Total silence doesn't suppress A11y" into oc-dev
am: 9f1494368b

Change-Id: Ic213b2675ee5571449c74b19184da7cb91331c01
2017-06-21 17:23:30 +00:00
Jean-Michel Trivi
7a84eaef3c DnD: Total silence doesn't suppress A11y
When entering Total silence mode, text prompts from a11y were losing
 AppOpsManager.OP_PLAY_AUDIO, causing them to play muted (amplification
 of 0.0f) even though the STREAM_ACCESSIBILITY volume was not.
The fix consists in adding another category of sound suppression
 behavior in AudioAttributes, for usage types that should never be
 suppressed (== muted), and using it for USAGE_ACCESSIBILITY.
 When ZenModeHelper iterates over usages to mute/unmute players,
 consider whether that usage's suppression behavior is SUPPRESSIBLE_NEVER.

Test: turn Talkback on, then enter Total silence and verify Talkback is heard
Bug 62827456

Change-Id: I48cae48797ef9bc6bcaee82484ba078ee445345c
2017-06-20 22:45:14 +00:00
TreeHugger Robot
95b41415cd Merge "AudioService: implement safe volume warning for USB Headsets" into oc-dr1-dev 2017-06-18 05:15:38 +00:00
Chris Thornton
ba08b7945a Add SoundTriggerManager APIs to use a PendingIntent to get callbacks.
Test: APIs exercised using a special test app not in this CL.

Change-Id: I99425d1e67a778513e6c75e7d595c072032aa2ab
2017-06-13 18:37:48 -07:00
Eric Laurent
eab40d14a8 AudioService: implement safe volume warning for USB Headsets
Also fix MediaRoute update for USB devices

Bug: 62492975
Test: check warning with USB headset and property audio.safemedia.force.

Change-Id: If947beaf81b74b1e560402648042047cb23f1df6
2017-06-09 15:45:45 -07:00
Marco Nelissen
5301c498fe Merge "Close connection before retrying" into lmp-dev am: a8648ecebb am: 5181a7ab64 am: 4b78a79546 am: 6d5bc9a3c2 am: 3272cf26c1 am: e18e8c4113 am: 69b6a382a3 am: ce5c72e887 am: 4d9e6150f3 am: d7fe3ea6a8 am: db9d2588b8 am: 9e4e6c4b7c am: 2c1d4f8f7b
am: 031a20a6c7

Change-Id: I5039c6fc8c0a18fcf14edd30f94975fff6c1fc35
2017-06-07 00:31:33 +00:00
Marco Nelissen
2c1d4f8f7b Merge "Close connection before retrying" into lmp-dev am: a8648ecebb am: 5181a7ab64 am: 4b78a79546 am: 6d5bc9a3c2 am: 3272cf26c1 am: e18e8c4113 am: 69b6a382a3 am: ce5c72e887 am: 4d9e6150f3 am: d7fe3ea6a8 am: db9d2588b8
am: 9e4e6c4b7c

Change-Id: I1d028759fecc34081daf0be653a1b729e0e048ac
2017-06-07 00:16:34 +00:00
Marco Nelissen
db9d2588b8 Merge "Close connection before retrying" into lmp-dev am: a8648ecebb am: 5181a7ab64 am: 4b78a79546 am: 6d5bc9a3c2 am: 3272cf26c1 am: e18e8c4113 am: 69b6a382a3 am: ce5c72e887 am: 4d9e6150f3
am: d7fe3ea6a8

Change-Id: Ic5a7104241d36e82418ce5a2a43595d2fa4bff47
2017-06-07 00:04:12 +00:00
Marco Nelissen
d7fe3ea6a8 Merge "Close connection before retrying" into lmp-dev am: a8648ecebb am: 5181a7ab64 am: 4b78a79546 am: 6d5bc9a3c2 am: 3272cf26c1 am: e18e8c4113 am: 69b6a382a3 am: ce5c72e887
am: 4d9e6150f3

Change-Id: I5ede1388f265920fa5dd835c4a6335380daa9103
2017-06-06 23:54:55 +00:00
Marco Nelissen
4d9e6150f3 Merge "Close connection before retrying" into lmp-dev am: a8648ecebb am: 5181a7ab64 am: 4b78a79546 am: 6d5bc9a3c2 am: 3272cf26c1 am: e18e8c4113 am: 69b6a382a3
am: ce5c72e887

Change-Id: I081f15c5d6bb16b3f490e53dbc2910a45e6a920b
2017-06-06 23:45:51 +00:00
Marco Nelissen
ce5c72e887 Merge "Close connection before retrying" into lmp-dev am: a8648ecebb am: 5181a7ab64 am: 4b78a79546 am: 6d5bc9a3c2 am: 3272cf26c1 am: e18e8c4113
am: 69b6a382a3

Change-Id: I2c599bac680bda5d4dcfa4f3b9fb5f1413839da0
2017-06-06 23:39:57 +00:00
Marco Nelissen
69b6a382a3 Merge "Close connection before retrying" into lmp-dev am: a8648ecebb am: 5181a7ab64 am: 4b78a79546 am: 6d5bc9a3c2 am: 3272cf26c1
am: e18e8c4113

Change-Id: I5c34b680b1c7abcfd33c8719406516fe796afebb
2017-06-06 23:33:50 +00:00
Marco Nelissen
e18e8c4113 Merge "Close connection before retrying" into lmp-dev am: a8648ecebb am: 5181a7ab64 am: 4b78a79546 am: 6d5bc9a3c2
am: 3272cf26c1

Change-Id: I92f069aa6f3a897f9bfba4405dcd64dc066db944
2017-06-06 23:28:27 +00:00
Marco Nelissen
3272cf26c1 Merge "Close connection before retrying" into lmp-dev am: a8648ecebb am: 5181a7ab64 am: 4b78a79546
am: 6d5bc9a3c2

Change-Id: I8165c2218d0d5de41468f8acff86a720c03d1f52
2017-06-06 23:22:14 +00:00
Marco Nelissen
6d5bc9a3c2 Merge "Close connection before retrying" into lmp-dev am: a8648ecebb am: 5181a7ab64
am: 4b78a79546

Change-Id: Iceb4edfd80a0a483d28f2624669eff9dd86bfcb8
2017-06-06 23:16:24 +00:00
Marco Nelissen
5181a7ab64 Merge "Close connection before retrying" into lmp-dev
am: a8648ecebb

Change-Id: I744fdb979aa2803b53d3ff6f4e3e72f6f1160d74
2017-06-06 23:02:35 +00:00
Jeff Sharkey
ec68b46bc8 Merge "Annotate @SystemApi with required permissions." into oc-dev am: c1406978a4
am: 7a2e4a8486

Change-Id: Ib629e25dbf047c110feaf03e4ff744b5c6df9aeb
2017-06-06 15:48:24 +00:00
Jeff Sharkey
d86b8fea43 Annotate @SystemApi with required permissions.
Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
2017-06-05 13:27:11 -06:00
Marco Nelissen
46132afee7 Close connection before retrying
Otherwise the (CTS) server might run out of connections.
Bug: 38391487
Bug: 22771132
Test: build, run CTS, stream music

Change-Id: I92c782a6799ab36eec8df3f7c3217bea667b838a
2017-06-02 22:35:35 +00:00
Wei Jia
55d7e9e19a Merge "MediaCodec: add CSD description for FLAC" 2017-06-02 16:16:42 +00:00
Dongwon Kang
86dd9f3d70 Merge "Update documentation of MediaCodec regarding partial frame." into oc-dev am: 878fc6a81c
am: 1948af7bd0

Change-Id: I9970625b727502eb85a888eab0867e9b583abda1
2017-06-01 09:17:29 +00:00
TreeHugger Robot
1c70b0e42d Merge "MediaRouter: Remove the globally selected route feature" 2017-06-01 09:07:44 +00:00
Dongwon Kang
9464db6e5f Update documentation of MediaCodec regarding partial frame.
Test: documentation update
Bug: 62202844
Change-Id: Ie1e269e7e22206001a145e9c7ee6f92d7e8633e1
2017-05-31 16:37:13 -07:00
Jean-Michel Trivi
64d1977ad1 Merge "Playback activity monitoring: add player types" into oc-dev am: faa2cdfa47
am: a4f967471b

Change-Id: I598ed9f0ab7f17944b3eea3107bf058a1a99f917
2017-05-26 18:19:08 +00:00
Jean-Michel Trivi
0b7649a26b Playback activity monitoring: add player types
Add player types for playback activity monitoring:
 - AAudio
 - hardware sources
 - proxy for external players
Fix some declarations that do not follow coding guidelines

Test: n/a
Bug: 62027849
Change-Id: I14088a071a296fa8d342b36b550f1dc4e3388653
2017-05-25 19:53:35 -07:00
Sungsoo
d103e56e65 MediaRouter: Remove the globally selected route feature
Bug: 23887911, Bug: 32958908
Test: Manual and passed MediaRouterTest
Change-Id: I0106cf1054d2117a2e86f99087cd8bda0eac020c
2017-05-25 11:33:13 +09:00
Wei Jia
cb21157c1a MediaCodec: add CSD description for FLAC
Test: developer page shows correct content
Bug: 37787245
Bug: 37794552
Change-Id: I955dc3bf730f91653b2622aa0b2e7f1c1c867a72
2017-05-24 15:50:12 -07:00
TreeHugger Robot
936f1044bb Merge "MediaPlayer: fix typo in stop() documentation" 2017-05-22 21:54:28 +00:00
Kevin Rocard
ec5305f8f9 MediaPlayer: fix typo in stop() documentation
Test: compile
Bug:

Change-Id: I6fd2cdcadcf22f61b0543d2844a87b9e5ef74c9e
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-05-18 18:39:19 +00:00
Andy Hung
0dc609a113 Merge "VolumeShaper: Enable xOffset from Java" into oc-dev am: b33c0eb07a
am: 0cc01b5bc2

Change-Id: I9afcd844391b56991b5cc686808f89b4ec878a31
2017-05-18 16:34:39 +00:00
Andy Hung
b33c0eb07a Merge "VolumeShaper: Enable xOffset from Java" into oc-dev 2017-05-18 16:15:50 +00:00
Andy Hung
3c0f5d296e VolumeShaper: Enable xOffset from Java
Previously only accessible from native.
Also improve documentation and comments.

Test: CTS VolumeShaperTest, Ducking
Bug: 38353147
Change-Id: I27bb34f0a5d28f80d138111bbeeb92653b5195c5
2017-05-17 18:31:38 -07:00
Jean-Michel Trivi
9bc3840b19 Merge "AudioFocusRequest: longer code sample, javadoc fixes" into oc-dev am: 1daffb7aac
am: 75b7449b56

Change-Id: I376259e8a0befd910429cbcc00e93cf04be0d225
2017-05-17 23:20:16 +00:00
Jean-Michel Trivi
1daffb7aac Merge "AudioFocusRequest: longer code sample, javadoc fixes" into oc-dev 2017-05-17 22:51:41 +00:00
TreeHugger Robot
c450b1bf55 Merge "Fix incorrect documentation on TvContract.buildProgramsUriForChannel()" 2017-05-17 22:18:27 +00:00
Dongwon Kang
0e65f5dbf5 Fix incorrect documentation on TvContract.buildProgramsUriForChannel()
Test: documentation fix
Bug: 36791800
Change-Id: I601c72a0f65d53201aadad48c0c368b46431c895
2017-05-17 17:58:49 +00:00
Dongwon Kang
7fc65c23ff Fix the documentation of onTimeShiftGetCurrentPosition()
Test: documentation fix
Bug: 30254671
Change-Id: If6cb73f6824b9bc6db9aa6eed71319458662be17
2017-05-17 16:12:25 +00:00
Jean-Michel Trivi
cfcb43121d AudioFocusRequest: longer code sample, javadoc fixes
Test: make -j offline-sdk-docs
Bug: 38124458
Change-Id: I18e83175f6919fd6afeae9475c00eded829cb96a
2017-05-16 16:15:47 -07:00
Sungsoo
b64a28ea80 Merge "MediaBrowser: Allow to connect while disconnecting" into oc-dev am: 69c81d8cef
am: 15cbcc866b

Change-Id: I3b75ab0c160f63d4a77d36bcd27b03c4014fbd90
2017-05-16 06:46:12 +00:00