This reverts commit a8f97ffdaa.
Reason for revert: break git_master of errorprone target
out/soong/.intermediates/frameworks/base/services/core/services.core.unboosted/android_common/errorprone/srcjars/frameworks/base/services/core/java/com/android/server/audio/AudioService.java:4710: error: [EqualsNaN] == NaN always returns false; use the isNaN methods instead
MIN_STREAM_VOLUME[AudioSystem.STREAM_ALARM], deviceForAlarm) == Float.NaN) {
^
(see https://errorprone.info/bugpattern/EqualsNaN)
Did you mean 'if (Float.isNaN(AudioSystem.getStreamVolumeDB(AudioSystem.STREAM_ALARM,'?
Bug: 157108450
Change-Id: Icf74dcbefccee6138473101e8dc23fba35faf5ce
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: I083a26fd8eeebd4e5434ed02a4a803cbb920ab84
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
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
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
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
By doing this, calling getRoutes() after instantiation will not return
an empty list.
Bug: 156319555
Test: Passed CTS
Change-Id: I4e5158b89d54e06f36dc37a3ca345849f0c91440
With this CL, some methods such as getAllRoutes, getActiveSessions
can be used without registering a callback.
Bug: 155042836
Test: atest mediaroutertest
Change-Id: Iba38d73a95c1d184bc89ff91d128b00109029d0a
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
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
Translate KEY_ATMOS_PRESENT from Key<Boolean> to Key<Integer>
for JNI handling.
Test: AudioMetadataTest#testFormatKeys
Bug: 155392886
Change-Id: I69abbc451cdc6dfd23bf3d5d3a146ba884b9026e
This CL does following:
- MR2Manager#getRoutingSessionForMediaController is added
- MR2Manager#getAvailableRoutesForRoutingSession is added
- Add a workaround for provider to provide a routing session
not requested by the user (RCN case)
Using the added methods, we exepect System UI to implement UX easily.
Bug: 154780833
Bug: 152582294
Test: It is tested manually with two demo APKs. MediaRoute2ProviderDemo
app is updated to enable the user to create a routing session w/o
MediaRouter2 clients and Sample Output Switcher is updated to use the
new APIs. With updated APKs, transfer from cast to cast (Variable
Volume1 -> Variable Volume2) is enabled.
Change-Id: I03c261c1779725f43933bacad429e1a22f602818
This CL:
1. Finish the logic in TIHM to utilize the TRM for a client priority check.
2. FInish the TRM isHigherPriority API to allow the TIHM to compare the
client priority.
3. Finish the TRM isForeground method to check if a process is
foreground or not.
3. Add unit test for TRM isHigherPriority.
Test: atest com.android.server.tv.tunerresourcemanager
Bug: 155339425
Change-Id: I3887ccad31195d3386f1fc6b3de3e641df91092f
Previously, we generally required fully qualified names for referring
to inner class constructors (like #Notification.Builder()) despite that
not being valid javadoc. Now, we properly support #Builder() syntax and
the old syntax will error.
Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ib2e4360493275b79c72487ee1cb173bb5e0fd35f
Merged-In: Ib2e4360493275b79c72487ee1cb173bb5e0fd35f
(cherry picked from commit 4c4aa41272)
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.
To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
- worked around by fully qualifying the constructor
Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
(cherry picked from commit e0624c7a40)
Under the new MtpStorageManager design,
media info like MP3 Track title, album and artist, Genre, etc
can not be retrieved via MTP
by Windows Media Player, Linux Rhythmbox and Some Car Kits
Bug: 112635346
Test: atest MtpTests
Test: atest MediaProviderTests
Test: Manual test: Windows Media Player
Change-Id: I57a947fe6d3a583a0990be5bd2b0678f39d948f2
In RecordingActivityMonitor, compare audio device type and address to
know if legacy remote submix is active, which requires querying audio
patches. When there is a recording callback event, the audio patches in
AudioManager may not be up to date. In that case, when getting a
recording callback event, reset audio port generation if the patch
handle is not found in the cached audio patches.
Test: repro steps in the bug
Bug: 144063329
Change-Id: Ife5c9a65243d2e85e4cd9480e3b415f8bfddc6f5
It will call back onSessionCreated or onRequestFailed with
the correct arguments.
Bug: 152932787
Test: manually by cast -> phone multiple times via Output Switcher.
It includes the case that the target route changes (phone -> BT).
Change-Id: Icc324f3e7d6dfde71faa6d3bc919be383e7a5216
Due to a binder limitation (b/150808347), any unexpected exception
thrown by a binder service while processing an RPC call, will be
silently discarded and the client will get back a default-initialized
result parcelable (i.e. in most cases, won't know that anything wrong
happened).
We work around this issue by throwing a ServiceSpecificException,
which does get delivered, having a special code to designate an
internal error. Errors resulting from a HAL malfunctions will result
in a HAL reboot, which leads to recovery.
Bug: 154089179
Test: Manual verification of basic error recovery scenarios by
injecting HAL error codes and crashes.
Change-Id: Ib5dbe08a362e545501c04204bebad5ab95f5d632
Fix issue with A2DP connection/disconnection during media
playback by modifying:
- how messages related to A2DP connection/disconnection are
removed from the AudioDeviceBroker message handler: have
.equals() be used when checking which object to remove,
and correct which class is used for the messages in the
queue:
* MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_*CONNECTED is
using BtHelper.BluetoothA2dpDeviceInfo
* MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT_CONNECTION
is using BtDeviceConnectionInfo
- locking: use the AudioDeviceBroker main lock, mDeviceStateLock
to synchronize posting events on the handler, and removing
some of those messages to avoid race conditions the thread
in which events are posted (e.g. BT's event thread) and the
AudioDeviceBroker handler thread.
Cleanup: annotation around audio formats from native defined
in AudioSystem, moved conversions to AudioSystem.
Bug: 142293357
Test: atest AudioDeviceBrokerTest
Change-Id: I2e8dc813354829fb1b2c7ca95ad395a14f8b70cf
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