Commit Graph

8907 Commits

Author SHA1 Message Date
Hyundo Moon
f3ff3de37e Merge "Prevent abuse of MediaRoute2ProviderService#notifyRequestFailed()" into rvc-dev 2020-06-11 01:10:25 +00:00
Ytai Ben-tsvi
3917b729a6 Merge changes Ibf4ecdb4,I1e4adf9f into rvc-dev
* changes:
  Correctly propagate service state change
  Support null audio format in recognition event
2020-06-10 19:31:42 +00:00
Ytai Ben-Tsvi
7caef40ad0 Support null audio format in recognition event
The audio format doesn't always make sense in recognition events, for
example in a failure or abort event, so we allow it to be null.
However since the SoundTrigger.java API doesn't allow that, we inject
a default if it is not available.

Bug: 157496890
Test: Simulated a device that doesn't support concurrent capture,
      reproduced the bug, applied the fix, verified.
Change-Id: I1e4adf9f3ccdc0f62cb9ca5e8c07df3c40a9d2cd
2020-06-09 16:05:19 -07:00
Hyundo Moon
9b5e3923d1 Prevent abuse of MediaRoute2ProviderService#notifyRequestFailed()
The method can be called with a random requestId, or called multiple
times with the valid requestId. It can result unnecessary calls
to MediaRouter2Manager#onRequestFailed().

This CL resolves this problem.

Bug: 157873556
Test: Passes CTS and mediaroutertest
Change-Id: Ia7dd4ddafd532b9f23bf19491a0820d5a74f6a70
2020-06-09 19:12:30 +09:00
Hyundo Moon
5aacc569c7 Merge "MediaRouter2: Add missing synchronized(sRouterLock) block" into rvc-dev 2020-06-09 06:40:51 +00:00
TreeHugger Robot
2950ebf07d Merge "Add MediaRouterManager.Callback#onSessionReleased" into rvc-dev 2020-06-09 06:10:19 +00:00
Kyunglyul Hyun
fe7b5b125b Add MediaRouterManager.Callback#onSessionReleased
Add the callback to let MediaRouter2Manager get notified
of released sessions.
A test is also added to check if the manager is aware of
a released session when the session is released from the
media router.

Bug: 157872573
Test: atest mediaroutertest
Change-Id: Ifb96b23ed61cc15f5015c453727a487c3b09a92b
2020-06-09 13:13:30 +09:00
Hayden Gomes
50980050a6 Merge "Adding lock to sendEventFromNative" into rvc-dev 2020-06-08 16:02:49 +00:00
TreeHugger Robot
e3767bdaae Merge "Ignore transfer to an unknown route" into rvc-dev 2020-06-08 11:34:35 +00:00
TreeHugger Robot
6b1cfced63 Merge "Notify a failure on transfer timeout" into rvc-dev 2020-06-08 11:34:13 +00:00
Hyundo Moon
23a9e17874 MediaRouter2: Add missing synchronized(sRouterLock) block
Bug: 157873496
Test: Builds successfully
Change-Id: I87882c642bcdd93a2fedd9ad2c6c5dc54eada598
2020-06-08 15:48:56 +09:00
Hyundo Moon
ebb7ae6679 Merge "MediaRouter2: Sync routes when first RouteCallback is registered" into rvc-dev 2020-06-08 06:07:31 +00:00
Hayden Gomes
14e3bd0c3e Adding lock to sendEventFromNative
Eliminate potential race condition for postEventFromNative.

Fixes: 157755647
Test: atest com.android.car where race condition was hit
Change-Id: I5d11f8769d2c09a6a630332db447302e06a5869b
2020-06-05 10:15:42 -07:00
Kyunglyul Hyun
8df5fb6e7d Notify a failure on transfer timeout
When a transfer is ignored by the provider.
It is handled as a failure by MediaRouter2Manager.

A test is added for timeout, which takes 30 seconds.

Bug: 157875723
Test: atest mediaroutertest
Change-Id: I3f0ec77551309c96f8f589057800082f6121d4e2
2020-06-05 18:22:42 +09:00
Hyundo Moon
bc63327359 MediaRouter2: Sync routes when first RouteCallback is registered
Bug: 149526397
Test: Passed CTS and mediaroutertest
      Also checked logs that DEFAULT_ROUTE is not added.
Change-Id: Icc0a5f2ea8f93fd7baba132a9bd4a1f9d798bba9
2020-06-05 17:38:04 +09:00
Automerger Merge Worker
7daf2ca947 Merge "Merge "Fix TvRecordingClient api issues" am: cce2ca958e am: f7cbbae9e4" into rvc-dev-plus-aosp am: 14bd7ccbb0 am: f9061f953d am: 4276a00208
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/972628

Bug: 134042967

Change-Id: Ib3ca9467b68563383fef4dbc0f11b0f4aa8fd111
(cherry picked from commit 69244518dd)
2020-06-05 05:01:31 +00:00
Henry Fang
084e7473fb Merge changes I9f8ce2e5,I3142b073 into rvc-dev
* changes:
  Add the metrics for status of open cas session
  Add the metrics for DVR status
2020-06-04 17:18:14 +00:00
Kyunglyul Hyun
0eadc17150 Merge "Fix MediaRoute2ProviderService TODOs" into rvc-dev 2020-06-04 07:05:29 +00:00
Henry Fang
fd40c07abe Add the metrics for status of open cas session
Metrics review request:  b/155199791
Metrics design review is updated at https://eldar.corp.google.com/assessments/937523088/drafts/927800491

bug: 154661158
Test: Manual
Change-Id: I9f8ce2e52289130f9fb39a368240676c1792c154
2020-06-03 12:38:03 -07:00
Henry Fang
1ae85bb287 Add the metrics for DVR status
Metrics review request:  b/155199791
Metrics design review is updated at https://eldar.corp.google.com/assessments/937523088/drafts/927800491

bug: 154661158
Test: Manual
Change-Id: I3142b0737f7469a79a526281b75a06d3dbf97483
2020-06-03 12:31:00 -07:00
Kyunglyul Hyun
a3be2de6ec Ignore transfer to an unknown route
This CL ignores attempts to transfer to unknown route in
MediaRouter2Manager.
This CL also fixes wrong acquisition of locks when getXXXRoutes.

Bug: 157875504
Test: atest mediaroutertest
Change-Id: Ic3415844551c672b42d19d9744d7538a9d7df7c3
2020-06-03 18:04:18 +09:00
Jing Ji
322b748b8d Merge "Update docs for MediaProjectionManager.getMediaProjection" into rvc-dev 2020-06-02 19:12:49 +00:00
Jing Ji
fd7b013f71 Update docs for MediaProjectionManager.getMediaProjection
It actually needs the foregroud service to be the type "mediaProjection"

Bug: 157265923
Test: m -j ds-docs-java
Change-Id: Ia5aab928be1755e3117432bdec423e88f997c55b
2020-06-02 10:39:46 -07:00
Kyunglyul Hyun
d344655969 Fix MediaRoute2ProviderService TODOs
This CL ignores requests that contain unknown session IDs and
make sure sequence of binder calls are aligned with notifySession
Created/Updated/Released.

Bug: 157873546
Bug: 157873487
Test: Run CTS and atest mediarouter test
Change-Id: Ie31e2fca8160093cf54886180e67d40865a35d6d
2020-06-02 17:32:57 +09:00
Hyundo Moon
5c8f3b20d5 Merge "Add bug numbers for TODOs in MediaRouter2 related classes" into rvc-dev 2020-06-02 08:16:58 +00:00
Hyundo Moon
0f78fc6ab8 Add bug numbers for TODOs in MediaRouter2 related classes
This CL adds bug nubmers for TODOs which are needed to resolve in
Android R timeframe.

Bug: 157875570
Test: Builds successfully
Change-Id: I8d5adcabb4ec42feabf38ac3cedcd63e9a5a9cf2
2020-06-01 17:40:08 +09:00
Jeff Sharkey
3744bcd288 Load video thumbnails using ARGB_8888 for quality.
Based on feedback from a partner, it sounds like getFrameAtTime()
and getScaledFrameAtTime() may end up returning low-quality bitmaps.

To make it clear that we want to create high-quality thumbnails,
this change explicitly requests ARGB_8888.

Bug: 157448043
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I39c7c552e8fa715ec13efa75c1c3a30d58492bfb
2020-05-30 12:12:18 -06:00
Santiago Seifert
a5dc451305 Merge "Complete CryptoInfo.toString" into rvc-dev 2020-05-28 16:21:19 +00:00
Santiago Seifert
e5cc58f3a3 Complete CryptoInfo.toString
Bug: 154120292
Test: presubmit
Change-Id: I67fdd5ad3cc327d5ab91aa1bfe3928c67463be8f
2020-05-28 14:18:25 +01:00
shubang
1dc13378a2 Tuner API: make DvrPlayback.attach/detachFilter no-ops
Will mark them @deprecated or @removed in next version

Bug: 155435894
Test: make
Change-Id: If5bf3604ed10721f80162d54951eb38bb8084646
2020-05-27 08:18:58 +00:00
TreeHugger Robot
f49fa1a9ea Merge "Add support for TvInputManager.acquireTvInputHardware CTS" into rvc-dev 2020-05-27 04:39:45 +00:00
shubang
491eaba9be Tuner FW: fix filter type check.
Java subtype and HAL subtype don't match, which lead to a bug in
configure();

Other minor fixes.

Bug: 157278203
Test: make; cts;
Change-Id: I791d3a06c68499cf359fd718d2ca24a20ac35796
2020-05-27 00:07:12 +00:00
Jean-Michel Trivi
7c7016071a Fix volume key handling for key press repeat
The original code for translating volume key presses into CEC
commands was sending the equivalent of a key up / key down for
each call to adjustSuggestedStreamVolume. This behavior caused
CEC commands to pile up in HdmiControlService, and a repeated
key press (user keeping finger on volume button on remote) would
cause volume to still change on the CEC device handling volume
even after the key was released.
  The fix consists in changing how PhoneWindowManager communicates
with AudioService, by passing the key event directly, so AudioService
can communicate the key up / key down information to the CEC
library, which already deals with repeated commands on the CEC bus.

Bug: 137311120
Test: connect DUT to CEC TV or receiver capable of handling vol cmds,
  keep pressing on vol key, verify releasing key stops volume
  changes on TV/receiver.

Change-Id: I7a75af651b6b424129515a8991b5afb15c62dba3
Merged-In: I7a75af651b6b424129515a8991b5afb15c62dba3
(cherry picked from commit 12ba113894ec8ad7c24913a0a09ea70047d25353)
(cherry picked from commit 7e58c9145d71ba92053ad6629f910456566cfea9)
2020-05-25 10:22:38 +02:00
TreeHugger Robot
7b42f2d3e5 Merge "Tuner JNI: fix filter.read and DvrSettings" into rvc-dev 2020-05-22 00:53:38 +00:00
shubang
e8cb82c545 Tuner JNI: fix filter.read and DvrSettings
and some minor changes

Test: make; cts;
FIX: 157083380
Change-Id: I9dcd25594ab27f31bc417eefbb6424bec49fc27f
2020-05-20 18:51:06 -07:00
Jean-Michel Trivi
803c3158b1 AudioService: permission for volume adjustment to lowest values
Define an attenuation threshold under which the
MODIFY_AUDIO_SETTINGS permission is required to adjust volume.
  Verify permission at the interface of audio service, and
propagate this information so its used when getting a valid
index during a volume adjustment or set.
  Make the audio service dump display the min index when it
differs from the normal min index.
  Enforcement is only for STREAM_ALARM.

Bug: 137015603
Test: use POC app in bug, verify ALARM volume not at 1 with \
      adb shell dumpsys audio
Change-Id: I7ccb50e314bb0e27ba25346eab9cdd3e4dd1dceb
2020-05-20 08:57:50 -07:00
Henry Fang
d026dffb65 Merge "Added 1st atom for Tuner Metrics" into rvc-dev 2020-05-19 02:44:27 +00:00
Gopalakrishnan Nallasamy
123e60ed82 MediaMuxer:Maintain proper state after stop()
MediaMuxer.java: move to stop state even if nativeStop() throws
exception.
android_media_MediaMuxer.java: revert recent change, throw
only runtime exception for any error as it used to be. Log error now.

Bug: 156649746

Test: atest android.media.cts.MediaMuxerTest
      atest android.media.cts.MediaRecorderTest
      atest android.mediav2.cts.MuxerTest

Change-Id: I82e16fcb065a40f25036bbad181798f1fd36132b
2020-05-18 16:45:16 +00:00
Eric Laurent
bf01a79a83 Merge "AudioService AudioDeviceBroker: fix speakerphone control" into rvc-dev 2020-05-16 03:58:21 +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
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
Amy Zhang
5f8498bcf1 Add support for TvInputManager.acquireTvInputHardware CTS
1. Add a test api in TvInputManager to add hardware device for testing
2. Add Shell permission for TV_INPUT_HARDWARE
3. Add TUNER_RESOURCE_ACCESS permission for TvInput Framework.

Test: atest android.media.tv.cts
Bug: 155114656
Change-Id: I227f13cbf14532d8732729412ae9c2518755ef02
2020-05-14 17:37:52 -07:00
Henry Fang
e316ab61e6 Added 1st atom for Tuner Metrics
Metrics review request b/155199791

This Cl follows up http://ag/c/11203604/8

bug: 154661158
Test: Manual
Change-Id: I7d41a71c724b7f5395d213dc63000739e55b4a43
2020-05-15 00:16:33 +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
81fd503701 Merge "MediaRouter2: Fix getRoutes() returning an empty list" into rvc-dev 2020-05-12 07:42:33 +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
acc2acafe7 Merge "Support query encapsulation information." into rvc-dev 2020-05-08 18:26:31 +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