Commit Graph

10015 Commits

Author SHA1 Message Date
TreeHugger Robot
9f333ab2c8 Merge "Call route selected/unselected callbacks" into sc-dev 2021-06-15 09:25:38 +00:00
Sungsoo Lim
6adeb2c9f1 Call route selected/unselected callbacks
Bug: 168093983
Test: manually
Change-Id: Id48870052f1d3fefb8bdbf1b7ba3636c7138b53d
2021-06-15 16:07:36 +09:00
akansha.shukla
d9b89825b7 Fix inconsistency in ringtone list
Sometimes when ringtone from external storage gets same _id as any ringtone of internal volume, getRingtonePosition(..) matches with the internal one firstly, and the ringtone shown is wrong.

Solution is to  match the URI of ringtone instead of the _ID so that correct ringtone is chosen.

Bug: 172878342
Change-Id: I8fc3e936fe89308d4697eda42088e4fd533ce47c
Merged-In: I8fc3e936fe89308d4697eda42088e4fd533ce47c
2021-06-14 14:45:31 +01:00
Ahaan Ugale
a8a6a45f68 Merge "Allow HotwordDetectionService access to audioflinger." into sc-dev 2021-06-14 05:05:08 +00:00
Kyunglyul Hyun
a00481f6a6 Merge "Bind provider services when necessary" into sc-dev 2021-06-08 16:12:15 +00:00
Kyunglyul Hyun
920a676240 Bind provider services when necessary
The media router service bound media route provider
services only when there was a discovery request.

This prevented output switcher to work when there are only
legacy media router clients (i.e. apps that didn't enable MR2)

This CL makes the media router service binds media route provider
services when the MediaRouter2Manager#startScan is called
so that the output switcher can show cast sessions created by
the providers.

This CL also changes communication between the media router service and
the provider services as cast sessions can be created/released even when the
media router service is disconnected from media route provider.

Bug: 176774510
Test: manually

Change-Id: I481e1aa8f9dcc136cbf5788b9f66540708665af2
2021-06-08 12:42:54 +00:00
Marin Shalamanov
79f5d3f4fc Merge "Make AudioManager.getSurroundFormats a TestApi" into sc-dev 2021-06-04 10:49:29 +00:00
Ahaan Ugale
a64d628182 Allow HotwordDetectionService access to audioflinger.
HotwordDetectionService is an isolated service which ordinarily cannot
access audioflinger due to selinux restrictions on isolated processes.
To bypass those restrictions, the audioflinger binder is passed from
the system server to the HotwordDetectionService. This follows the
existing pattern of providing access to the ContentCapture service.

In T we *may* instead solve this at the selinux layer. For now, this
simpler approach is used.

Bug: 190011174
Test: manual - sample app can read audio (with a few other wip changes)
Test: atest CtsVoiceInteractionTestCases
Change-Id: I5493a5c3addf68f2ae80d64b6971a8576484eb8e
2021-06-04 07:20:27 +00:00
Marin Shalamanov
3bec57aa03 Make AudioManager.getSurroundFormats a TestApi
We need to access this API from a TVTS test.

Bug: 187028404
Test: locally run
    m tvts && tvts-tradefed run commandAndExit \
         tvts-all -m TvtsHdmiHostTestCases
Change-Id: I0122ff2a1f285aa01dc76e332a35798e19a07ac7
Merged-In: I0122ff2a1f285aa01dc76e332a35798e19a07ac7
2021-06-03 16:45:07 +00:00
Hyundo Moon
2eedc1fe64 MediaRouter: Set initial mIsBluetoothA2dpOn value
When BT is connected before MediaRouter is initialized,
the mIsBluetoothA2dpOn is not set as true.

Since the value is false, the 'currentSystemRoute' variable in
MediaRouter.selectRouteStatic() is always default route.
This leads to skip selectRoute(defaultRoute) which is called by apps.

The value is always false and not renewed, until audio routes changed.
This results apps cannot make sounds through phone speaker.

The CL fixes the issue by correctly assigning the value when MediaRouter
is initialized.

Bug: 189176702
Test: GMM can make sound via phone speaker.
Change-Id: I4a83f9441a8b3165b7dd668aeef12c25fe3817c0
2021-06-03 20:34:51 +09:00
Svet Ganov
2eebf92965 Switch media fw permissions checks to AttributionSource
Attribution source is the abstraction to capture the data
flows for private data across apps. Checking permissions
for an attribution source does this for all apps in the
chain that would receive the data as well as the relevant
app ops are checked/noted/started as needed.

Teach speech recognition service about attribution
chains. If an implementation does nothing the OS
would enforce permisisons and do blame as always.
This apporach leads to double blaming and doesn't
support attribition chains where app calls into
the default recognizer which calls into the on
device recognizer (this nests recursively). If the
implementer takes advantage of the attribution chain
mechanims the permissions for the entire chain are
checked at mic access time and all apps are blamed
only once.

Fixed a few bugs around finishing ops for attribution
chains. Also ensured that any app death in a started
attribution chain would lead to finishing the op for
this app

bug: 158792096

Test: (added tests for speech reco)
      atest CtsMediaTestCases
      atest CtsPermissionTestCases
      atest CtsPermission2TestCases
      atest CtsPermission3TestCases
      atest CtsPermission4TestCases
      atest CtsPermission5TestCases
      atest CtsAppOpsTestCases
      atest CtsAppOps2TestCases

Merged-In: Ic92c7adc14bd2d135ac13b96f17a1b393dd562e4

Change-Id: Ic92c7adc14bd2d135ac13b96f17a1b393dd562e4
2021-06-01 23:43:29 +00:00
Kriti Dang
d7638021ed Merge "Adding additional javadocs for setSurroundFormatEnabled" into sc-dev 2021-06-01 10:11:54 +00:00
Kriti Dang
3f296bdcfa Adding additional javadocs for setSurroundFormatEnabled
Bug: 187178381
Test: N/A
Change-Id: Ic59c4d6c85deb57c43624e0f8a3b4cc15f5f9690
2021-05-31 16:38:34 +02:00
TreeHugger Robot
c7aa640da3 Merge "Create a new config for attentional haptics OGG resource" into sc-dev 2021-05-25 14:32:08 +00:00
Hangyu Kuang
db10bbab08 Revert "trancoding: lazy-start transcoding service"
This reverts commit 0621358a52.

Reason for revert: change to conditional start.

Bug: 187271658
Test: atest MediaTranscodeManagerTest; unit tests
Change-Id: Iba169a3b50e37b72fab4e354480451cf05ab5be5
2021-05-20 20:23:01 +00:00
Andy Hung
c9300c80f2 Merge "AudioTrack: 24 channel index masks, compressed formats" am: e477e9686f am: dd8fa96c01 am: fde2ef0250
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1702808

Change-Id: I7b14b0c86e5ac1e089702e6a285bf58174fcd45c
2021-05-11 22:49:13 +00:00
Andy Hung
fde2ef0250 Merge "AudioTrack: 24 channel index masks, compressed formats" am: e477e9686f am: dd8fa96c01
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1702808

Change-Id: I35427c5ce3826841b1a0d313ba2488e2bc03fb3b
2021-05-11 22:25:26 +00:00
Andy Hung
d3ceb62024 AudioTrack: 24 channel index masks, compressed formats
PCM channel count is limited to AudioSystem.CHANNEL_OUT_MAX.

Compressed channel count is limited to AudioSystem.FCC_24
as typically the data rate is smaller than the equivalent
PCM channel count stream.

Test: atest AudioTrackTest
Test: atest AudioTrackTest#testImmersiveStreaming
Test: atest AudioTrackTest#testImmersiveChannelIndex
Bug: 187062102
Change-Id: I96b2e37c9b59c9e38a0caf69e19c280949c4d099
2021-05-11 11:01:22 -07:00
Kriti Dang
e5489584ef Merge "Removing the list of formats from the javadoc in setSurroundFormatEnabled" into sc-dev 2021-05-11 07:52:39 +00:00
shubang
5afdd12cfe Modify error codes and improve descriptions
Bug: 167036690
Test: atest MediaMetricsAtomTests
Change-Id: Ib34f402d29043cdda839340e23e26a40e82e57f2
2021-05-10 19:10:35 -07:00
Andy Hung
ce18518dca Merge "AudioFormat: Retrieve sample rate capability from framework" am: ba32f57428 am: 89ce768aa1 am: 4a47417302
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1700287

Change-Id: I7cc3432c9457ef2d046fa8552e7bf7aca4e4e8d8
2021-05-10 20:34:47 +00:00
Andy Hung
4a47417302 Merge "AudioFormat: Retrieve sample rate capability from framework" am: ba32f57428 am: 89ce768aa1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1700287

Change-Id: I137ad2c9e8b3f360037f312773ea8d31d8ba4bfa
2021-05-10 20:15:24 +00:00
Jay Patel
3d46ae52dc Merge "AudioSystem: update framework channel capabilities" am: 249034de9d am: 67143814c2 am: 4245889bbd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1317754

Change-Id: I30f6dd9c16b1168bf263f94498a3993a4bfe7b45
2021-05-10 18:44:23 +00:00
Jay Patel
4245889bbd Merge "AudioSystem: update framework channel capabilities" am: 249034de9d am: 67143814c2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1317754

Change-Id: Icb4bc0bd4382c6a0a7d330624bc371d009efc1c6
2021-05-10 18:08:04 +00:00
Andy Hung
4afe15ccb0 AudioFormat: Retrieve sample rate capability from framework
Allows a device to specify a higher sample rate (e.g. 384kHz)
and have it acknowledged by CTS.

Test: AudioTrackTest#testGetMinBufferSizeTooHighSR
Bug: 135474352
Bug: 187062102
Change-Id: I2a44590970b437c1090c615961432afce974f2ba
2021-05-10 16:22:59 +00:00
Kriti Dang
1985c45742 Removing the list of formats from the javadoc in setSurroundFormatEnabled
The IntDef in param automatically adds the javadoc.

Bug: 187701166
Test: N/A
Change-Id: I2fba353e98d543e8b5d1d66e4cc599e57e3a7f4d
2021-05-10 17:06:44 +02:00
TreeHugger Robot
3582d5cb2d Merge "Fixed AudioMixingRule usage of AudioAttribute#getUsage" into sc-dev 2021-05-07 20:06:35 +00:00
Zhangrui Zhang
cee3c552b8 AudioSystem: update framework channel capabilities
Anticipate more than 8 channels (such as 7.1.4) on
future devices, but keep at 8 for now.

Test: atest AudioTrackTest#testImmersiveStreaming
Test: same test by manually adjusting to 24 channels.
Bug: 127896072
Bug: 187062102
Change-Id: I72c2ff0faa7794f22deaeb794920afb65788f40b
2021-05-07 13:06:18 -07:00
Lajos Molnar
4fa6d3a873 Merge "media: propagate profiles to EncoderProfiles" into sc-dev 2021-05-07 15:02:15 +00:00
Sungsoo Lim
027d957f92 Check the device type instead of the object reference
Also print a log when restore route to default while a bluetooth
route is avaialble.

Bug: 176386259
Test: build
Change-Id: I4a974438040595597fbf4dcb0ec57d49351540ef
2021-05-07 10:56:15 +09:00
TreeHugger Robot
ca3cc01d0d Merge "SoundPool: Update documentation for sound duration" into sc-dev 2021-05-05 21:56:23 +00:00
Andy Hung
b3b3a741d5 SoundPool: Update documentation for sound duration
Test: make docs and view
Bug: 147408160
Change-Id: I8952dd7da2ab8e493415e93f10f2346af3de2bd1
2021-05-04 15:36:40 -07:00
Lajos Molnar
16ceab17a0 media: propagate profiles to EncoderProfiles
Bug: 171673898
Test: atest CamcorderProfileTest
Change-Id: I486762863cd29239b44846b54b146458426b643b
2021-05-03 23:27:42 -07:00
Lajos Molnar
973b2e89bd media: pass full EncoderProfiles from XML
Get multiple audio/video codec profiles from MediaProfiles object
instead of just wrapping the old CamcorderProfiles objects.

Bug: 171673898
Test: atest CamcorderProfileTest
Change-Id: If56ac6c2a89992361f0491d8175af1f89dffd3d0
2021-05-03 23:27:42 -07:00
Santiago Seifert
9642d628ab Merge "Rename MediaExtractor symbols to log session id" into sc-dev 2021-05-01 10:51:09 +00:00
Santiago Seifert
14cdc32bd0 Rename MediaExtractor symbols to log session id
Test: atest CtsMediaHostTestCases
Bug: 167036690
Change-Id: I2e71d460e6907400daeba21fd6a76fa0ea5e0922
Merged-In: I2e71d460e6907400daeba21fd6a76fa0ea5e0922
2021-04-30 22:32:55 +00:00
Andy Hung
6e1398b55f Merge changes from topics "dra", "dts_uhd" am: 6a1812c30f am: ea8e392fef
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1691214

Change-Id: I34f818f3140c8d5c6f21089bf168b6b836a61fbc
2021-04-30 21:28:39 +00:00
Andy Hung
e70b8644aa Audio: Add ENCODING_DTS_UHD am: bd3a68b6f1 am: d3b7c9bb9c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1691700

Change-Id: I070bba4d6da54a75dd9ecf264a8e985ddaf36ed6
2021-04-30 21:28:33 +00:00
Hyundo Moon
b2de16f23f Merge "Fix failing MediaRouter2ManagerTest" into sc-dev 2021-04-30 08:29:37 +00:00
Oscar Azucena
b4cca57bfc Fixed AudioMixingRule usage of AudioAttribute#getUsage
Given that system usages were added to the AudioAttributes, system
components need to use the API were applicable. AudioMixingRule was
missing this and thus the audio attribute usage base routing did not
work correctly. In particular the registration of the audio policy mixing
rules would not register the system usages based routing correctly.
Instead, the match usage rule would default to unknown usage instead of
the requested system usage.

Bug: 186661937
Bug: 186442942
Bug: 186158497
Test: build gcar_emu_x86 and run car kitchen sink to make sure routing
    performed as expected.
Change-Id: I4aaedf1b6b9144bd2e84d2d7112b5ebcf744a8b2
2021-04-29 22:18:15 -07:00
Andy Hung
a4c82624e9 Audio: Add ENCODING_DRA
China DTMB digital TV.
See SJ/T11368-2006
“Specification for multichannel digital audio coding technology”.

Test: atest AudioFormatTest
Bug: 185950819
Merged-In: Id6078e65941020a73f8a43017f480574c2a78999
Change-Id: Id6078e65941020a73f8a43017f480574c2a78999
2021-04-29 19:13:33 -07:00
Andy Hung
bd3a68b6f1 Audio: Add ENCODING_DTS_UHD
See ETSI TS 103 491 V1.2.1 (2019-05)
DTS-UHD Audio Format; Delivery of Channels,
Objects and Ambisonic Sound Fields

Test: atest AudioFormatTest
Bug: 184538197
Merged-In: I740a9ba041ad444ead5513fb3b632a78d391ab1c
Change-Id: I740a9ba041ad444ead5513fb3b632a78d391ab1c
2021-04-29 17:55:34 -07:00
Hyundo Moon
34029e0082 Fix failing MediaRouter2ManagerTest
The test failed for several reasons:
 - When other real cast device is present, tests are run before actual
   routes arrive.
 - Screen is not turned on during test.
 - Test lacks MEDIA_CONTENT_CONTROL permission.

This CL fixes the test.

Bug: 186190171
Test: atest com.android.mediaroutertest.MediaRouter2ManagerTest \
        --rerun-until-failure
Change-Id: I6f86ae7cba25871ffb7c8ee96f4c8db6bd86b816
2021-04-27 17:59:47 +09:00
Chong Zhang
0621358a52 trancoding: lazy-start transcoding service
bug: 186387244
test: atest MediaTranscodeManagerTest; unit tests
Change-Id: I354f32d062b9a46ddfc9f86d5f79c778809799a4
2021-04-26 22:06:25 +00:00
Lais Andrade
852a203646 Create a new config for attentional haptics OGG resource
Create a new hidden config with the URI of a OGG file that has only the
haptics channels and can be played for attentional haptics when sound is
muted (ringtone, notifications, alarms).

First usage introduced is to the Telecom project to be played on
RINGER_MODE_VIBRATE.

Also update Ringtone class to allow playback of haptic-only ringtones
(i.e. ringtones with unmutted haptic channels and volume set to zero on
devices with audio-coupled haptics support).

Bug: 182157749
Test: manual
Change-Id: Ic64d8d56c6b029e32b3d55389c416cee7679ddc8
2021-04-26 17:34:01 +00:00
Treehugger Robot
26b0f32060 Merge "Add constant values for MPEG-H." am: 6286d0952d am: 315d8a0faf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1670526

Change-Id: I065363f18a7fc389add1518213596bd930d562df
2021-04-23 23:47:59 +00:00
Treehugger Robot
6286d0952d Merge "Add constant values for MPEG-H." 2021-04-23 22:51:55 +00:00
Andy Hung
6698967429 Merge "MediaFormat: new MIME types for MPEG-H audio" am: fae80ba7a4 am: 3eb382c3da
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682765

Change-Id: I2cbfa51d8b0b4c1aaa5452064df6119b0cf8794a
2021-04-23 20:43:38 +00:00
Andy Hung
9fe576be8b Merge "AudioFormat: Add ENCODING_PCM_32BIT ENCODING_PCM_24BIT_PACKED" am: e468f6c151 am: 32010fbba7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1670486

Change-Id: I1b3354768d9ed8539459c48f5bb1a051cc9ebf24
2021-04-23 20:42:57 +00:00
Andy Hung
fae80ba7a4 Merge "MediaFormat: new MIME types for MPEG-H audio" 2021-04-23 20:03:56 +00:00