Commit Graph

5962 Commits

Author SHA1 Message Date
Eric Laurent
1e52eafae1 Merge "audioservice: modify default music volume" into oc-dr1-dev am: b6f946c081
am: aebf79edb4

Change-Id: I9e5ee08c8320799dd53e604005c4be57142832fb
2017-07-12 17:47:33 +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
Dianne Hackborn
3e99f654fb Fix issue #34471029: Don't allow audio use from background apps.
This is becoming a common pattern (keeping track of which processes
are cached and not allowing them to do stuff in that state), so I
am turning this in to a general mechanism for monitoring this state
through the activity manager's IUidObserver.  Now we can just have
AudoService implement its own IUidObserver to get this state and
update which uids it is blocking.

This required making some changes to uid change reports so that
the integer is now a bit mask instead of an enumerations, but that
is what it was already turning in to anyway.  (This gets rid of
the crazy GONE_IDLE constant that we'd needed to add before because
it wasn't a bit mask).

Eventually the power manager should be changed to be told about
these changes to cached state instead of listening to every proc
state change, but we'll do that later, it is more disruption than
I want to take for now.  However, while working on this, I noticed
that the power manager had regressed in the cached uids it would
actually block, because the activity manager was no longer telling
it about all uids that are idle.  (I think this happened when I had
to change the default idle state of UidRecord to true.)  So I am
adding a bit of new code to keep track of what idle state we last
reported to observers, to make sure we tell it about newly created
uids that are idle but have never actually become active.

Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services

Change-Id: I7bfd46bacadd4cab2a69f40e6e52afb4e67b456a
2017-07-10 17:24:20 +01:00
Scott Randolph
7934aab628 Fix typo in AudioPolicy comments
Make it clear that setAudioPolicyFocusListener is required when external
focus control is desired (as opposed to previously mentioned
setAudioPolicyStatusListener).

Test:  Inspection of the code.
Change-Id: I6d933feb3bf998d10a10b58ec6804dbab34e2036
2017-07-05 18:20:18 -07:00
TreeHugger Robot
b6d9ba31de Merge "cas: convert MediaCas to HIDL" 2017-06-28 20:37:24 +00:00
Jean-Michel Trivi
b777252139 Merge "AudioService: internal API for disabling audio playback for a UID" into oc-dr1-dev am: 8f81919093
am: 051285b648

Change-Id: Ib78281b6bc1b4ae37e0aba5e6a0b20cd81a29db2
2017-06-28 03:33:03 +00: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
Jaewan Kim
5f69d38a99 Merge "Consider double tap of the play/pause as the next track" into oc-dr1-dev am: f05929af73
am: db7927c21e

Change-Id: I69a6f48e46bcbd7ed03057ce0c18002f6ecdd576
2017-06-25 01:42:03 +00: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
Eric Laurent
fc97c060d0 Merge "AudioSystem: Add missing DEVICE_USB_HEADSET to DEVICE_USB_ALL" into oc-dr1-dev am: e2e01f7795
am: 1c22f1d77f

Change-Id: Ifa0ac27c5d025527ce3ed95032668910febc0a90
2017-06-24 05:23:16 +00:00
Jean-Michel Trivi
19d8a55ce5 Merge "Total Silence vs VoIP" into oc-dr1-dev am: 92e1d0ab44
am: 44e6126079

Change-Id: Id9096436fc8d10f672777b31e40dd8e121faa418
2017-06-24 05:20:52 +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
Chong Zhang
2659c2f16c cas: convert MediaCas to HIDL
- Replace AIDL interfaces with corresponding HIDL ones.

bug: 22804304
Change-Id: I8c552ce6fc3766715cd1bc0ea05c0988d56f590e
2017-06-23 16:18:55 -07: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
Eric Laurent
2d8b429bb4 Merge "Add offset for AV sync header." 2017-06-23 15:52:55 +00: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
TreeHugger Robot
3e32b84ed7 Merge "Media: Eliminate NPE from race conditions" 2017-06-23 03:43:57 +00: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
d4bb63483e Merge "Recording activity notification: client uid and package name" 2017-06-22 22:40:05 +00:00
Conrad Chen
5265beb649 Media: Eliminate NPE from race conditions
Race conditions may happen between
MediaSessionManager.SessionsChangedWrapper.release() and calling
onActiveSessionsChanged(), which might cause NPE. Copies member
variables as local variables to prevent that.

Test: cts-tradefed run cts -m MediaTest
Bug: 62841633
Change-Id: I69b6d155a1a5c475ab4bb317b60baa6f3a030e5a
2017-06-22 21:11:04 +00:00
Sungsoo Lim
b82b7046ff Merge "Restore the selected route when an app starts to make sound" 2017-06-22 00:11:54 +00:00
Jean-Michel Trivi
b425e0029e Merge "DnD: Total silence doesn't suppress A11y" into oc-dev am: 9f1494368b am: 34bc810b0b
am: 341bccf786

Change-Id: I901e6925269e2d406dd3402764dd07ceb34fd25e
2017-06-21 17:38:34 +00: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
Sungsoo
b3658569e9 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
2017-06-21 15:15:59 +09:00
Jean-Michel Trivi
66ffacf42a Recording activity notification: client uid and package name
Add support for a system component to listen to recording activity
  and know the uid and package name of the client app performing
  the recording. This information is discarded for non-system
  listeners on the server side.
Add log friendly dump for RecordActivityMonitor, AudioFormat and
  audio source to dump recording activity in AudioService.

Test: run cts -m CtsMediaTestCases -t android.media.cts.AudioRecordingConfigurationTest#testAudioManagerGetActiveRecordConfigurations
Test: during recording, run "adb shell dumpsys audio", check output under RecordActivityMonitor
Bug 62579636

Change-Id: I60a223da3a2b7f7080bd7346fe3edc1df039466a
2017-06-21 02:04:38 +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
Eric Laurent
308a3da613 Merge "AudioService: implement safe volume warning for USB Headsets" into oc-dr1-dev am: 95b41415cd
am: 997de13c3e

Change-Id: I01de23e744fcf7925ae8555b1a2eb0ded999c7be
2017-06-18 05:36:46 +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
TreeHugger Robot
ccf64a5e12 Merge "MediaCodec: add more details for FLAC CSD." 2017-06-17 00:18:30 +00:00
Dongwon Kang
bef01e4be6 Fix mistyped exceptions; InvalidArgumentException
Test: manually tested MediaCodec throws IllegalArgumentException
Bug: 62700434
Change-Id: Id3bc37200c5d1b83ba978e6971ad3310083c8319
2017-06-16 14:58:50 -07:00
Wei Jia
2748d60149 MediaCodec: add more details for FLAC CSD.
Test: developer page shows correct content
Bug: 37787245
Bug: 37794552
Change-Id: If8fc2cd5c340169c01c4c1bc93a314f963b40e45
2017-06-16 11:26:58 -07:00
Shubang
8c78668c7a Add @RequiresPermission for CHANGE_HDMI_CEC_ACTIVE_SOURCE
Test: mmm
Bug: 62270868
Change-Id: I7fd236d549a4b437ec03e37ae5d78a0073028626
2017-06-15 15:01:18 -07:00
Chris Thornton
f972cc3e12 Merge "Add SoundTriggerManager APIs to use a PendingIntent to get callbacks." into oc-dr1-dev am: 6f071c369e
am: 2fe6586160

Change-Id: I13fcdd58bd9219ce6c65e4bf90d107222047fc42
2017-06-14 19:48:28 +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
Mark Goldstein
356b542c44 Merge "Fix a few typos in audiofx doc strings." 2017-06-13 16:56:13 +00:00
Hyundo Moon
9442e11470 ExifInterface: Prevent DATETIME value from being set unproperly
Although the DATETIME and DATETIME_ORIGINAL tags are for different
purposes, the DATETIME value is set to the same value as
DATETIME_ORIGINAL tag's when loading the attributes of an image.
This CL prevents the problem by setting the value of DATETIME tag only
when it does not exist.

Bug: 62137632
Test: Passed ExifInterface CTS
Change-Id: Ic5c43c53cb363a782bcac20915d74ea534ec70e4
2017-06-13 02:37:20 +00:00
Mark Goldstein
e87cffe559 Fix a few typos in audiofx doc strings.
Test: manual compare

Bug: 6440862
Change-Id: I5087286e48a6fc24266a7d33fe6f97a81d3840bf
2017-06-12 14:42:09 -07:00
TreeHugger Robot
70919cc55f Merge "TIF: add TvContract.isRecordedProgramUri() method" 2017-06-12 19:16:50 +00:00
jiabin
e34b659fe6 Add offset for AV sync header.
AV sync header was 16 bytes, which will cause partial timestamp header
written when the framesize cannot be divided by 16.

Bug: 31688925
Test: Test with writing fake data to AudioTrack with timestamp
Change-Id: Idc818985b3e0de47665ce5a28c458c018aa69eb3
2017-06-12 10:13:20 -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