This is needed to implement the MTP MOVE_OBJECT operation.
Bug: 66679910
Test: Move objects and folders, verify mediastore is consistent
Change-Id: I2f4f0c43134fb3ff82745166c051712cc1736b7f
Since the AudioPortEventHandler runs in application's main thread, it
may cause ANR if there are a lot of setForceUse calling by the
application continually in a short time. The root cause is that there
may be a lot of audio port event from the native side when there are a
lot of device switching request. In this case, updating audio port cache
may take a long time due to inconsistency between audio port generation
and patches generation.
To solve this problem, we only check the generation once when ports and
patches are both requested to return earlier. In the meantime, we only
repeat the last audio port event since we will refresh the ports cache
every time when we receive the event.
Bug: 64952619
Test: keep switching output device in hangout video/voice chat
Change-Id: I3164c4e331950a481b76ce890d8c1403fd9b98ee
While update audio routes, MediaRouter had an access to the variable
of MediaRouterService.mGlobalBluetoothA2dpOn, which was updated in
the callback of AudioRoutesObserver.dispatchAudioRoutesChanged().
However, since updateAudioRoutes() was also called by the same
callback, mGlobalBluetoothA2dpOn could be used in updateAudioRoutes()
before its value was updated.
Bug: 65629167
Test: passed MediaRouterTest
Test: Manually confirmed that the issue is fixed with this CL
Change-Id: Id0034996a51a6d8d1e8bd9d2c6ca386aabbb8baf
Merged-In: Id0034996a51a6d8d1e8bd9d2c6ca386aabbb8baf
While update audio routes, MediaRouter had an access to the variable
of MediaRouterService.mGlobalBluetoothA2dpOn, which was updated in
the callback of AudioRoutesObserver.dispatchAudioRoutesChanged().
However, since updateAudioRoutes() was also called by the same
callback, mGlobalBluetoothA2dpOn could be used in updateAudioRoutes()
before its value was updated.
Bug: 65629167
Test: passed MediaRouterTest
Test: Manually confirmed that the issue is fixed with this CL
Change-Id: Id0034996a51a6d8d1e8bd9d2c6ca386aabbb8baf
Bug: 64686424
Test: Connect to carkit and see that NowPlayingChanged only gets sent when
the queue changes, run cts test
Change-Id: I58c9dd0bf976485a2efefd042cd667ee433e07e1
(cherry picked from commit 6edb68bea6)
When system audio routes are changd, updateAudioRoutes is called, and
it selects a system audio route even when a none system route was
seleted.
That makes the selected route be unselected and this CL fixes it.
Bug: 65403568
Test: manual tested that the issue is fixed
Change-Id: I5df9d3e5f68cfd40fdb625937f9a8e16f4308e16
The property name that is listed in xml files is
"bitrate-modes", not bit "bitrate-control".
Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice
Bug: 65769027
Change-Id: Ifef752e05cac3b868cee76ce69f1763c075f10ec
Synchronize changes to mIPlayerShell after release of corresponding
player.
Flush binder commands when a player is released, in AudioService
and in the clients that have an AudioPlaybackCallback implementation.
Do the same in MediaSessionService, which directly implements
the IPlaybackConfigDispatcher interface, without going through
the AudioPlaybackCallback registration and notification
mechanisms.
Test: adb shell /system/bin/write_sine_callback -m2 -pl
Bug: 65450109
Change-Id: I2f0697e0e164283284ce30d2cc736c4f8df270c4
setCallback(null) is supposed to clear registered callbacks.
Previously, setCallback(null) doesn't remove pending callback messages
and so belated callbacks are called quite frequently after
setCallback(null) is done. This CL reduces major number of such cases by
removing pending callback messages.
Bug: 63446360
Test: Ran cts test
adb shell am instrument -w -e class \
android.media.cts.MediaSessionTest#testSetCallbackWithNull \
android.media.cts/android.support.test.runner.AndroidJUnitRunner
Change-Id: I7192b0a61a2114390f10734bbb48aeac56a19fe3
This CL cleans up connectionRecords when binder dead and the connection
is lost.
Bug: 65132577
Test: check the number of ConnectionRecord, kill the media app, check
the number again.
Change-Id: I8b31745bcee220b9e70c3f43d7fc9d8dc3f6b83a
As part of migrating native binder services to AIDL, this moves IPlayer.aidl to
the frameworks/av/ project and links in the new AIDL generated binder library to
the JNI libraries.
Test: run cts --module CtsMediaTestCases
Bug: 64223827
Change-Id: I7e346a471b98c78ceb35dceed9e6c0df1000cfb1
The default phone speaker, bluetooth audio devices, and wired audio
devices are handled as system audio routes. When an app starts to
make sound to a system audio route, the system audio route will be
selected with the following order.
1. The slected route by the app after the latest connection of
an audio device.
2. The lastly connected audio device.
3. The default phone speaker if not connected.
Bug: 64811580
Test: Passed MediaRouterTest, manual
Change-Id: I77badb14596bc661c44237957504164f5476e595