Playing status of audio source is checked using the native handler
not 0.
However, if AudioSystem#startAudioSource fails, the native handler
returned is not 0, but an error code.
In fact AudioPolicyManager sets the PORT to NONE (0) and sets an error
status.
JNI layer transforms the failure status into a native handler returned
to the caller.
Bug: 186088557
Test: make
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
Change-Id: Iaa920c073885c2556a93a1b5ae23467fa6ffad4f
New API to add/remove a listener for changes to the audio
mode (see existing AudioManager.getMode() API).
Bug: 184891081
Test: atest android.media.cts.AudioModeListenerTest
Change-Id: I0be07d577c7497066b61a1573752343227605fd7
Add the possibility for privileged applications to
share part of their audio capture history with another app.
A privileged app with permission CAPTURE_AUDIO_HOTWORD can share part of
its recent capture history on a given AudioRecord with the following
steps:
1) Specify the maximum time in the past that will be available for other
apps by calling setMaxSharedAudioHistoryMillis() on the AudioRecord.Builder
when creating the AudioRecord
2) Start recording and determine where the other app should start
capturing in the past.
3) Call AudioRecord.shareAudioHistory() with the package name of the app the history
will be shared with and the intended start time for this app's capture relative to
this AudioRecord's start time.
4) Communicate the MediaSyncEvent returned by shareAudioHistory() to the other app
5) The other app will use the MediaSyncEvent when creating its AudioRecord by calling
setSharedAudioEvent() on the AudioRecord.Builder.
6) Only after the other app has started capturing can this app stop capturing and
release its AudioRecord.
Bug: 183705547
Test: regression on capture use cases
Change-Id: I5beba6c1e489148a14ba86165b8ef2fdc78c802a
China DTMB digital TV.
See SJ/T11368-2006
“Specification for multichannel digital audio coding technology”.
Test: atest AudioFormatTest
Bug: 185950819
Change-Id: Id6078e65941020a73f8a43017f480574c2a78999
- Add definitions for the front bottom channels. The name
of the definitions are standardized in ITU-R BS.2051-1.
- Add definition for 13ch mask which consists of surround 5
channels, top 5 channels and bottom 3ch channels. This
channel mask is ideal speaker layout used by Sony 360
Reality Audio. Virtualizer can place individual sounds in
a 360 spherical sound field from these channels on any
headphones.
Ignoring checkstyle warning, "'|' should be on a new line",
to keep existing codestyle.
Bug: 185100731
Test: atest AudioFormatTest
Test: Play wav with 13ch mask after OUT_CHANNEL_COUNT_MAX to 24
Change-Id: I2b4deaac740a08ae3b1b8d8453650a876e2d6206
This CL resolves API reviews on system APIs on MediaRouter2.
1) It checks permission when registering the MediaRoute2Manager
in system server. Therefore, app cannot bypass the permission
checks via reflection.
The system api calls will be no-op without permission.
2) It adds @RequiresPermission annotations to related APIs.
Also, this CL changes the required permission
from MODIFY_AUDIO_ROUTING to MEDIA_CONTENT_CONTROL,
as the media routing can be applied to video, not only to audio.
Note that MediaRouter2#getInstance(Context, String)
does not throw SecurityException anymore.
Bug: 183428114
Test: atest android.media.cts.MediaRouter2Test
atest android.media.cts.SystemMediaRouterTest
(MediaRouter2ManagerTest is already broken, and
that will be handled out of this CL.)
Change-Id: I55013a5b4b954ca1c8e2adb586f49f01103563db
isForeground is not a good approach to indentify current channel info
And add a permission for tuned info.
Bug: 180482268
Test: atest CtsPermission2TestCases
Test: atest TvInputManagerTest#testGetCurrentTunedInfos
Change-Id: Ib1c1f2da719336ae856684e843b06f8b9b442723
1. Added the IntDef annotation for PlaybackStateEvent#getState
2. Made event construtors private go/android-api-guidelines#parcelable-creator.
3. Improved the JavaDoc of time-related methods
4. Added the JavaDoc for TrackChangeEvent#getTrackType
5. Made MediaMetricsManager final
Fix: 183940704
Fix: 185121406
Test: atest android.media.metrics.cts
Change-Id: I9f1edc23b4e78e3ebee358945ce16539b83e1830
There is no longer a requirement for IEC61937 streams to be stereo.
For high bit-rate streams they may have 8 channels.
Test: create AudioTrack with 8 channel IEC61937
Bug: 31916412
Change-Id: I4dfd3e78041a81601d5bde47a4deaa0313066028
Export API in AudioMixingRule#Builder to allow application specify the mix type when using UID mixing rule.
Bug: 169964607
Test: atest com.google.android.gts.audio.AudioHostTest, manual testing
Change-Id: Icf7c83f280aeec7b11aa3bc43fb31657c863e7fd
Update setHotwordMode to setHotwordModeEnabled and set/clear the hotword
mode based on the boolean flag passed to setHotwordModeEnabled. This is
to meet the API requirements. Also update the references to this API.
BUG: 180419637
Test: Able to setHotwordModeEnabled from AGSA application. Confirmed
HAL receives the flag and audioSource correctly in open_input_stream.
Change-Id: Ia01e8b5f3edaeafc9617846efc247635005456a8
Rename PlaybackState#isActiveState() to #isActive()
and make it public.
This is according to API review.
This CL also includes STATE_SKIPPING_TO_QUEUE_ITEM
as an active playback state.
Bug: 184612506
Test: build successful && atest PlaybackStateTest
Change-Id: I4757038d63adc3478f19f177265ebd198fb5f424