Commit Graph

8895 Commits

Author SHA1 Message Date
Eric Laurent
c753ca8e93 Merge "AudioService AudioDeviceBroker: fix speakerphone control" into rvc-dev am: bf01a79a83 am: 65701ab11d am: a8cad7250f am: 26454bc3b9
Change-Id: I7f453fb7ce8fb88ee6aff562f66acc9c89bc0067
2020-05-16 04:54:51 +00:00
Eric Laurent
bf01a79a83 Merge "AudioService AudioDeviceBroker: fix speakerphone control" into rvc-dev 2020-05-16 03:58:21 +00:00
TreeHugger Robot
9d01aab4e9 Merge "Have IMMS report IME UID to AudioService" into rvc-dev am: d61819746b am: ab64a27732 am: 1ffd0533a4 am: 942420e5bb
Change-Id: I2e682517bcf59be2a7f8cd9e6885c630961e54a3
2020-05-16 01:57:07 +00:00
Eric Laurent
3aad0adc9f AudioService AudioDeviceBroker: fix speakerphone control
Add a list of clients for speakerphone mode requests similar
to Bluetooth SCO clients. This allows to keep track of requests
by different apps in case of overlap or concurrency and to apply
the most relevant mode according to current audio mode owner.

Also:
- Restore requested speakerphone mode when SCO audio is disconnected
instead of returning to earpiece.

- Remove special check on permission while in call in
AudioService.setSpeakerphoneOn because the priority is now
managed by AudioDeviceBroker based on audio mode owner (the owner
for MODE_IN_CALL must have the modify phone state permission).

- Fix condition in AudioService.setMode() preventing from changing
mode while in call. Now allows releasing mode to NORMAL or
reapplying the same mode and just change mode owner.

- Add more information in dumpsys for AudioDeviceBroker and BtHelper.

Bug: 154464603
Test: test transitions between cell call and VoIP calls
Test: Test regressions with calls in speakerphone mode and Bluetooth
Test: AudioManagerTest#testRouting, NoAudioPermissionTest#testRouting

Change-Id: I0d288acf2373c96d52eb91a6ab7142cc3535c719
2020-05-15 16:15:23 -07:00
TreeHugger Robot
03baf1d960 Merge "Modify java doc" 2020-05-15 20:36:52 +00:00
Yohei Yukawa
d5f402bd0b Have IMMS report IME UID to AudioService
This is a follow up CL to our previous CL [1], which enabled
AudioService to be notified about the UID of the currently used IME.

Although there is no change in the overall approach, with the help
from InputMethodManagerService AuditoService can be notified new IME
UIDs more quickly especially when IMEs are switching to other ones
(e.g. due to user switching or profile switching).

 [1]: I11e17b13513627c88ccb8e4db66c5359e9ee7f7b
      ed4e8c3fab

Bug: 147037345
Test: use voice input with Gboard 9.5.0 during a simulated RTT call.
Change-Id: I44e3331a7bad6d36227f7e2d0523dd14d933b6a1
2020-05-15 10:23:32 -07:00
Dichen Zhang
e36fd0282c Modify java doc
Modified java doc for METADATA_KEY_SAMPLERATE and
METADATA_KEY_BITS_PER_SAMPLE in MediaMetadataRetriever.

Test: api update
Bug: 155718941

Change-Id: I3d0d7acf1cafc53d635744810238e9bb6b57b917
2020-05-12 16:05:59 -07:00
Alan Stokes
3f6b755362 Merge "Grant SYSTEM_ALERT_WINDOW during screen capture." into rvc-dev am: 9b081e496d am: 1b822b337b am: 4c88e950f5 am: 20be15fe43
Change-Id: If7030303222ca136efffcc3a5d64b09908abf24d
2020-05-12 15:58:46 +00:00
Alan Stokes
b3d4b64c0d Grant SYSTEM_ALERT_WINDOW during screen capture.
While an app has an active screen capture MediaProjection, enable the
SYSTEM_ALERT_WINDOW app op for it if it requests the permission and
the user hasn't explicitly allowed or denied it. This enables the app
to use TYPE_APPLICATION_OVERLAY windows to show custom UI on top of
what is being captured. Needed for live-streaming apps.

Test: Manual, using a hand-written fake recording app and a real one
Test: atest MediaProjectionTest
Bug: 148002116
Change-Id: I503f3223608627c80520e98be840f793efd53d2a
2020-05-12 14:17:21 +01:00
TreeHugger Robot
0dc151636a Merge "MediaRouter2: Fix getRoutes() returning an empty list" into rvc-dev am: 81fd503701 am: 7f1571e92a am: 5729ee5296 am: 44fb125c5e
Change-Id: I3865b2b828cefd49c8d8644b4ab7670126cd1dcd
2020-05-12 09:02:12 +00:00
TreeHugger Robot
81fd503701 Merge "MediaRouter2: Fix getRoutes() returning an empty list" into rvc-dev 2020-05-12 07:42:33 +00:00
Automerger Merge Worker
c8d808b27c Merge "Merge "Make MediaRouter2Manager connect to the system ASAP" into rvc-dev am: 15cd47ed26" into rvc-dev-plus-aosp am: 4b91451a62 am: e05e6dd25b am: 2a65e84274
Change-Id: Ia5172a9ded99eb25de4afbb04552e2377ad63826
2020-05-12 07:19:45 +00:00
Hyundo Moon
ef682fd78b MediaRouter2: Fix getRoutes() returning an empty list
By doing this, calling getRoutes() after instantiation will not return
an empty list.

Bug: 156319555
Test: Passed CTS
Change-Id: I4e5158b89d54e06f36dc37a3ca345849f0c91440
2020-05-12 14:02:24 +09:00
Kyunglyul Hyun
ccb9587ae1 Make MediaRouter2Manager connect to the system ASAP
With this CL, some methods such as getAllRoutes, getActiveSessions
can be used without registering a callback.

Bug: 155042836
Test: atest mediaroutertest
Change-Id: Iba38d73a95c1d184bc89ff91d128b00109029d0a
2020-05-12 13:21:30 +09:00
Jiabin Huang
743ec0cb1d Merge "Support query encapsulation information." into rvc-dev am: acc2acafe7 am: b6f9d6aa03 am: 9318d709d6 am: 4eb6d7c348
Change-Id: I3386bb18e12a7741470671ebe7a9943aae646fd8
2020-05-10 05:59:56 +00:00
Jiabin Huang
acc2acafe7 Merge "Support query encapsulation information." into rvc-dev 2020-05-08 18:26:31 +00:00
Kyunglyul Hyun
8feb0a6087 Merge "Filter selectable/deselectable routes" into rvc-dev am: 2eec783e52 am: 65600663fa am: 4be44c0129 am: 5c97bcef8e
Change-Id: Iee524a888dc8011f8d128013397b5c570ee9449c
2020-05-08 11:18:10 +00:00
Kyunglyul Hyun
45512bbd54 Filter selectable/deselectable routes
Only selected routes can be deselectable and not selected routes
can be selectable from this CL.

Bug: 154918270
Test: Manually and atest mediaroutertest
Change-Id: I2e66d814190b003c935b21a744d24fa2b5d2c7ac
2020-05-08 17:36:33 +09:00
jiabin
52c3a741b0 Support query encapsulation information.
Add encapsulation info in AudioDevicePort. Instead of returning a size 0
array, query AudioDevicePort for getEncapsulationModes and
getEncapsulationMetadataTypes.

Test: atest EnumDevicesTest, manually
Bug: 155799506
Change-Id: I4eff64aeb135a75ad51c9b3618a34747be8920f1
2020-05-08 00:37:55 +00:00
hkuang
a44bca0840 MediaTranscodingService: Implement TranscodingRequest.
Also add a lot of TODOs to make sure we document all the things
in the API at the end.

Bug: 145628554
Test: atest MediaTranscodeManagerTest
Change-Id: Ia77ce381b3bbbe546c96ffe4e1c37675b0d238ee
2020-05-07 19:27:03 +00:00
Andy Hung
648e98f70e Merge "AudioMetadata: Translate KEY_ATMOS_PRESENT for JNI" into rvc-dev am: 65c14feec9 am: ad914e2c08 am: 13047d0bf6 am: 33d0361e2e
Change-Id: I8d8e8ff9477c424f73bca1e15a1ce5ee25b0c970
2020-05-07 04:45:30 +00:00
Andy Hung
65c14feec9 Merge "AudioMetadata: Translate KEY_ATMOS_PRESENT for JNI" into rvc-dev 2020-05-07 03:28:15 +00:00
Kyunglyul Hyun
d65b4f9f97 Merge "Introduce APIs to deal with RCN case" into rvc-dev am: 0de25056a2 am: d95366034d am: d95a55785b am: e171e5e6eb
Change-Id: I67d563a478d582b64a40cf362c46674ab1277776
2020-05-07 03:26:49 +00:00
Kyunglyul Hyun
0de25056a2 Merge "Introduce APIs to deal with RCN case" into rvc-dev 2020-05-07 02:25:09 +00:00
Andy Hung
db7fd16f1f AudioMetadata: Translate KEY_ATMOS_PRESENT for JNI
Translate KEY_ATMOS_PRESENT from Key<Boolean> to Key<Integer>
for JNI handling.

Test: AudioMetadataTest#testFormatKeys
Bug: 155392886
Change-Id: I69abbc451cdc6dfd23bf3d5d3a146ba884b9026e
2020-05-06 15:54:06 -07:00
Kyunglyul Hyun
80ba177dcc Merge "Clean up MediaRouter2Manager" into rvc-dev am: 8a028947c3 am: 0d39f06542 am: e55abc61c7 am: ca9c038d8d
Change-Id: Id92f7d3e98a1467b70f06346c26c83cc0f79c60a
2020-05-06 12:50:51 +00:00
Kyunglyul Hyun
8a028947c3 Merge "Clean up MediaRouter2Manager" into rvc-dev 2020-05-06 11:52:20 +00:00
Kyunglyul Hyun
e2dbbf79f9 Introduce APIs to deal with RCN case
This CL does following:
 - MR2Manager#getRoutingSessionForMediaController is added
 - MR2Manager#getAvailableRoutesForRoutingSession is added
 - Add a workaround for provider to provide a routing session
   not requested by the user (RCN case)

Using the added methods, we exepect System UI to implement UX easily.

Bug: 154780833
Bug: 152582294
Test: It is tested manually with two demo APKs. MediaRoute2ProviderDemo
app is updated to enable the user to create a routing session w/o
MediaRouter2 clients and Sample Output Switcher is updated to use the
new APIs. With updated APKs, transfer from cast to cast (Variable
Volume1 -> Variable Volume2) is enabled.

Change-Id: I03c261c1779725f43933bacad429e1a22f602818
2020-05-06 17:44:34 +09:00
Kyunglyul Hyun
fa6f06da30 Clean up MediaRouter2Manager
This CL removes unnecessary APIs.

Bug: 155306249
Test: atest android.media.cts.MediaRoute2InfoTest
  android.media.cts.MediaRouter2Test
  android.media.cts.RouteDiscoveryPreferenceTest
  android.media.cts.RoutingSessionInfoTest
  android.media.cts.MediaRoute2ProviderServiceTest
  mediaroutertest;
  make -j42 RunSettingsLibRoboTests
Change-Id: I7ee6546deeaca8f5e9cb9b0d119ab6fff734ca1c
2020-05-06 16:17:54 +09:00
Amy Zhang
d5be59df94 Merge "Complete the acquireHardware API implementation in the TvInputHardwareManager" into rvc-dev am: de151fb3a4 am: 8c6cc928e2 am: 220c833bba am: 430ec8858d
Change-Id: I6ddd11897ee4d66d5049582f444cbe87ea85c032
2020-05-06 06:02:09 +00:00
Amy Zhang
a2249444a7 Complete the acquireHardware API implementation in the TvInputHardwareManager
This CL:
1. Finish the logic in TIHM to utilize the TRM for a client priority check.
2. FInish the TRM isHigherPriority API to allow the TIHM to compare the
client priority.
3. Finish the TRM isForeground method to check if a process is
foreground or not.
3. Add unit test for TRM isHigherPriority.

Test: atest com.android.server.tv.tunerresourcemanager
Bug: 155339425
Change-Id: I3887ccad31195d3386f1fc6b3de3e641df91092f
2020-05-05 21:05:14 -07:00
Dichen Zhang
dbb2be9634 Merge "MediaMetadataRetriever: unhide bits per sample and sample rate keys" 2020-05-04 20:56:24 +00:00
Dichen Zhang
8508308f4d MediaMetadataRetriever: unhide bits per sample and sample rate keys
Bug: 153915801
Test: update-api
Change-Id: Ic573d2da152ac074dad62f86255397a55cc5e173
2020-05-04 09:58:39 -07:00
Andrew Sapperstein
88d565e7e7 Update inner class constructor refs to use proper syntax.
Previously, we generally required fully qualified names for referring
to inner class constructors (like #Notification.Builder()) despite that
not being valid javadoc. Now, we properly support #Builder() syntax and
the old syntax will error.

Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ib2e4360493275b79c72487ee1cb173bb5e0fd35f
Merged-In: Ib2e4360493275b79c72487ee1cb173bb5e0fd35f
(cherry picked from commit 4c4aa41272)
2020-05-01 18:33:15 +00:00
Andrew Sapperstein
8fe35e5f21 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
(cherry picked from commit e0624c7a40)
2020-05-01 18:25:32 +00:00
Andrew Sapperstein
a296471054 Merge "Update inner class constructor refs to use proper syntax." 2020-05-01 18:00:05 +00:00
James Wei
bc6106c46d Merge "MTP: media info can not be retrieved via MTP#2" into rvc-dev am: 6fb5f2c03a am: 689cd2f58f am: bf3ed90508 am: f58cc557b8
Change-Id: I74879d49ce66e94add91af8a6f8c44bb7ec72ec4
2020-05-01 13:38:50 +00:00
James Wei
f545a3ac9e MTP: media info can not be retrieved via MTP#2
Under the new MtpStorageManager design,
media info like MP3 Track title, album and artist, Genre, etc
can not be retrieved via MTP
by Windows Media Player, Linux Rhythmbox and Some Car Kits

Bug: 112635346
Test: atest MtpTests
Test: atest MediaProviderTests
Test: Manual test: Windows Media Player
Change-Id: I57a947fe6d3a583a0990be5bd2b0678f39d948f2
2020-05-01 07:52:55 +00:00
Andrew Sapperstein
6b1e3188a3 Merge "Fix broken @see tags in public documentation." 2020-05-01 00:27:47 +00:00
TreeHugger Robot
5813773748 Merge "Tuner JNI: linearBlock and OnDestroyNotify" into rvc-dev am: ee6b90ef7f am: ac0f692f78 am: 171bc9d1b2 am: 07df38e663
Change-Id: I3725bac70071e20b3768a40832acdbff73576b33
2020-04-30 01:44:38 +00:00
TreeHugger Robot
ee6b90ef7f Merge "Tuner JNI: linearBlock and OnDestroyNotify" into rvc-dev 2020-04-30 00:52:35 +00:00
TreeHugger Robot
823a7fa971 Merge "Reset audio port generation when having recording callback event." into rvc-dev am: 2b5ba928e5 am: 520d7fae2f am: 367fb637f9 am: 98d3af0b15
Change-Id: I84ffc4b7699a2451d117be1dcaf343f4b70b0b9f
2020-04-29 21:31:54 +00:00
Andrew Sapperstein
4c4aa41272 Update inner class constructor refs to use proper syntax.
Previously, we generally required fully qualified names for referring
to inner class constructors (like #Notification.Builder()) despite that
not being valid javadoc. Now, we properly support #Builder() syntax and
the old syntax will error.

Bug: 6963924
Test: make doc-comment-check-docs
Change-Id: Ib2e4360493275b79c72487ee1cb173bb5e0fd35f
2020-04-29 13:16:02 -07:00
jiabin
fa7a0252b0 Reset audio port generation when having recording callback event.
In RecordingActivityMonitor, compare audio device type and address to
know if legacy remote submix is active, which requires querying audio
patches. When there is a recording callback event, the audio patches in
AudioManager may not be up to date. In that case, when getting a
recording callback event, reset audio port generation if the patch
handle is not found in the cached audio patches.

Test: repro steps in the bug
Bug: 144063329
Change-Id: Ife5c9a65243d2e85e4cd9480e3b415f8bfddc6f5
2020-04-29 09:59:53 -07:00
Andrew Sapperstein
e0624c7a40 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
2020-04-28 12:37:15 -07:00
Kyunglyul Hyun
f9ed659948 Merge "Correct SystemMediaRoute2Provider#requestCreateSession" into rvc-dev am: 61b20fd6e7 am: df1db278e6 am: 0171b86937 am: e2d08a8a67
Change-Id: I4c96c081e441fd066d57e031fbd30a77a518d27f
2020-04-28 04:09:24 +00:00
TreeHugger Robot
66e55af6f8 Merge "MediaTranscodingService: Separate jni file into a sperate library." 2020-04-27 20:20:31 +00:00
shubang
3aef4fe424 Tuner JNI: linearBlock and OnDestroyNotify
referred to ag/10877916 by Henry quxiangfang@

Bug: 139308734
Test: mmm
Change-Id: I7574d27cb1f582a5556e22eac4fff87335230b00
2020-04-27 13:18:46 -07:00
Kyunglyul Hyun
22d4e05e22 Correct SystemMediaRoute2Provider#requestCreateSession
It will call back onSessionCreated or onRequestFailed with
the correct arguments.

Bug: 152932787
Test: manually by cast -> phone multiple times via Output Switcher.
It includes the case that the target route changes (phone -> BT).

Change-Id: Icc324f3e7d6dfde71faa6d3bc919be383e7a5216
2020-04-27 21:44:55 +09:00
Ytai Ben-tsvi
f7d789b0ed Merge "Deliver internal server errors to the client" into rvc-dev 2020-04-25 01:34:06 +00:00