As with this CL, media apps can get the list of available routes using
MediaRouter2.getRoutes() or MediaRouter2.Callback.onRouteListChanged().
For that MediaRouterService notifies MediaRouter2 of providerinfos.
This CL also clarifies provider info notification logic.
1) When a new client or a new manager is registered, it will be
notified.
2) When a provider info is updated, it will be notified.
onRouteListChanged will be called for a newly registerd callback.
Fixed a bug that MediaRoute2ProviderProxy didn't report state update
when the provider is disonnected.
Test: atest mediaroutertest
Change-Id: I50f5c3cabce80e7fb0a1b5596883c35911d6f122
As part of getting MediaProvider to compile against supported APIs,
we're moving to the call() method instead of IMediaScannerService.
Bug: 137890034
Test: atest --test-mapping packages/providers/MediaProvider
Test: atest cts/tests/tests/media/src/android/media/cts/MediaScanner*
Change-Id: Ie959daa7576214024150faf84b44cdba00119257
Now it uses mLock to synchronize mCallbackRecords, mControlCategories,
and mClient instead of enforcing main thread.
Also, check concurrency of MediaRouter2 and MediaRouter2Manager.
This CL also removes control category parameter from addCallback(registerCallback)
not to permit two callbacks in an application to have different control categories.
Function names are changed from add/remove callbacks to register/unregister callbacks
to follow the API guideline.
Test: atest mediaroutertest
Change-Id: I40f2bc45f7d108416182b68b4ae23127f8bb2eb4
There has been IFD_FORMAT_IFD = 13 but IFD_FORMAT_NAMES[13]
was not defined, which could throw ArrayIndexOutOfBoundsException.
By providing proper name, we can prevent the exception.
Test: atest exifinterfacetest
Change-Id: Ib11b83a55d54ad2fc6377bb5cc55f6c2fdbe231c
cherry-pick from aosp/1015050, aosp/1079822
1. Currently, calling ExifInterface#saveAttributes with StrictMode
that detects unbuffered I/O throws an exception. Change
saveJpegAttributes to take BufferedInput/OutputStreams
as parameters.
2. Change saveAttributes so that when an exception is thrown, the
original image file is not deleted but restored.
3. Distinguish between two identical exception messages in
saveAttributes.
4. Add test for checking StrictMode.
Bug: 137139466
Test: Run atest CtsMediaTestCases:android.media.cts.ExifInterfaceTest
Change-Id: I9e4111ec35740198bdbdba0c9b609875b6231474
It used "this" as a lock object to guard mListeners. but "this" is
pointing to mHandler in handler thread.
This causes the IndexOutOfBoundsException.
bug: 138951761
Test: manual
Change-Id: I826c7c68ecff4fc0d39addd3d56bc989e00848bc
FLAG_MUTE_HAPTIC will be set in AudioAttributes.mFlags. But it should
only be controlled by mMuteHapticChannels in AudioAttributes.Builder.
When copying flags in AudioAttributes.Builder, FLAG_MUTE_HAPTIC should
be ignored.
Bug: 138807243
Test: run SoundPoolHapticTest
Change-Id: I21395399746353b947355b89e5dbd379f42f5d20
This CL adds capability to media route 2 info, which can be used
to get available routes for each app, which set control categories.
The test for control category is changed to test getAvailableRoutes().
Test: atest mediaroutertest
Change-Id: If93d64f02b4868b5e04b737431291b18a52177de
Some race condition can cause AudioRecordingMonitorImpl to call
getPortId() on the client object after it has been released causing
an exception to be thrown by the JNI.
Test: Use audio Recorder app and check that no exception is thrown
when recording stops
Change-Id: I6cc1aee0a2ccae879e2cb5df7af757f33436d1f3
Seamless transfer for a single provider case and two providers case
should be dealt with in different ways.
For a single provider case, the provider can handle transfer and returns
the result of transfer.
For multiple providers case, the media app handles the transfer.
This CL covers seamless transfer within a single provider.
If a user requests semless transfer in System UI, MR2Manager.selectRoute
should be called and this request is sent to MediaRoute2ProviderService
that can handle seamless transfer internally.
The new test, testSingleProviderSelect() in MediaRouterManagerTest tests the path for
seamless transfer and ensure transfer request is handled by a provider.
From this CL, we use packagename instead of uid to select app for seamless transfer.
This is required to handle unlaunched apps that don't have uid.
It would prevent to use media router 2 in a multi-user case, that will
be supported by another CL.
I also added onUnselectRoute in MediaRoute2ProviderService, which is
essential to notify a provider that a media app stopped casting.
Bug: 136775407
Test: atest mediaroutertest
Change-Id: Ie3d0e988a72eedea6036f465454e661c424a0495
Test: manual, connect with MTP and PTP
Change-Id: I33128db25b8aae60df7854c61fc2a3873a1bced9
(cherry picked from commit f7ec16802c)
(cherry picked from commit efb865ace2)
(cherry picked from commit 5954d210d3)
Test: manual, connect with MTP and PTP
Change-Id: I33128db25b8aae60df7854c61fc2a3873a1bced9
(cherry picked from commit f7ec16802c)
(cherry picked from commit efb865ace2)
In Q, these APIs were either:
- removed from the greylist entirely without good reason
- Moved to the restricted greylist without any public alternative
information added
So they are being moved back to the greylist for Q.
Test: Treehugger
Bug: 136102585
Change-Id: I6518440a7b0de8292ad05b4df9f0f9580d18b2a5
Member variable of mVideoActiveFormatDescription is not compared
on equals API. The variable should be compared on the equals API.
Test: build
Change-Id: Ib8fde63afb0504140f34ebd695f4524db9c74748