After the user renames/moves a file/directory, the database of
MediaProvider is not updated. It causes that the file can't be
opened via MediaProvider. Use scanFile to instead of MP.update
for the file/directory.
Handle the .nomedia case for create/copy/move/delete/rename.
Scan the parent directory to update the database.
Test: atest MtpTests
Test: atest --test-mapping packages/providers/MediaProvider
Test: manual. 1. Move/rename the file/directory.
2. Open the file in DocumentsUI
3. create/copy/move/delete/rename for .nomedia case
Bug: 169300366
Bug: 171538933
Bug: 172029805
Bug: 170798581
Change-Id: Ia37be7a027bfe502e3f7c96babe5a5bbed5f942c
Merged-In: Ia37be7a027bfe502e3f7c96babe5a5bbed5f942c
(cherry picked from commit 20079f1064)
MediaRouterService maintained bindings to provider services
once those are established.
With this CL, it only binds services when there is a non-empty
discovery preference set by a foreground app or an app is casting.
This change may break output switcher, which enables transfer media
of background apps.
To alleviate that MediaRouter2Manager#startScan and #stopScan are added
so that system UI can force the service bind to the services and find
remote devices to cast.
Bug: 169575701
Bug: 172920557
Test: manually and CTS
Change-Id: I4a47fdb1c9fe05a04d26950485833c9cbfb91a69
(cherry picked from commit 9f889ca4e6)
(cherry picked from commit 602b168f99)
The package name is useful for permission validation. Currently, package
name is required when starting external vibration so that the vibrator
service can verify if the app has the permission to start vibration.
Bug: 175595599
Test: SoundPool tests in cts
Test: play audio-coupled-haptic file using SoundPool.
Change-Id: Ibfe414063a303118a5bb393d65ea5dc2323bf722
Merged-In: Ibfe414063a303118a5bb393d65ea5dc2323bf722
(cherry picked from commit de9005bab1)
AudioEffect was fixed to remove a call to AudioEffect::set
away from the constructor.
Bug: 162323621
Bug: 174222126
Test: repro steps from the bug
atest android.media.cts.VisualizerTest
Change-Id: I90ac6e4fe0a1229758a98a63a3b7810de60469be
Merged-In: I90ac6e4fe0a1229758a98a63a3b7810de60469be
This allows headless media applications to access the location if they
have the permission and is needed for AAOS apps in particular.
Bug: 169242810
Bug: 156904507
Test: manual with AAOS Media app
Change-Id: I1196718638fba336a815809578f643814545baf4
The package name will be used when starting external vibration. The
package name will be sent to vibrator service to check if the
application has the permission to start vibration,
Bug: 165910728
Bug: 162343845
Test: atest AudioTrackTest MediaPlayerTest
Test: start audio-coupled-haptic playback
Change-Id: I04b4711d11ab5f0f0716ea4c5e1c0f754fe834bb
Merged-In: I04b4711d11ab5f0f0716ea4c5e1c0f754fe834bb
MediaProvider added a restriction in R for apps targeting SDK 30 to
not allow .tmp files in image file directories such as "Pictures" and
"DCIM". This CL renames the temp file to avoid this restriction.
Also added test to check for writing to FileDescriptor instances.
Bug: 160874777
Test: atest CtsMediaTestCases:android.media.cts.ExifInterfaceTest
Also tested with an image file inside /Pictures
Change-Id: Iedb548651c0048b0aecc4b34e9c94f778cf5d1e0
(cherry picked from commit 5abacddfc3)
A metrics for audio mode changes and failure to release IN_COMMUNICATION
mode when inactive.
Bug: 153934174
Bug: 161444687
Test: repro steps in Bug and verify logs and metrics
Change-Id: Ib3beab2e8b64e7354ff1a32f04561e7b95f61855
TRM is checking input parameters and won't allow null executor.
Use context main executor to call Tuner Resource Manager (TRM)
Also fix ConcurrentModificationException when use HashMap.forEach to free element in hashmap.
Test: atest MediaCasTest
bug: 161391585
Change-Id: Ie5111b46b5b601f0a5b56e5828d79771e153a210
This avoids buffers piling up in the ImageWriter queue with no way to
free them.
Test: Camera CTS
Bug: 150658436
Change-Id: I70b10ddaa75aa9ab29f6ad7de9871a634a88813e
A regression was introduced by d0c4968 which prevented @SystemApi
flags to be set in the builder of an AudioAttributes, causing
FLAG_BYPASS_INTERRUPTION_POLICY and FLAG_BYPASS_MUTE to get
ignored.
Note that even though any client can set System flags, they will
be discarded and ignored server side in the audio policy service if
the caller doesn't have the permissions.
Bug: 154205921
Test: fire alerts with packages/apps/CellBroadcastReceiver/tests/testapp
Change-Id: I9d593787c18a510aa702dc0da85254f0d9574f11
There are cases that a newly create session does not contain
the requested route. (e.g. static group)
This CL removes check that disallowed those cases.
Bug: 159881597
Test: Run CTS, atest mediaroutertest and manually
using support v7 demos, which is edited to call
notifySessionCreated with member routes selected
Change-Id: I30741d2f3587d0fa9ee5a10fdb8fab9e0d82c721
LinearBlock close the fd why it's recycled, so we need dup the fd to create a LinearBlock.
bug: 159753135
Test: Manual
Change-Id: Ic2b4e3c535e60983b2a4fc5f5ce6e809731fd581
This change does the following
0. Robustly enforce setDeviceVolumeBehavior.
Prior to this change, setDeviceVolumeBehavior could have been overridden
in cases like HDMI_CEC enable/disable, HDMI re-plug, etc.
1. Persist setDeviceVolumeBehavior across AudioService restarts and
system reboots.
Prior to this change, setDeviceVolumeBehavior was lost on AudioService
crash/restart, or system restart.
2. Persist software volume across reboots.
Prior to this change, HDMI_OUT device was initialized as a "Fixed"
Volume device and then updated to either full volume device or
"variable" volume device based on the outcome of HDMI-Sink's CEC
capabilities. However, when connected to a non-CEC capable sink this
would result in audio resetting to 100% on each reboot.
3. Some refactoring around how mFixedVolumeDevices and
mFullVolumeDevices are updated in some instances.
Bug: 153193369
Bug: 155482023
Test: Locally on ADT3
Change-Id: I4adb38c64fe1ae7713992ab83acbd66bce4524a4
In order to allow media router to communicate with the old routing
controller for synchronizing media status during transfer,
this CL postpone releasing the old routing controller.
Basically media router should release the old routing controller by
itself when it's done with the old routing controller.
If it didn't, the old routing controller is automatically released
after timeout (30s for now)
This CL also clarifies "old routing controller" in onTransfer callback.
Now it is consistent regardless of who requested transfer.
A request from MediaRouter2Manager is handled by MediaRouter2 to
simplify session creation logic.
Limitation of this approach is that a routing session unknown to
MediaRouter2 can't be transferred to a different provider but it is out
of R scope so it's okay.
Bug: 158713035
Test: CTS test && atest mediaroutertest && manually transfer using
support v7 demos
Change-Id: I168af69e2a25240227aea0fd9e892eaa91e78ee3
When dealing with a pair of hearing aid devices are active,
a single "selected route" is not sufficient.
Instead, this CL introduces activeRoutes which can hold multiple active
bluetooth route and deal with them.
Bug: 152585170
Test: cts tested & manually w/ A2dp BT devices
Change-Id: I2c2b8967d9f221db73f9d3b9332de7c76d07a0f9
Remove todo, audio TV metadata still pending final update for rvc-tv-dev.
AudioDeviceInfo.getEncapsulationModes suppresses return of
AudioTrack.ENCAPSULATION_MODE_NONE.
Test: make docs and check
Bug: 147778408
Change-Id: Ia7da6c3805e42f7a6b9a3b18d44f4c4ef92171a4
From this CL, even for system routes (phone speaker, bt routes),
features are required to get notified of events on routes or to
get them as "available" routes.
By adding this, apps can disable cast -> phone feature.
Bug: 159090706
Test: cts test && atest mediaroutertest && manually
using support v7 demos such that
with LIVE_AUDIO : nothing changed
w/o LIVE_AUDIO : cast -> phone feature is disabled
unregistering callback : cast -> cast (media transfer) and
phone -> phone is only enabled <- this is
the expected behavior for apps that updates
AndroidX library
Change-Id: I4bd27eb1d4776b9cedb59b10e1bac5868d56d305
When an active BT device is changed, instead of just notifying that
the changed BT name, AudioService sometimes notify it with two steps.
1) Notify prev BT disconnected
2) Notify new BT connected
By not calling setBluetoothA2dpOn(false) when BT is disconnected,
we can prvent the unnecessary call of it.
Bug: 144784716
Test: manual
Change-Id: I31442204cd4dd4a78552e0f993e9dfa37d6fc03f
When a route changes its features, the returned getRoutes() can be
changed.
Bug: 159142641
Test: run support v7 demos manually to check onRouteAdded callback is
invoked
Change-Id: Icea855d631a566fd9129f98306e3ea8af4920764
This CL logs transfer between routes to easily track potential bugs.
Selecting a route was also logged in MediaRouter.
It also reverts the log level of SystemMediaRoute2Provider because
we resolved issues related to it.
Bug: 156996903
Test: N/A
Change-Id: I6d7e165a79679305fd21a378fd3ae35b941c17c6
MediaRouter2Managers' preferred feature didn't get cleared even when the
MediaRouter2 is unregistered/died. As a result, when an app is
reinstalled/relaunched, the routes for the previous process are still
shown in the MediaRouter2Manager.
This CL fixes the problem.
Bug: 158824569
Test: Passed CTS and mediaroutertest
Also tested with reinstalling support7Demos.
Change-Id: Ib5d84c41862177af32931e0d69b02f461105bba6