Previously when MediaRouter2#transferTo(route) is called, it directly
released current controller. This CL changes the release timing to
when the actual transfer result comes.
Also, this CL prevents a RoutingController instance from being passed
both to:
- As 'oldController' in onTransfer()
- As 'controller' in onStop()
These works make TransferCallback easy to use: when onStop() is called,
app can just stop playing media.
Bug: 154680146
Test: Passed CTS / Checked logs in onTransfer/onStop
with output switcher
Change-Id: I4449021f98ca887252e05398356df9b53592c145
This CL clears routes when the last callback of MediaRouter2Manager
is unregistered. By doing this, we can ensure
MediaRouter2Manager#getAvailableRoutes() returns correct routes
during at least a single callback is registered.
A test for the behavior is added as well.
This CL also fixed a bug that unregistering a callback from MediaRouter2
disconnects it when multiple callback is used.
Bug: 153515567
Test: atest mediaroutertest & cts test & manually
using MediaRouter2Demo and Sample OutputSwitcher to see
if forgotten BT device is correctly removed.
(w/o this CL forgotten BT device remains)
Change-Id: I31a5001115f1f163c8971bbd906516551b860252
When MR2Manager requests to create a routing session, it should pass
session hints to the target provider.
This CL adds a logic that MR2Manager asks media router instance to
get session hints to be passed to the provider.
Bug: 152851868
Test: atest mediaroutertest
Change-Id: Ib421f61f663090c6ed95c8b1a2f7deeb80e5be16
Fix access by reference to listener list outside of
synchronized block by cloning the list.
Bug: 154341343
Test: AudioPolicyTest#testAudioPorts, AudioManagerTest#testVolumeGroupCallback, AudioRoutingTest
Change-Id: I1f0fd62c1894dc0dbb07b01f2fd78899e48b4932
Gamepad-specific API is a separtate input path from standard "remote"
service. Specifically it adds:
- openGamepad that creates a virtual input device with
gamepad-specific suport
- send gamepad keys
- send gamepad axis updates, which support joysticks, analog triggers
and HAT axis (as an alternative to DPAD buttons).
Bug: 150764186
Test: atest media/lib/tvremote/tests/src/com/android/media/tv/remoteprovider/TvRemoteProviderTest.java
Test: flashed a ADT-3 device after the changes. Android TV Remote
on my phone still worked in controlling the UI.
Merged-In: I49612fce5e74c4e00ca60c715c6c72954e73b7a3
Change-Id: I49612fce5e74c4e00ca60c715c6c72954e73b7a3
(cherry picked from commit 9b9f556af1)
This can unblock tune/scan CTS test cases.
If a frontend resource is acquired in a test case and not released,
it cannot be used by another test case.
Bug: 150952758
Test: atest android.media.tv.tuner.cts.TunerTest
Change-Id: Ib9bab003fc81fe008091a9d1aaefc43e454c3230
Bug: 153934282
Test: Checked the logs that the method is called only once
Also ran CTS / atest mediaroutertest
Change-Id: I0c27ecd5b1c83be241fcebe71a7e0ea9f1c9e349
Since ExifInterface supports multi-thread, SimpleDateFormat
should be thread-safe.
Bug: 152801859
Test: N/A
Change-Id: I9ad5a035162f5e3caff2a2d4aaff2ae0cd870cd2
Fuzz testing cause out-of-memory errors
when passing very large port counts.
Now we check to make sure the port count is in a resonable range.
Bug: 135639926
Test: any MIDI test will exercise this code
Test: https://source.android.com/devices/audio/midi_test.html
Change-Id: Ic5dedc1eda86ff86a73a1da66ee6630c9662ceb8
Add @TestApi for the class so some methods and
constants can be visible to test API.
Also @hide for all other members of the class
that are not @TestApi, as they are exposed to the
test API visibility.
Bug: 136121584
Test: run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioProductStrategyTest
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioVolumeGroupTest
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioVolumeGroupChangeHandlerTest
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioManagerTest#testPermissionsForVolumePerAttributes
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioManagerTest#testGetAndValidateProductStrategies
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioManagerTest#testGetAndValidateVolumeGroups
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioManagerTest#testSetGetVolumePerAttributesWithInvalidAttributes
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioManagerTest#testSetGetVolumePerAttributes
run cts-dev -m CtsMediaTestCase --test android.media.cts.AudioManagerTest#testVolumeGroupCallback
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Change-Id: Iff9abda2cf971d9c234dcf7df7c2b9a4ad5294c3
Allows the multiple audio focus that requested with AUDIOFOCUS_GAIN.
Test: atest SettingsProviderTest
Test: Manual - play music on A app
Test: play music on B app // play music on A app and B app
Test: receive a call // stop music
Test: end a call // play music on A app and B app
Test: receive a notification // ducking all music
Bug: b/135749683
Change-Id: I4bdd2cdc5e543674f331fc000bd24fd30499bdc3