System API for an external audio focus policy. Extends
the system focus listener with interception of
focus requests and abandons. Adds method for the focus
policy to dispatch focus grants and losses.
Test: gts-tradefed run gts -m GtsGmscoreHostTestCases -t 'com.google.android.gts.audio.AudioHostTest#testFocusPolicy'
Bug: 30258418
Change-Id: If408569a2dce07a774e0e2f1be9f1af8e426d2d3
Adding new permission for changing accessibility volume
to allow system UI to change it. Also providing audio
manager with a whitelist of bound accessibility service
uids so it can allow servics to change the volume.
Bug: 36569297
Test: Adding CTS test in linked CL.
Change-Id: I4f327e3a251fc3780c5957f41217c2ef5bb8b16e
Here's the new media handling logic.
1. If the foreground app consumes the media key event
(Activity.onKeyDown/Up() or Activity.setMediaController()),
we stop here.
2. Find the media app whose AudioPlaybackConfiguration becomes
PLAYER_STATE_STARTED lastly across the boot. The media app is the app
with the media session.
- If its session is still alive, send the media key event
to the media session.
- If its session has been released but the session set the media
button receiver, send the media key event through the media button
receiver.
- If it has multiple media sessions, pick the media session whose
PlaybackState matches with the AudioPlaybackConfiguration's player
state.
3. Stop here. Don't try revive any other app.
This approach has two limitations.
1. If an app has multiple AudioPlaybackConfigurations and/or
media sessions, the MediaSessionService may pick the wrong media
session to send media key events.
2. If an app with a media session plays sound effects differently from
the SoundPool class, the MediaSessionService would consider the app
as the lastly played media app.
Bug: 33032080
Test: Manual tests as follows
1. Checked that the lastly played app receives the media key events
although the app's media session doesn't report its playback state.
2. Checked that the lastly played app receives the media key events
although the app's media session is released.
3. Checked that the lastly played app doesn't receive the media key
events if its playback is remote.
Change-Id: I1fd6f9eee0750da4dea9fcc7401fdb1c3f249a72
Translate ServiceSpecificException from aidl to CAS-specific
exceptions. Also, throw CAS specific exception for descramble().
bug: 22804304
Change-Id: I6d68c335c87fbb95fd8cc227e432eed4e5951550
By adding a CONNECT_STATE_DISCONNECTING, we could prevent
the ConnectionCallback to be called after disconnect().
Bug: 36106103
Test: manual using Support4Demos
Change-Id: Ia6f9864dce90b1e58437c07bbcaf6300e162ab92
This limits excessive logs from MediaRouter and MediaSessionRecord
- MediaRouter: Leave log only if there's change in the audio route.
- MediaSessionRecord: Leave log for the controller callback instead of
dumping verbose stack traces.
Bug: 36497125
Test: Manual test
Change-Id: Ie0fe9f33388d1aa9f25c26b3b3f7c71fec409ba8
Addressed API council notes: document some missing default values
of AudioFocusRequest builder, remove getters on lister and
handler.
Fix missing support of custom Handler for focus listener.
Integrate focus lock feature from AudioManager SystemAPI into
new AudioFocusRequest class and builder. Deprecate system
methods for focus requests that don't use AudioFocusRequest
Switch to a ConcurrentHashMap in AudioManager instead of a
lock and HashMap to maintain the list of focus listeners
for each AudioManager instance.
Clean up: all local IAudioService references can be made final.
Add missing @Override for the Stub implementations.
Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.AudioFocusTest
Bug: 30258418
Change-Id: I9e903379a607c723a2620821200547de679231d1
When stopping AppOps watching in the player release, catch
any exception to be safer.
Test: see bug repro steps
Bug: 36240191
Change-Id: I8e11cfc12c305878699dc57131e35e2a98eb7b16
The volume handling of the default route of the devices which use
fixed volume should be set PLAYBACK_VOLUME_FIXED instead of
PLAYBACK_VOLUME_VARIABLE.
Bug: 36492333
Test: passed CTS of MediaRouterTest
Change-Id: I4bc42063b71ae9087b36f1529b7689b96d9e53e7
The type of channels should not be changed once it's set.
Blocks this column from being modified.
Test: cts-tradefed run cts -m CtsTvTestCases
Change-Id: I9f7c99b4693db5553e85a1cab5cf1130425630c7
Integrates the API Council's feedback into the Media Metrics
related APIs.
-- return types for the getMetrics() calls
-- definition of keys in the set of data that comes back
Bug: 35811992
Test: booted, CTS subset, checked dumpsys media.metrics output
Change-Id: Ib750f9631bd3453be3132760273ccfff0a891f88
Add more debug information inside the IAEs thrown during
audio parameter check.
Test: try invalid params for recording, read exception text
Bug: 34119793
Change-Id: Ic4f36fd6ef99c18107e3204ef5e25cc1bc9e704d
android::IGraphicBufferProducer will now become a hybrid
interface on
top of the HIDL interface
android::hardware::graphics::bufferqueue::V1_0::IGraphicBufferProducer.
Test: With CtsMediaTestCases.apk installed,
adb shell am instrument -e size small -w
'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Bug: 33854657
Change-Id: Ia8914ea49d2acf3d43682982a164d7e10f7b8542