History log of /frameworks/base/services/core/java/com/android/server/audio/AudioService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4724ea7ef7bfe698cace7213772f866349bcc676 23-May-2017 Eric Laurent <elaurent@google.com> audio service: fix rapid succession of A2DP devices connections

commit dae476f7330 introduced a potential problem when a different BT A2DP
device is connected just after disconnecting one.

Bug: 37499793
Test: check connection to new BT A2DP device when one is already connected.
Change-Id: I8055844822fcc1640cca67fab2cba629c93f7cfa
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
bbe3e74457e7abeef4156380178ad1793ffe8c0e 29-Apr-2017 Eric Laurent <elaurent@google.com> AudioService: send AUDIO_BECOMING_NOISY intent when disconnecting USB

Bug: 37752052
Test: Verify music stops when removing USB headset
Change-Id: I6efd9e0532ea0569cfcab941a93e32395845201f
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
cdae476f7330375e2f6a653a84082b9fc49280f8 29-Apr-2017 Eric Laurent <elaurent@google.com> AudioService: more AUDIO_BECOMING_NOISY intent fixes

Fix more race conditions
Ignore condition on removed device being actually used for
music when in call.

Bug: 37687852
Test: Verify AUDIO_BECOMING_NOISY intent is sent in more corner cases
Change-Id: I024aa3a4a68d84ac620289720caf3a32fb2985b1
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
5205a35f7805aec1285e1a17a8e6dcb0e49f7e33 28-Apr-2017 Eric Laurent <elaurent@google.com> AudioService: fix missing AUDIO_BECOMING_NOISY intent

If Bluetooth service calls onBluetoothA2dpDeviceConfigChange() before
setBluetoothA2dpDeviceConnectionState(), there is a chance that the
first method fails leaving the A2DP device state disconnected in audio
policy manager while it appears as connected in AudioService causing a
failure to send the AUDIO_BECOMING_NOISY intent.

Bug: 37687852
Test: Verify AUDIO_BECOMING_NOISY intent is sent even if race
condition occurs.

Change-Id: I014d145e7da5e7d267991ffb2ff50626e71247eb
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
1ab43f6b03b8540b7867311a41d98e18ef033352 28-Apr-2017 Jean-Michel Trivi <jmtrivi@google.com> AudioService: unmute media on connection of new audio accessory

When plugging in a new audio device:
- if the device is considered an external accessory
- and media volume is muted
- and the media volume is non-zero for this device
- and it is used for media playback
then unmute STREAM_MUSIC.
Log when AVRCP absolute volume is supported.

Test: mute media volume with icon, insert headset then play music, music should not be muted
Bug: 30440012

Change-Id: I102f26c435fa5cbd1e1bc4c14f51629d3cc51fb3
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
c4a169cfb452ac4e8c7fb4ac153f66892ee0b16e 26-Apr-2017 Jean-Michel Trivi <jmtrivi@google.com> Merge "Audio focus enforcement: duck automatically apps for SDK O+" into oc-dev
461922fcfc8572415aa39c43c06afce685bd998d 26-Apr-2017 Jean-Michel Trivi <jmtrivi@google.com> Audio focus enforcement: duck automatically apps for SDK O+

Enforce automatic ducking only for apps written for an SDK target
level above 25 (N-MR1)

Test: play notification while Podcast Addict is playing, verify it pauses instead of being ducked
Bug: 37506138
Change-Id: Id7e01a92a51308bd7a3f24abc417d2434b532c12
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
efb859f2af21bcc4844274663ce4bf6eddc09c57 25-Apr-2017 Phil Weaver <pweaver@google.com> Merge "Allow a11y listeners to specify handlers" into oc-dev
910311b35603a9132d8b986806ca13499d60240f 21-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "audio service: simplify becoming noisy intent logic" into oc-dev
26d709fdfa473f1722b1ee08562262cb4cfeaaac 21-Apr-2017 Phil Weaver <pweaver@google.com> Allow a11y listeners to specify handlers

This follows recommended practice for listeners, and also
allows ViewRootImpl to register for callbacks on its own
handler, which can prevent crashes in apps that have
different threads managing the UI at different times (for
example the system process).

Bug: 37542371
Test: Adding CTS tests for new APIs. A11y CTS still passes.
Change-Id: I65db025275e153c20b20567346246d5bc13bf418
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
4cab9308fc73967f8085325b237d30978a7ba6da 31-Mar-2017 Phil Weaver <pweaver@google.com> Hide API to listen to a11y service state

Hiding and adding the requested return value, so if we
later decide to unhide it we'll be up to snuff for API
review.

Bug: 35764675
Test: Verified that the two features that listen, a11y
volume and the accessibility button on the nav bar, work
properly. Also ran accessibility CTS.
Merged-In: I47b62f2b4fd1ea4a7e697d20a3bb2c3201f6bcce
Change-Id: I4df6164772eb01b4f988c201f46c788eb7124511
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
9a5b262330191ada5a9724f58272a82e97ad4ccd 19-Apr-2017 Eric Laurent <elaurent@google.com> audio service: simplify becoming noisy intent logic

Simplify and fix the logic deciding if AudioManager.ACTION_AUDIO_BECOMING_NOISY
intent should be broadcast when a device is disconnected.

Bug: 37308922
Test: verify music stops when disconnecting a wired or BT A2DP headset
and it is the only device connected.
Verify music doesn't stop when disconnecting a wired or BT A2DP headset
and they are both connected.

Change-Id: Iba5885697d37a2f3d23dfc013623e2fbec173998
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
031cf1458244682ccb9192fb7f4a2f9a90de053b 18-Apr-2017 Jean-Michel Trivi <jmtrivi@google.com> Merge "Vol key presses: active stream has priority of set control stream" into oc-dev
a7880d4bb7784c1b72def92a6b7a7aaf489b3971 15-Apr-2017 Jean-Michel Trivi <jmtrivi@google.com> Vol key presses: active stream has priority of set control stream

When deciding which volume stream is to be controlled by key
presses, give priority to the stream that is actually playing,
unless the user has selected a another volume to be controlled
by the key presses.

Test: play some music over headset, pause, go to home screen.
Press vol up, it changes ringer volume, immediately press play
and press vol up again, it should now change music volume
(and UI updates to indicate that).
Bug: 33355229

Change-Id: Ibad9b59a692e1c6375487b739c55fdbf07f107dd
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
170a0ee064580379b9810708615161af529323c1 15-Apr-2017 Jean-Michel Trivi <jmtrivi@google.com> AudioService: fix updating of stream alias for A11y

VolumeStreamState.setAllIndexes():
- don't do anything if the target and source VSS have the same
stream type,
- javadoc of (old+new) behavior.
When STREAM_ACCESSIBILITY becomes independent of any other stream,
read the settings to restore the volumes previously set.

Test: see bug
Bug: 36286803
Change-Id: I2afcff3a93cc81f3958af252986ef1ac9c38899e
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
a53b7051a2d2d2ff9bddba0a12d2e8dcd0d5c620 13-Apr-2017 Jean-Michel Trivi <jmtrivi@google.com> Fix A11y volume persisting/restore

When the accessibility volume is enabled, its value wasn't persisted
when changed because it was still using the persisting name from
its alias (music).
When enabled, notiify the volume controller that a11y volume has
changed so the UI also reflects the new value, now updated from
the persisted settings.
Do not persist volumes for streams that don't have a setting name.

Test: enable Talkback, set a11y volume at a different level than media \
then disable Talkback. Reboot and enable Talkback, verify a11y is \
restored.
Bug: 36286073

Change-Id: Ic6c30364e164b856fc10fbf6b22c09a7b5561be1
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
4d52ae97070d91ed61c383aec17cf6bcf17767b0 04-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Audio focus: API for external audio focus policy" into oc-dev
126cf03f7c8e825a23e47dd133e77eb1b3b7633d 03-Apr-2017 Jean-Michel Trivi <jmtrivi@google.com> Audio focus: API for external audio focus policy

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
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
fe9a53bc45fd0124a876dc0a49680aaf86641d3e 31-Mar-2017 Jeff Sharkey <jsharkey@android.com> Consistent dump() permission checking.

This change introduces new methods on DumpUtils that can check if the
caller has DUMP and/or PACKAGE_USAGE_STATS access. It then moves all
existing dump() methods to use these checks so that we emit
consistent error messages.

Test: cts-tradefed run commandAndExit cts-dev -m CtsSecurityTestCases -t android.security.cts.ServicePermissionsTest
Bug: 32806790
Change-Id: Iaff6b9506818ee082b1e169c89ebe1001b3bfeca
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
668c34444d13b67949836baa4eac560afcc527c5 28-Mar-2017 Phil Weaver <pweaver@google.com> Merge "Fix permission checking for a11y volume."
f1a9aff96261a40d16c36dd3d47a8190c308d744 24-Mar-2017 Phil Weaver <pweaver@google.com> Fix permission checking for a11y volume.

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
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
92dea33bfebed04533264b06e036d04cc16b9608 02-Feb-2017 Jaewan Kim <jaewan@google.com> Simplify the media button handling logic

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
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
ab2d9315d169a7129c5d1284e91393edd32650bd 13-Mar-2017 Jean-Michel Trivi <jmtrivi@google.com> Permission enforcement for A11y volume changes

Make modifying the STREAM_ACCESSIBILITY volume conditional
to have the BIND_ACCESSIBILITY_SERVICE permission.
Add BIND_ACCESSIBILITY_SERVICE permission to sysUI.

Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.AudioManagerTest#testAccessibilityVolume
Bug: 34379420
Bug: 30448020
Change-Id: I9f26affccd953bd8473d06822857edf92fef4ba8
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
7af9a7443162d78ea6b1df5fc7a6362d7e6e72b5 20-Feb-2017 Robin Lee <rgl@google.com> Don't copy ringtones when profile sync goes off

Experimentally, it makes more sense to more people to have the parent
setting as an overlay not a concrete thing.

Test: make cts -j30 && cts-tradefed run cts --module CtsDevicePolicyManagerTestCases --test 'com.android.cts.devicepolicy.ManagedProfileTest#testRingtoneSyncAutoDisableRingtone' </dev/null 2>&1
Bug: 34730524
Change-Id: I5f804713def9e54921b90e4f5cea742ba8aaa685
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
fb6df0b969008fe65b0452764beda154dc8f9254 16-Feb-2017 Marco Nelissen <marcone@google.com> Make audio effects work

This makes the built-in audio effects work again.
3rd party effect panels can be made to work by disabling the built-in one
in Settings.
TODO: implement selection mechanism for third party effect panels.

Bug: 35316970
Test: manual
Change-Id: I6cd1cfba909bf74c31f37e9ecedcb28046f9109b
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
33a119c94fbef9a185b82204fc58292e08c3d33d 13-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix typo on DISALLOW_UNMUTE_DEVICE"
492b4724fb42adf29f3978f01ebc5238f893d194 13-Feb-2017 Esteban Talavera <etalavera@google.com> Fix typo on DISALLOW_UNMUTE_DEVICE

Test: Builds sucessfully. Cannot find other usages in code search
Change-Id: I83f85b4715b11630b0ce0b471be536aef46a2936
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
03332ab6aa5461981acba74a63e5c96b379e9233 10-Feb-2017 Eric Laurent <elaurent@google.com> AudioService: check safe volume bypass early at boot

audio.safemedia.bypass property was sampled only after a 30 second
timeout after boot in case no MCC change config event is received.

If the property is true, skip the time out to speed up automated test
needing to disable the volume warning.

Bug: 31347265
Test: restart runtime with audio.safemedia.bypass true and check
no warning is displayed when raising volume to max

Change-Id: Ic31111200379e3cb4fddc651fa548a1bdff3384a
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
7592b986e13b1af76dc6c6a10f758ad2f371997a 02-Feb-2017 Jean-Michel Trivi <jmtrivi@google.com> AudioService: query a11y manager at init for a11y volume active

When initializing accessibility state monitoring, query the
accessibility manager whether any service is enabling the
accessibility volume

Test: adb shell dumpsys audio, look for sIndependentA11yVolume
Bug: 30448020
Change-Id: Ie8c32e10a35f4eef5fdeadacccefaaec1cdfb022
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
6deaa4c8cf643ec28e2efb6741e26ee46bce592d 01-Feb-2017 Jean-Michel Trivi <jmtrivi@google.com> Merge "Notification playback synchronized with audio focus"
99489ccf740d369193a8ffc7eeb4bbde6919bd65 26-Jan-2017 Jean-Michel Trivi <jmtrivi@google.com> Notification playback synchronized with audio focus

PlayerProxy: more control options (pan, delayed start),
remove exceptions in method signatures.
Use delayed start on notification playback for better sync
between media apps and notifications
Disabled for now: support for AudioService (through
MediaFocusControl and PlaybackActivityMonitor) to enforce
audio ducking of focus owners losing audio focus with
AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK, and who don't
play audio that has a content labelled as CONTENT_TYPE_SPEECH.
This feature will be enabled when setting a VolumeShaper
on a player works.

Test: play music and play notification
Bug 30258418

Change-Id: I4e4d911645306bbde17f74288f3b61781fe0e3fe
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
f6324a4b758d9251e68f3cc543a5b54c26867d91 19-Jan-2017 Jean-Michel Trivi <jmtrivi@google.com> AudioService: remove compile time options for a11y volume

Remove test code path for the a11y volume and only rely on
AccessibilityServicesStateChangeListener. Query whether
any of the running a11y services expose
FLAG_ENABLE_ACCESSIBILITY_VOLUME

Test: enable a service that exposes FLAG_ENABLE_ACCESSIBILITY_VOLUME
(Talkback will do this in the future) and change volume
Bug 30448020

Change-Id: Ib5dff31313c0ec65b3e9982e35c00698adf5b7de
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
dbfb40f163f98a9aadba68e38222ee4734d17eba 23-Jan-2017 Julia Reynolds <juliacr@google.com> Optionally show accessibility stream volume row.

Bug: 30448020
Test: manual
Change-Id: I86a28c7a900d1fbc378f0ce4c113d59353bcb416
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
110dad7c782c4388906dccb1d1891d4b6fc3e49f 24-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "[SettingsProvider] Auto disable ringtone sync"
7bdc6d80efe0176d5c708a310ce756bc3c42b6f7 22-Sep-2016 Andre Lago <andrelago@google.com> [SettingsProvider] Auto disable ringtone sync

Disable the SYNC_PARENT_SOUNDS setting if a work profile ringtone is set

Test: cts-tradefed --test com.android.cts.devicepolicy.ManagedProfileTest
Bug: 30658854
Change-Id: I172f5396b47f03ac8afa365db0ec90f3a2dd0e29
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
cfa55535e866aade813f185d1893a3fef0826040 18-Jan-2017 Jean-Michel Trivi <jmtrivi@google.com> AudioService: modify logic for independent a11y volume

Add support for enabling independent a11y volume based on
a11y services state change.
Add compile time constant USE_FLAG_ENABLE_ACCESSIBILITY_VOLUME
for testing a11y volume simply when TalkBack is enabled.

Test: change new USE_FLAG... constant to false and enable Talkback
Bug 30448020
Change-Id: I541481ed6ca24bc46872818bb5306c5662ab80e9
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
bb983d20d2cacebdf81efe88f8ff4aa7304fbff7 06-Jan-2017 Julia Reynolds <juliacr@google.com> Use internal volume controller and status bar.

Remove code that let these components be replaced by external
processes.

Bug: 33006669
Bug: 34106436
Test: manual. reboot device, play music, change volume,
view notifications
Change-Id: I458f11537ab9db6f23735487513815553004613f
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
46e310b34f73fe87a6dd1e7357b486f1cf7cacbc 05-Jan-2017 Jean-Michel Trivi <jmtrivi@google.com> AudioService playback activity notif: check origin of player updates

When receiving updates about players, check the validity of the call:
- the piid must be valid
- the uid of the caller and that of the player must match

Test: adb shell dumpsys audio
Bug: 30955183
Change-Id: Id15e2b69764ed7db0b93e2c0c96472c30b1d2070
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
d61d501a06793d2914e087140bd1350acac1a16e 04-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Player activity notification: move some intialization server-side"
858ab9907152b2391063f11706e22d9308cb0454 04-Jan-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Add a mechanism for configuring the A2DP Source codecs" am: 63270f2b96 am: 8b46f87e7e am: da3de76bdb
am: 62c5226e9c

Change-Id: I14d4cc2dc91cb1ab431eda32d5066ac8f471c3a6
62c5226e9c9d5a85689e40b00eacc41e5e90f671 04-Jan-2017 Pavlin Radoslavov <pavlin@google.com> Merge "Add a mechanism for configuring the A2DP Source codecs" am: 63270f2b96 am: 8b46f87e7e
am: da3de76bdb

Change-Id: If62a29812dad856d262c38804f3d88a5406ef79e
44a4ef0aa93ebb2912f36d65af42ffbb1bcdbc0f 21-Dec-2016 Pavlin Radoslavov <pavlin@google.com> Add a mechanism for configuring the A2DP Source codecs

* Added a new class BluetoothCodecConfig that contains codec-related
configuration or capabilities: codec type, priority, sample rate,
bits per sample, channel mode, and codec specific fields.

* Extended the Bluetooth A2DP AIDL interface to get/set the current
codec configuration

* Added new call handleBluetoothA2dpDeviceConfigChange() to the Media
Framework that is called when there are changes in the
Bluetooth A2DP device configuration - e.g., the A2DP codec is changed.

Test: A2DP streaming to headsets, TestPlans/71390
Bug: 30958229
Change-Id: I9a82716cbc2a5efbe77352a031ac80c88f6a2459
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
44a8f53f94808fdc5ac35a249d21ff2ba23e9419 02-Jan-2017 Jean-Michel Trivi <jmtrivi@google.com> Player activity notification: move some intialization server-side

Make beginning of player tracking synchronous, init uid/pid/piid
on the server side, and return the piid.
Anonymize configurations in the getter of active configurations
when the client isn't privileged.

Test: run cts -m CtsMediaTestCases -t android.media.cts.AudioPlaybackConfigurationTest
Bug: 30955183

Change-Id: I1610ae0067fd26d297057663352e679c8963a2d7
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
292a6a4e9934a94eea97b018befde3baed895f7d 01-Dec-2016 Jean-Michel Trivi <jmtrivi@google.com> Notification of playback activity

AudioService keeps track of status of implementations of PlayerBase.
AudioService's PlaybackActivityMonitor maintains a list of
playback configurations for each PlayerBase, and a list
of clients that want to receive updates about the playback.
Playback activity clients can query the playback configuration
of the system through AudioManager, or register a callback
for updates. For clients with MODIFY_AUDIO_ROUTING permission
(system), the playback configurations contain more information
about each player (player type, uid, pid, state), and can see
all players, not just the "active" ones. The act of stripping
off data about the players that is not supposed to be seen
by non-system clients, is referred to as "anonymization". It
is implemented in system server, so no system data is ever
sent to playback activity clients without system permission.
More information about the AudioPlaybackConfiguration is
available in the SystemApi (uid, pid, player type, player state).

Test: run cts -m CtsMediaTestCases -t android.media.cts.AudioPlaybackConfigurationTest
Bug: 30955183

Change-Id: I85997594c0378216419f5f0fdaa0714996fd3573
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
c6729478b18bb40f2c3af65e98a667a8ff41695d 07-Dec-2016 Eric Laurent <elaurent@google.com> AudioService: fix mismatch in device volume index for alias streams
am: 825a5ea380

Change-Id: I44f3e0a603ddea097abca5af134615b53a5a9df8
825a5ea380d277d201a017d743cf10725266b64c 04-Nov-2016 Eric Laurent <elaurent@google.com> AudioService: fix mismatch in device volume index for alias streams

Fix VolumeStreamState.setIndex() to force device volume
index update on an alias stream when no specific device volume exists
on the VolumeStreamState of this alias stream.

This prevents asymetric behaviors of setDeviceVolume() and setAllVolumes()
causing some stream types to be muted and
not unmuted if no specific device volume index exist.

Test: make
Test: wipe device, setup wizard, place call and check nofication volume

Bug: 32626244
Change-Id: Idd170aa9f295b0a9533a589e1891a04c05ab2f2f
(cherry picked from commit 3fb608e4f38df2781461ee601156258c90b6c472)
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
ac48767f919e2a641e4ff5597f7bc24c6d481d41 11-Nov-2016 Jean-Michel Trivi <jmtrivi@google.com> Conditional behavior for a11y stream volume

VolumePolicy: define two a11y modes: 1/ legacy where
a11y volume aliases to media volume, 2/ a11y where
the a11y volume is independent from any other stream
type volume.
Refactor accessibility service listening to accomodate
communicating to the volume controller when the
a11y service is running.
Make accessibility stream alias conditional on a11y
service running. Reflect the behavior in the
volume controller.

Test: enable Talkback and verify logs in Vol controller
Bug 30448020

Change-Id: I80535ba259a22b6d93e62a7b3ca462a19d4c84b7
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
3f0945a608197fa8919ebe909f6388d9d59e8c29 11-Nov-2016 Jean-Michel Trivi <jmtrivi@google.com> Define stream type for accessibility volume control

New stream type for accessibility volume.
Add related appOps.

Test: see added CTS tests in AudioManagerTest & Stub
Bug 30448020

Change-Id: I34f96713b22fedf75322b8ffe2b96a7c566f5009
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
dc589ac82b5fe2063f4cfd94c8ae26d43d5420a0 11-Nov-2016 Sudheer Shanka <sudheersai@google.com> Update usage of ActivityManagerNative.

- Remove references to ActivityManagerProxy.
- Add isSystemReady to ActivityManager.

Bug: 30977067
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test android.server.cts
adb shell am instrument -e class com.android.server.am.ActivityManagerTest,com.android.server.am.TaskStackChangedListenerTest \
-w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I07390b6124fb1515821f5c0b37baf6ae74adc8fa
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
67b30fea3873555ddd3e8d0fec9e9d34ca9d867d 07-Nov-2016 Eric Laurent <elaurent@google.com> Merge "AudioService: fix mismatch in device volume index for alias streams"
fc46e9b643881b7b2ab76854f3a0ac077e9def8d 22-Oct-2016 Sudheer Shanka <sudheersai@google.com> Move IActivityManager to aidl.

Bug: 30977067
Test: Existing tests are passing, dump commands still working.
Change-Id: I9cf81c4d381ebce14a6c701e409cbb269f2ff1fb
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
3fb608e4f38df2781461ee601156258c90b6c472 04-Nov-2016 Eric Laurent <elaurent@google.com> AudioService: fix mismatch in device volume index for alias streams

Fix VolumeStreamState.setIndex() to force device volume
index update on an alias stream when no specific device volume exists
on the VolumeStreamState of this alias stream.

This prevents asymetric behaviors of setDeviceVolume() and setAllVolumes()
causing some stream types to be muted and
not unmuted if no specific device volume index exist.

Test: make
Test: wipe device, setup wizard, place call and check nofication volume

Bug: 32626244
Change-Id: Idd170aa9f295b0a9533a589e1891a04c05ab2f2f
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
da9d0ecb8390765ee7f3d8c7338e710f009f0f40 04-Nov-2016 Andre Eisenbach <eisenbach@google.com> Merge "BT: Don't switch devices when one of the connected BT headsets disconnects" am: 0bebfe76fc am: 2fe13541ad am: 51d7a455aa
am: 045226008c

Change-Id: Iacd5ae71b6338bcb461ae69cc09e5158fea502dc
2fe13541ad632c3484dd7b816672b6bf4cf3364f 04-Nov-2016 Andre Eisenbach <eisenbach@google.com> Merge "BT: Don't switch devices when one of the connected BT headsets disconnects"
am: 0bebfe76fc

Change-Id: Ibd4c4f9defec469bb14a282c53d64932123d4905
2980980a75a0066273683aed8b12a58b212a0487 18-Jan-2016 Satish Kodishala <skodisha@codeaurora.org> BT: Don't switch devices when one of the connected BT headsets disconnects

Usecase:
1. Enable multi-hf.
2. Connect to HS1.
3. Connect to HS2.
4. Make a call on AG. Here call audio is present on HS2.
5. Now disconnect HS1 from AG.

Failure:
When HS1 is disconnected, call audio is routed to handset/speaker.

Root cause:
When hs1 disconnection intent is received, SCO path is cleared
and audio is routed to handset/speaker.

Fix:
Check if the device being disconnected is same as the device
call audio is present before clearing SCO path.

Change-Id: If83325679b70b5893e44e8d844000ee028d0246c
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
909371b6f6a9d04abfb651b5cc57eee98955e398 29-Sep-2016 Sungsoo <sungsoo@google.com> Make dispatchAudioRoutesChanged be called when BT A2DP status changed am: 71f3563c39 am: 139f1e3742
am: 220f348fb3

Change-Id: I34ebeddffe313747008ed6f7d941097bd67d7b9b
b26960bf04117cf5d3ad57db5b6e72e6c80de7ef 29-Sep-2016 Sungsoo <sungsoo@google.com> Revert "AudioService: remove deprecated forcing of A2DP off" am: cf09fe6801 am: 8902c288b7
am: 38b5579261

Change-Id: Iea5ee66996db5d39b11cf3f278b1db5795db09d8
b2d12bb6562225e981ace94748a8301b107c216e 29-Sep-2016 Sungsoo <sungsoo@google.com> Revert "AudioService: restore A2DP/wired headset auto selection" am: 486f7d3fcd am: 3e6a30c07a
am: c6b31397a6

Change-Id: I38d170658c9cfd979b115ae12e8f727ffdafc175
71f3563c3960bd862dfa96844f646ea5b2f03de5 28-Sep-2016 Sungsoo <sungsoo@google.com> Make dispatchAudioRoutesChanged be called when BT A2DP status changed

Bug: 28517884, Bug: 31398128
Change-Id: Ic1e2f5e828a772c667caf1408ebfc9b0d7c3f7d4
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
cf09fe68015c042f3847b835f7f6bebe7f95107d 28-Sep-2016 Sungsoo <sungsoo@google.com> Revert "AudioService: remove deprecated forcing of A2DP off"

This reverts commit 0234587b1172a11929d17b05ef73ba14425edd65.

Bug: 28517884, Bug: 31398128
Change-Id: I8ca2871c4f956409d07dd90dcbe41d3e668568ba
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
486f7d3fcd34caea35179efd3886b9f5c31c9fd2 28-Sep-2016 Sungsoo <sungsoo@google.com> Revert "AudioService: restore A2DP/wired headset auto selection"

This reverts commit 383dc532f3c993ab6111d4fc55eba62ff0f926ec.

Bug: 28517884, Bug: 31398128
Change-Id: Ia633a1596298ae30384f8bcaa02a1b6d29344ba9
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
1022942a56472829c94f5708797d9d3136f40caf 15-Sep-2016 Eric Laurent <elaurent@google.com> AudioService: restore A2DP/wired headset auto selection am: 383dc532f3 am: 8097459f66
am: 4f2481ecaf

Change-Id: If58bc256b33d7fcdb68a1e26911950782ba40abe
21003f696fea9bd2796d2c446c53ade2927f7533 08-Dec-2015 Hank Freund <hanochf@google.com> Ignore TV platforms in checkForRingerModeChange

The checkForRingerModeChange function determines how to modify the
ringer mode based on the requested action and then calls setRingerMode
to carry out the change. For TV devices, setRingerMode exits
immediately, making the path through checkForRingerModeChange
unnecessary.

Removed all references to TV inside checkForRingerModeChange and
return immediately in that situation.

b/26016241

Change-Id: I15893d38c8b7b449e5a3f1d729f75505a08976a2
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
383dc532f3c993ab6111d4fc55eba62ff0f926ec 13-Sep-2016 Eric Laurent <elaurent@google.com> AudioService: restore A2DP/wired headset auto selection

Restore automatic routing behavior when wired headset or BT headset
is connected.
This behavior was changed by commit 0234587b
This change mostly reverts 0234587b but keeps public methods
setBluetoothA2dpOn() and isBluetoothA2dpOn() deprecated with
stub implementations.

Bug: 30963785
Bug: 31424965
Change-Id: I90ea04584df595a778993595ad0076fef809ed98
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
0234587b1172a11929d17b05ef73ba14425edd65 29-Jul-2016 Eric Laurent <elaurent@google.com> AudioService: remove deprecated forcing of A2DP off

Forcing the policy to not use A2DP is not needed anymore now that
the cast icon does not expose A2DP choice anymore.
The corresponding AudioManager APIs have also been long deprecated.

Removing support for this feature which is replaced by newer routing
APIs.

Bug: 30963785

Change-Id: If98572742a8cf6388c1408d015c86dd445c5660b
(cherry picked from commit 0218f53108f578933c8d876364138d062b315a6b)
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
0218f53108f578933c8d876364138d062b315a6b 29-Jul-2016 Eric Laurent <elaurent@google.com> AudioService: remove deprecated forcing of A2DP off

Forcing the policy to not use A2DP is not needed anymore now that
the cast icon does not expose A2DP choice anymore.
The corresponding AudioManager APIs have also been long deprecated.

Removing support for this feature which is replaced by newer routing
APIs.

Change-Id: If98572742a8cf6388c1408d015c86dd445c5660b
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
73ea0ae15fafd66ab8a8e2679723715c189bbba3 11-Aug-2016 Jeff Sharkey <jsharkey@android.com> Fix bugs around manager fetching.

A recent patch started returning "null" when a Binder service
required to provide a manager wasn't yet registered.

This fixes four locations where that new logging was triggered: in
two cases by adjusting the fetching ordering, and in two other cases
by only fetching when the device supports the manager.

Bug: 28634953
Change-Id: I84dbccffa4ac760c10a2bbcb234f21272bfecb91
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
45926dcc1f5705a708648fedbb944422b1f3de4b 11-Dec-2015 Hank Freund <hanochf@google.com> Change default stream volume for TV to 1/4 max instead of 3/4

b/26048878

Change-Id: I423e9b8fb03d6875e7d0e4a4266943e950defefe
(cherry picked from commit db27de5da493b9d791321e8771ae59998dad8c28)
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
fe84fe01d7415ea86e37824c0aff0d988089b6c2 25-Jul-2016 Tony Mak <tonymak@google.com> Persist master volume mute across reboot am: c1205111a9
am: c33b549af8

Change-Id: Id5e57ebdf81824af0f86854d8668a05f8109e0e1
c1205111a92b52283078f1a2e86c8d32c5928b92 22-Jul-2016 Tony Mak <tonymak@google.com> Persist master volume mute across reboot

Fix: 30133263

Change-Id: I53450a504e40e55516acc88550f369a74a244eaf
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
1ed6df6bcf8f21a78a42bc9dc293812585eff121 18-Jun-2016 Muyuan Li <muyuanli@google.com> audio: add a flag to force tv-like audio stream.

Bug: 29446492
Change-Id: I5d7272d8735befe7fbed080cca1dd2b47e5f1b6e
(cherry picked from commit 77091ab14a1da2fe4e674edb8af275a3d1ed38ce)
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
f04fab160a044e4e7d936c0457a156d7911f924c 19-May-2016 Jean-Michel Trivi <jmtrivi@google.com> Recording activity notification: return list of configuration

Use a list of configurations instead of an array

Bug 28819230

Change-Id: Ia4a3cdabf8337cfb98abe4d0055d497bcab8a5ee
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
39fb5670a8d863ec1ee9b3ece0d477a8b9dd44c2 09-Mar-2016 Liejun Tao <baibai@motorola.com> Bluetooth: Fine tune audio gain for Absolute Volume case

Fine tune the audio gain for Bluetooth Absolute Volume.
Use 50%, 70% and 85% for lowest volume steps 1, 2 and 3.
Thus the volume change sounds smoother, more linear.
When remote end tune volume out of mute, we should also
tune the audio gain for the lowest volume steps.

Bug: 26694114
Change-Id: I298a334a4b40ddb87495fda1935349bfce8b0537
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
02d01b7b0161df398b4d8d6e4015970a48bcf97d 11-Apr-2016 Julia Reynolds <juliacr@google.com> Merge "DND related restrictions" into nyc-dev
ed783798c3c541cd33bc8860f31928dda351d7ae 08-Apr-2016 Julia Reynolds <juliacr@google.com> DND related restrictions

- Apps without dnd access cannot call adjuststeamvolume if that will
change the ringer mode
- DND muted streams cannot be unmuted when DND total silence is enabled.

Bug: 27624414
Bug: 25395278
Change-Id: Id10988c42fc6cb6407aa2abcf66cc5c384fe533a
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
d9ac2be3e32472b042d1e977a86e2bad083cea16 07-Apr-2016 Eric Laurent <elaurent@google.com> audio service: fix volume burst on user switch

Change the convention on use of default device volume with
audio policy manager: Now setting the default device volume on a stream does not
reset all specific device volumes. The default volume is just used by audio policy
manager if no specific device volume is present for a given selected device.

Bug: 27557733

Change-Id: I1edd9530ccafc615d9353b9b06489c688e21f719
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
d08da04cf2d52d62573459b82f0e7a1c02026b29 18-Mar-2016 Donghyun Cho <donghyun@google.com> Merge "Clear calling identity before calling sendKeyEvent" into nyc-dev
cdaa0b99eb81998c6b3f94aedb09f0e28dedca10 17-Mar-2016 Julia Reynolds <juliacr@google.com> Relax policy access restriction for adjust volume changes.

Otherwise users can't enter DND while using volume buttons in most
apps.

Bug: 27711587
Change-Id: Idb4976680d9bb88206928a7b623f17d07183ea28
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
5f6d404e0923498bed30595224d6e9b527156c07 17-Mar-2016 Donghyun Cho <donghyun@google.com> Clear calling identity before calling sendKeyEvent

When HdmiControlService#sendKeyEvent is called via AudioService,
permission check should be based on AudioService rather than the caller
of AudioService.

Bug: 27195998
Change-Id: I35f60813b3a48b2957f2bfd576a5f493d77691a7
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
495defd74f9a47dec33eb27ca25f5e390bd3fb4a 16-Mar-2016 Eric Laurent <elaurent@google.com> Merge "AudioService: do not persist mic mute and master mute" into nyc-dev
48034f89b75ecfa4871855afd7b4f701ff927d28 09-Mar-2016 Julia Reynolds <juliacr@google.com> Prevent apps without DND access from toggling DND via AudioService.

Bug: 25395278
Change-Id: Id72830607b01a43848d1261292e5835315ef70d0
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
c02324864f3bab4baffb3ebbbd78ccee4b065e56 16-Mar-2016 Eric Laurent <elaurent@google.com> AudioService: do not persist mic mute and master mute

Master mute and mic mute are fully managed by user restrictions so there
is no need to persist their states.

Bug: 27486437
Change-Id: I7e58d1ddf409f6c80af371c7f5a5f305ee996386
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
598c0c9f659184971e974de6a0184a3000e7900c 07-Mar-2016 Jean-Michel Trivi <jmtrivi@google.com> Rename AudioRecordConfiguration to AudioRecordingConfiguration

In package android.media:
- rename AudioRecordConfiguration to
AudioRecordingConfiguration to avoid ambiguity with the
android.media.AudioRecord class
- rename AudioManager.getActiveRecordConfigurations() to
getActiveRecordingConfigurations.

Bug 27385560

Change-Id: I5ef404ff36522193990c9b563d4545893529b365
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
310355d28e73ff4192e597b99af202a9045fa7e2 07-Mar-2016 Jean-Michel Trivi <jmtrivi@google.com> Merge "Revert "Rename AudioRecordConfiguration to AudioRecordingConfiguration"" into nyc-dev
431ec6cdb9818ea6fb8b78e2589042ff09c40974 07-Mar-2016 Jean-Michel Trivi <jmtrivi@google.com> Revert "Rename AudioRecordConfiguration to AudioRecordingConfiguration"

This reverts commit 99278e1c724e01b792dd27031bc579e7d738edc1.

Change-Id: Ifcb3f17a26df8171cbc21dac093477b98a1333db
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
46f5429768045e0ba15229c7317429e3a1d15bac 07-Mar-2016 Jean-Michel Trivi <jmtrivi@google.com> Merge "Rename AudioRecordConfiguration to AudioRecordingConfiguration" into nyc-dev
99278e1c724e01b792dd27031bc579e7d738edc1 02-Mar-2016 Jean-Michel Trivi <jmtrivi@google.com> Rename AudioRecordConfiguration to AudioRecordingConfiguration

In package android.media: rename AudioRecordConfiguration to
AudioRecordingConfiguration to avoid ambiguity with the
android.media.AudioRecord class

Bug 27385560

Change-Id: Ia633ac30cbe151b8f0f903dc96a459a56737ace2
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
ed43bf5160d3170c3220a9c0cbab9b272acdfc6b 02-Mar-2016 Phil Burk <philburk@google.com> AudioService: update device info when ENCODED_SURROUND_OUTPUT changed

Fixes a bug with the ContentObserver not being registered.
Added code to also toggle the HDMI connection to force a broadcast.

Bug: 27434478
Bug: 24541671
Change-Id: If1644f4d08991ee27e3b6e10d244a704c25b5fa9
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
ac0f704b1a77cb27dc0975206825098df6b211bb 24-Feb-2016 Phil Burk <philburk@google.com> AudioService: add support for ENCODED_SURROUND_OUTPUT

Preference allows override of AudioPolicyManager.
Lets user force or prevent use of AC3 and DTS regardless
of what the EDID says.

Bug: 26373761
Change-Id: I21440f2b90af9a369a36b7b07724e992501bce6d
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
7b98e9a7e56213f90665c2c9aec213de8557021b 26-Feb-2016 Andy Hung <hunga@google.com> Make master mono controlled through settings

Bug: 15283594
Change-Id: I94a84a3ad3bbb0c1179726a4ecc68b7df033af58
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
b09265df232f2f2e404604dce4b5e5a55fde0d1d 03-Feb-2016 Eric Laurent <elaurent@google.com> Merge "Bluetooth: Restrict gain for Absolute volume case" am: 81e7a58754
am: d24eb54b54

* commit 'd24eb54b5409997ece8e49ce2e57d27f8b41d778':
Bluetooth: Restrict gain for Absolute volume case
4565a47d916d3df37a31c1d3fadbd220f4b35c57 21-Jan-2016 Liejun Tao <baibai@motorola.com> Bluetooth: Restrict gain for Absolute volume case

For the lowest music volume steps 1 and 2, restrict the gain to 50% and
75%. This will avoid the lowest volume steps being too loud for some
accessories. For music volume 0, set phone gain to 0 as some
accessories won't mute on their end.

Change-Id: I24e0fa7be8c8635b428a11c91ea153aad7cec55f
Signed-off-by: Liejun Tao <baibai@motorola.com>
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
b70b78a205f668a6529027008a144fa83ae2ed5a 14-Jan-2016 Eric Laurent <elaurent@google.com> audioservice: detect bluetooth adapter turning off.

Make sure that we disconnect all bluetooth devices when the
bluetooth adapter is turned off as the onServiceDisconnected()
is not systematically called for all profiles in this case.

Bug: 25488825.
Change-Id: Ia6f6d8611dc02acddb6f8ee09af528788c72d3cd
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
de41d3cd5a28cce3ba7f0fa23ba7c41ef93b223d 13-Jan-2016 Jean-Michel Trivi <jmtrivi@google.com> Merge changes from topic 'recordingcallback'

* changes:
Audio recording notification API
AudioManager event dispatcher: make more generic
d3c71f075b139024e2bea39bbd75e3b976bfb7cb 07-Dec-2015 Jean-Michel Trivi <jmtrivi@google.com> Audio recording notification API

AudioService can register a recording callback with AudioSystem.
Callbacks are handled in a new class, RecordingActivityMonitor.
This class notifies registered AudioManager instances
of updates, only if this AudioManager has client callbacks.
Each AudioManager dispatches updates to its registered
callbacks.

Bug 22876530

Change-Id: I95c6e5ec0631e53af53a490bcecca96089490089
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
f04b84d4c66ea377ec6fe2b36f3a0994f3e94eba 19-Dec-2015 Andy Hung <hunga@google.com> Add setMasterMono and getMasterMono

Bug: 15283594
Bug: 22700363
Change-Id: I5d0552938ec2a54be4450512974d92ff8c77b1e9
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
ed0ea40a41aae8e65bc189efe6b631ca78259383 30-Oct-2015 Andy Hung <hunga@google.com> Add Android permissions for audioserver

audioserver has the same permissions as mediaserver.

TBD: Pare down permissions.

Bug: 24511453
Change-Id: Id7abddd79a730ad95b554a94207df3aa4b676f2a
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
d4de20df2a1e57d22db7c538b197e3db18eaaa7d 04-Nov-2015 Jean-Michel Trivi <jmtrivi@google.com> AudioService: remove dead code

Remove dead code related to media button event receiver and
remote control display, now handled by MediaSession*

Change-Id: I4bd621240ddddf4df079df8d551c72b232c3301d
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
ac65e1e1dba1cf0ea237a389220ec818ade07a16 21-Nov-2015 Makoto Onuki <omakoto@google.com> Remove UserManager.setSystemControlledUserRestriction()

Now that we don't have UM.setUserRestriction*s*() that could remove
all existing restrictions, there's almost no point handling
DISALLOW_RECORD_AUDIO differently.

Now DISALLOW_RECORD_AUDIO is handled just like other restrictions,
except we don't persist it.

Bug 24954662

Change-Id: I27875b4a74dd95a3ce6bb774081eeaf718eaec15
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
1b434dac7f098227bbe0f346f7bb749e8b793a17 12-Nov-2015 Jae Seo <jaeseo@google.com> AudioService: add a missing call to setSystemAudioMute

Bug: 24946655
Change-Id: I0ff75135dbd05f1d99543cc0594656586a8ae7b5
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
d45a4a2ecb18701b4cfadcb4a26663f2eab642fe 03-Nov-2015 Makoto Onuki <omakoto@google.com> Have AudioService listen to DISALLOW_UNMUTE_MICROPHONE and

... DISALLOW_ADJUST_VOLUME, instead of UserManager pushing
new settings to AudioService.

Also:
- Allow PO to set these two restrictions.

- Now AS.setMasterMuteInternal() respects mUseFixedVolume to make
it consistent with readPersistedSettings().

- When a user switches and restores the mute state in
AS.readPersistedSettings(), also check the current user restrictions
in addition to system settings. Because of the delay in AudioService
before persisting the mute settings in setMasterMuteInternal() and
setMicrophoneMute(), there's was an edge case
DISALLOW_UNMUTE_MICROPHONE and DISALLOW_ADJUST_VOLUME would be ignored
when the user switches right after they are set.

Bug 24981972

Change-Id: I4d9b709a0a0e6812319204568c6e44d6664bdeb4
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
4f16073556f7978708fb71c87628cfe1692412d5 28-Oct-2015 Makoto Onuki <omakoto@google.com> Make UserManager enforce user restrictions, not DPM.

- Now even if a user restriction is set via UserManager, it'll be correctly
enforced.

- Changed the way AudioService enforces the OP_MUTE_MICROPHONE and
OP_AUDIO_MASTER_VOLUME app ops -- previously, when they're set, even a muting
call would be rejected. This was why DPMS.setUserRestriction() used different
calling orders for DISALLOW_UNMUTE_MICROPHONE/DISALLOW_ADJUST_VOLUME depending
on setting them or clearing them.
Now, even when the app ops are set, we still allow muting calls.

Bug 23902097
Bug 24981972

Change-Id: I865b5de43e15f5955f94006475a5ec6254904d31
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
e4381ec97c67fad16acfcc9933fde04f2260d796 30-Oct-2015 Eric Laurent <elaurent@google.com> AudioService: fix BT SCO min volume

Set minimum BT SCO stream volume back to 0 to comply to
Bluetooth audio gateway requirement.

Also fix minimum stream volume when initializing audio policy manager
after a mediaserver crash.

Bug: 24747886
Change-Id: I80c51114d5b10a132b7b10f216bce96323fdc166
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
e1aef85ff100c1beba215add2ff3238a4032c6ba 16-Oct-2015 Makoto Onuki <omakoto@google.com> Use the SystemService lifecycle mechanism for AudioService

This will be needed to refactor user restriction handling.

Change-Id: I4b77a020d631714e7f94bce5559190e3b78ec72c
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
58e47ca39a537c47c84a674eee392f9569d3e09e 02-Oct-2015 Jean-Michel Trivi <jmtrivi@google.com> am 182e6287: am 11568be8: am 5f48baef: am 24806db8: AudioService: alternative way of handling device rotation

* commit '182e628711a5859765479fd75066bbeac886c3f6':
AudioService: alternative way of handling device rotation
24806db8f6f523542510097ce0af4a32beeda83b 02-Oct-2015 Jean-Michel Trivi <jmtrivi@google.com> AudioService: alternative way of handling device rotation

For devices that monitor orientation (primarily for channel assignment
to stereo speakers):
The com.android.server.policy.WindowOrientationListener API is more
power efficient than simply monitoring the device's orientation. When
supported, use it instead of android.view.OrientationEventListener.
When WindowOrientationListener reports an orientation change, start
a thread to poll the UI orientation, as its change may lag behind
the observed rotation. Gradually increasing delays between polls
are stored in a table.

Bug 24415763

Change-Id: I69bf68da6107af24cd02a48961dd17ceab557816
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
82418d110f24f45fe62731206083e478a44052ea 25-Sep-2015 Pankaj Kanwar <pkanwar@google.com> am 1e595bc2: am 52762ce8: am f99986ee: am 65bfe1ca: Merge "AudioService: cleanup sco audio mode upon disconnection." into mnc-dr-dev

* commit '1e595bc225a4d2f1a9c8e59a2047bee33dd79439':
AudioService: cleanup sco audio mode upon disconnection.
48221250ba8445b82dc9beaaf0853a37afffcdf6 25-Sep-2015 Eric Laurent <elaurent@google.com> AudioService: cleanup sco audio mode upon disconnection.

Clean up SCO forced usage and A2DP suspend state upon
SCO device or profile disconnection.
This is in case the Bluetooth Headset service does not
do it.

Bug: 24316765.
Change-Id: Ifc0305607c186be49b2eb42b7868647292e56137
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
7c69636c9a406265e1da368f3edfd8fb9651132c 16-Sep-2015 Xiaohui Chen <xiaohuic@google.com> Cleanup USER_OWNER in various services

Bug: 19913735
Change-Id: I980370bab18e1b9ccf4043eed2b9fd721a940f72
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
598b03d1008fb416a597ae4b2e037c4492bf696d 07-Aug-2015 Svetoslav Ganov <svetoslavganov@google.com> am 9bf912c1: am 5ed03384: am 1f514608: am 5a624aad: am 38d30dc5: Merge "Immediately kill a shared user process on a permission revocation." into mnc-dev

* commit '9bf912c1cf6941402dc0f8ef449f34787796875e':
Immediately kill a shared user process on a permission revocation.
aa41add33b8d7d318387cc74c34e3d347d245211 07-Aug-2015 Svetoslav <svetoslavganov@google.com> Immediately kill a shared user process on a permission revocation.

1. When a permission is revoked we kill the app immediately but do
not do an immediate kill for shared uid processes. This fixes it.

2. Remove system APIs that are used only by the package installer.

bug:22984670

Change-Id: I3d4ae52ea8679f894aa7c5972941263903479183
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
0a01228c1e9a06e9454e732ea950fe6d8550db73 04-Aug-2015 Jean-Michel Trivi <jmtrivi@google.com> am 2cfe29e3: am cbda3dc7: am 0ca9e2df: am 4032c94d: am fc5a4bf0: Merge "AudioService: check for audio device connection success" into mnc-dev

* commit '2cfe29e34c7e95609e93cdbf57225145f242c8a2':
AudioService: check for audio device connection success
fc5a4bf0e1520bf3acd75226d760b8e1d7cdd59f 04-Aug-2015 Jean-Michel Trivi <jmtrivi@google.com> Merge "AudioService: check for audio device connection success" into mnc-dev
6d00e41145a577de114f93985bf05d7eca99ccc3 04-Aug-2015 Jean-Michel Trivi <jmtrivi@google.com> AudioService: check for audio device connection success

When connecting/disconnecting and audio device, AudioService
was assuming that the call was always successful through
AudioSystem.setDeviceConnectionState(). In the case of the
connection of a wired headset (mic + headphones), this also
causes A2DP to not be used for media playback.
The connection can fail if the audio device being connected
is not supported by the platform. But if this failure is
not taken into account for DEVICE_OUT_WIRED_HEADSET or
HEADPHONES, A2DP would still be avoided even when an A2DP
device reconnects at boot.
The fix consists in executing the connection logic only when
the connection was deemed successful. Nothing is altered
on the disconnection code path, or the direct connection
of A2DP.
The javadoc is updated in AudioSystem to indicate the return
codes to take into account in setDeviceConnectionState().

Bug 22511833

Change-Id: I22f0d2c7d4ab4fb9ee1be2f248907f721596a16f
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
c57692e30d6292ea40809acbd5e13f8e489baafe 01-Aug-2015 Jean-Michel Trivi <jmtrivi@google.com> am 209bf907: am aff9c638: am 4bdc3179: am de680550: am ffbdb8ad: Merge "Fix that shutter sound does not play after ringer mode changes to vibrator" into mnc-dev

* commit '209bf907dfcc4d79324828254be9ba994565d94d':
Fix that shutter sound does not play after ringer mode changes to vibrator
841ed0a0418162bab3ae63329a77e900fa840477 27-Jul-2015 Sungmin Choi <sungmin.choi@lge.com> Fix that shutter sound does not play after ringer mode changes to vibrator

Reproduce sequence:

1. Change ring volume to vibration in Settings > Sound & notification
> Ring volume using touch
2. Launch camera app
3. Capture, but cannot hear shutter sound
4. Even change ringtone to maximum, shutter sound is not played before reboot

Bug: 22589664
Change-Id: I90eb044eaf21f3b558bf050bf1d9f0b33ea4888b
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
f522848259047de88f6d43340ca62e2d09307f06 22-Jul-2015 Yasuhiro Matsuda <mazda@google.com> Merge "Do not broadcast ACTION_AUDIO_BECOMING_NOISY on first boot."
9ade08733fe0ffa6ac97e480facfe230dacfe53c 21-Jul-2015 Amith Yamasani <yamasani@google.com> am f8db3c64: am aef8716e: am b82c71a8: am 89d4131d: am 09ba7151: Merge "Don\'t kill apps that are multi-user aware..." into mnc-dev

* commit 'f8db3c64984de6c2220578d4c9c12570c3d752b8':
Don't kill apps that are multi-user aware...
c1cbaaba6c509a0e31cbed843f77af1eae1cb064 21-Jul-2015 Amith Yamasani <yamasani@google.com> Don't kill apps that are multi-user aware...

... when looking for background user apps that hold RECORD_AUDIO
permission.

On switching users, we kill any apps that might potentially be
recording audio. But we don't want to kill critical apps that need
to stay running because of multi-user aware services.

Bug: 22564430
Change-Id: I6d9a684d4e044cc3018f0f8181a44aa143a3baeb
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
4ced71932ad7094fd308df844434498604b539c2 10-Jul-2015 Yasuhiro Matsuda <mazda@google.com> Do not broadcast ACTION_AUDIO_BECOMING_NOISY on first boot.

This is for improving boot time by avoiding launch of
unnecessary processes (e.g com.google.android.apps.magazines)
during boot time.
Boot time is reduced by 100~200 ms on Nexus 9.

BUG: 22163689
Change-Id: Iaf373f6a5458c266100a5298b7096bbbd4ff42c2
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
c70ee214e60a613ab6f931568de8816f549e603d 10-Jul-2015 Yasuhiro Matsuda <mazda@google.com> Remove an unused variable from AudioService.

mKeyguardManager became unnecessary after the following change
was submitted.
https://googleplex-android-review.git.corp.google.com/#/c/500013

Bug:16186697
Change-Id: I1fd65eb6f96ccbfa45634fd3578ad895576a0e41
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
70e0c58c2269cd29dfd6420d690da13dc03fd457 30-Jun-2015 Kenny Guy <kennyguy@google.com> Mute correct user from device policy manager.

Add per user versions of mute methods so
device policy manager can mute the correct
user.
Just persist change if the calling user
isn't the current user.
Treat calls to audio manager coming from uid
1000 as if they were coming from current user
rather than user 0 so that the correct user's
user restriction is checked.

Bug: 21782066
Bug: 21778905
Change-Id: I51469b741096d8a2ffdc520eaf5b3fd754f2c819
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
560877d498b3b142bb0d555bb2fe48ead3fa9b0f 26-Jun-2015 Jean-Michel Trivi <jmtrivi@google.com> Volume change intent carries stream alias

Define a new extra, AudioManager.EXTRA_VOLUME_STREAM_TYPE_ALIAS, to be
sent along with the volume change intent, VOLUME_CHANGED_ACTION.
When sending VOLUME_CHANGED_ACTION, attach the stream type alias.

Bug 17955277

Change-Id: I04fd279e223504e3ee1581086d7e9205344a6808
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
3a30a76e8839d36c93c2620188238b84462b3dd2 24-Jun-2015 Ricardo Garcia <rago@google.com> Fix for SafeMedia logic and CTS tests

Added audio.safemedia.bypass system property to bypass SafeMedia logic on
CTS tests which require guaranteed access to full range of volume levels.

bug: 21779099
Change-Id: I76815a995f08d426218206af7aade491c5debd9e
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
72966d6d83413dc89d3051f30bdc0941cbfc7bb1 18-Jun-2015 John Spurlock <jspurlock@google.com> AudioService: Send the right stream to the volume UI on tablet changes.

Bug: 21798314
Change-Id: Idd49eb9e1253a94e567866a38b664035aea3715b
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
98859b256ea32854e3af96d4bd6a705a6e00accf 12-Jun-2015 Eric Laurent <elaurent@google.com> audioservice: remove BT SCO device when service is disconnected

Bug: 21727956.
Change-Id: I9dd68ad83583cdbe7454724098c89daf70bee726
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
75ae23c09674bede6d3fe5ec05a6fba47142e2d5 02-Jun-2015 John Spurlock <jspurlock@google.com> Audio policy: setting explicit non-zero volume unmutes the stream.

And vice versa.

Bug: 21584884
Change-Id: I2cd6a84ab40edba4c6fc2b219693e0d4f0527d8d
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
ccffda8359aaf11a6945650dfa39a8cd13604ed2 22-May-2015 Jean-Michel Trivi <jmtrivi@google.com> Remove the 5 sec timeout logic for setVolumeControlStream

Bug 16983918

Change-Id: I65174615d882ea433105862b1ecc50c512979ef9
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
97de0c9a29f76f936e1d93f9031e178b56af514f 21-May-2015 Eric Laurent <elaurent@google.com> Merge "AudioService: indicate system ready to AudioFlinger" into mnc-dev
0867bed9ddb3bea3d7c252791f8b62ae21ad3de5 20-May-2015 Eric Laurent <elaurent@google.com> AudioService: indicate system ready to AudioFlinger

Indicate when JAVA services are ready to AudioFlinger so that
calls to power manager and scheduling service can be enabled.

Bug: 11520969.
Change-Id: Id977cab3208c34709011703d2dfdcf552e60371b
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
cae346633321e237f824f3ca10d7e6fff2307b2f 20-May-2015 Eric Laurent <elaurent@google.com> AudioFormat: more compressed formats

Add MP3 and AAC as valid AudioFormat encodings.
Only @hide for now to allow system components to manage
audio patches with those formats.

Bug: 18649264.
Change-Id: I5ef5f151783308e31d8ac5b29454589077ef62ea
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
d138e4e751b821ea6918faf870580f4f7a9b138a 16-May-2015 Eric Laurent <elaurent@google.com> AudioService: add missing audio becoming noisy intent

Add missing audio becoming noisy intent when the bluetooth
service is disconnected.

Bug: 21160886.
Change-Id: Idd96610a0ff824bd6337c37df60fa13f5bc6e54b
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
20eec5bb794d0e1333ab3dca370f8b2ad2498416 09-May-2015 Paul McLean <pmclean@google.com> Add manufacturer-provided device name for AudioPort name field for BT devices.
Change "a2dp-device" to empty string for EnumAPI.

Bug: 20880296
Change-Id: If377735b6d552bb929e5881743bcc3c9a2afb9e3
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
50ced3f3231a26ddcafbc84600d7cf3f5a2a40d5 11-May-2015 John Spurlock <jspurlock@google.com> Zen: Ringer mode integration fixes.

- Properly mute media + alarm streams in total silence.
- Allow system components to update the "ringer mode affected"
streams dynamically.
- Improve dumpsys output for ringer mode streams (include names).
- Remember last ringer mode properly when entering dnd via a
volume down (so we can restore it properly when exiting).

Bug: 20854925
Bug: 20950463
Bug: 20756527
Change-Id: I80afc1f639ff802c541020e25ade1b23e9997ef9
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
bcb6c1eb9e762455510645eb47579f7d597d6b78 11-May-2015 Fyodor Kupolov <fkupolov@google.com> Fix errors during user switching

Fix NPE in getHomeActivityForUser. Skip system processes in
killBackgroundUserProcessesWithRecordAudioPermission.

Bug: 21016983
Change-Id: I97f9ca362f4dbf0a659e3d5d7ae6cd8dbeb6404a
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
b501330a1b6ef14ff512a5727f7a01bc423d6fbb 18-Apr-2015 Fyodor Kupolov <fkupolov@google.com> Disable multi-user background recording

On user switch, kill existing processes of the background user with
android.permission.RECORD_AUDIO permission. Home activity should not be
killed to avoid an expensive restart of the home launcher, when the
user switches back.

Introduced DISALLOW_RECORD_AUDIO user restriction, which is enabled for the
background user, and removed for the foreground user.

Introduced a concept of system controlled user restriction, which can only
be set by the system, rather than device administrator.

Bug: 20346194
Change-Id: Ic942fd565e80d14424230dae612965a8e229c4ef
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
f764d219f0faf82219600761c8d0562623b8f054 30-Apr-2015 Jean-Michel Trivi <jmtrivi@google.com> Merge "AudioService receives callback for dynamic policy mix state changes" into mnc-dev
5a56109d1f5c00404c8f0e4281b9ac1392d72886 24-Apr-2015 Jean-Michel Trivi <jmtrivi@google.com> AudioService receives callback for dynamic policy mix state changes

AudioService registers a callback for dynamic policies from
AudioSystem.
AudioSystem keeps track of a single callback for dynamic policies.

Bug 20226914

Change-Id: I48899d20d1dbb47bb680e733a3bc9fd064b60f07
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
d9c75dba75ad4742dbaadc34db99d2b76cebca91 28-Apr-2015 John Spurlock <jspurlock@google.com> Volume: Simple dialog footer, DND in quick settings.

- Show DND tile by default, this is now the only
place to manage DND modes / end conditions.
- Remove super footer from volume dialog, replace with
a simplified version that displays the current mode
and allows ending DND.
- Remove obsolete text-only footer from codebase.
- Migrate remaining volume items into main resource files.
- Rename "No interruptions" to "Total silence".
- Add new user information banner for "Total silence"
- Crude media filtering for Total Silence.
(deeper muting changes will be done as a followup)
- Disable volume dialog sliders completely if muted due
to zen.
- Cleanup ZenModePanel: assume embedded mode, remove
expandable subhead
- Remember "favorite" DND mode inside the DND config panel.
- AudioService: consult ringer-mode-delegate before voluming
down into silent.
- Add new hour options to time-based exit conditions.
- Volume dialog visual updates to move closer to final visuals.
- Unify ringer=silent with DND.

Bug: 19260237
Change-Id: I05d7e001eca3b5125418ec3bc4087d0cb8866717
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
8c3dc85de5d6c2ab15a5d9a43feefe608df3cb35 24-Apr-2015 John Spurlock <jspurlock@google.com> AudioService: Fix mConnectedDevices iteration issues.

- Don't remove from the map while iterating.
- Use ArrayMap and tighten up all iterations to avoid unnecessary
allocations.

Bug: 20523001
Change-Id: I2587d0f9778b38d96afdfd0e61b00b06911837ae
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
b02c744f05b0cca05b77fcbaad4a546ad86081eb 14-Apr-2015 John Spurlock <jspurlock@google.com> Zen: Enter alarms only on volume down from vibrate.

And vice versa (when dialog is showing).

Also make alarms only the default mode when DND is switched on
via the switch.

Bug: 19260237
Change-Id: I16e4a27944bc8245bb2beed84c0421d493b0b876
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
15427f80bb9632ec34f5491f0e9ac2c4f977074e 27-Mar-2015 John Spurlock <jspurlock@google.com> Merge "AudioService: Observe changes to output devices per-stream."
0a376af22411e3592441da1688d8b134133227ba 26-Mar-2015 John Spurlock <jspurlock@google.com> AudioService: Resolve stream before sending to volume UI.

- Don't send streams that the UI cannot display.
- Add an input validation check to adjustSuggestedStreamVolume.
- Remove unused validation method.

Bug: 19949071
Change-Id: Ib7a7c9bf386a8b2d7a0fb13928d103d764ec7aa9
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
8a52c4491dfbb8354a92c0a1e6abc86848e187c6 26-Mar-2015 John Spurlock <jspurlock@google.com> AudioService: Observe changes to output devices per-stream.

- Keep track of calls to AudioSystem.getDevicesForStream.
- Report device changes for the base streams to the binary event log.
- Fire internal intent so volume UI can respond to changes.
- Update devices when new routes are reported.

Bug: 19618959
Change-Id: I7bbd497b178d9829accc19e6c951a711aef8590c
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
1a7700793db3c7b60d5e090ee026a1bcfeff91d8 19-Mar-2015 Phil Burk <philburk@google.com> AudioService: fix String cast crash when mediaserver killed

Bug: 19847028
Change-Id: I45668fbd08e87df69fe3867473a09c387589ca8a
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
413d307c2c646bb2aa563f8167bfa78f0b59a654 19-Mar-2015 Phil Burk <philburk@google.com> AudioService: fix crash when mediaserver killed

Bug: 19847028
Change-Id: I4acacd8a6d20317d180a6994158abc0b2957280c
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
07e72432ac4a83f428d7f9ccf1e11594c67c1993 13-Mar-2015 John Spurlock <jspurlock@google.com> VolumePolicy: Debounce adjustments from vibrate->silent.

Disallows volume adjustments (lower) from vibrate to silent
until a small period of time after an adjustment from normal
to vibrate.

This provides for enough time for the user to see the state change
to vibrate and feel the associated haptic feedback before yet
another state change to silent.

Bug: 19260237
Change-Id: I5843a1c144d56146a83db194f352832c8d85159d
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
b6e19e3e0f0170d058636101e23f964196f6f4b2 11-Mar-2015 John Spurlock <jspurlock@google.com> AudioService: Define minimum levels for volume streams.

- Set a floor of 1 for voice call + bluetooth sco, otherwise 0.
- All api calls validated to ensure a floor of the min level.
- Volume UI updated to shift the seekbar by the min value.
- Remove duplicate static max method in AudioService.
- Ensure streams with a min level > 0 are not considered muteable.

Bug: 19260237
Change-Id: I213180c9c277f51bd3897b7f777e5f88ed1db125
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
a48d779dad4c48aa2f97ad021ae3a5649c058312 03-Mar-2015 John Spurlock <jspurlock@google.com> Volume policy updates.

- Make volume policy settable by the volume UI instead
of hardcoded in AudioService.
- Add status bar icon for silent mode.
- Limit unmute-on-volume-adjust behavior to tvs.
- Ensure all changes to device volume are sent through
setIndex so no change events are missed.

Bug: 19260237
Change-Id: Iea070a7a6f90ff620e39629f2da3f33f87223d72
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
9087433753a5068819dcd3e86bdc2cce82bb8040 10-Mar-2015 John Spurlock <jspurlock@google.com> AudioService: Write base stream volume changes to the event log.

- Add a new volume_changed event, reported at the stream level.
- Only include changes to base streams (no aliases).
- Include the caller for each change. A caller is either:
- a pkg name (for external calls or known media sessions)
- a system server class's log tag (for internal calls,
disambiguates "android")

Bug: 19599935
Change-Id: Ia61b68ff1e7e2907a24972790ec052bfe099e665
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
394a8e1fa7d2aeeec3d750378c1cb5861a583eeb 03-Mar-2015 Paul McLean <pmclean@google.com> Handle simultaneous connect of devices with the same "type" (as in USB)

Change-Id: I163bf8e33ccf5aacc7ba21775916727430327f18
Bug: 19563570
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
1ff1e6edf133158351e793dd842bd0655ef6c199 09-Mar-2015 John Spurlock <jspurlock@google.com> AudioService: Fix device dump in dumpsys output.

Bug: 19653026
Change-Id: Id09a502f1507477403c49be32ee0ed0f00ab288f
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
b32fc97282aa95ceefa8601846d83fa6154163db 05-Mar-2015 John Spurlock <jspurlock@google.com> AudioService: Add current stream devices to dumpsys output.

Change-Id: I57ed785154d8d75ac0f189a479252a725e80bd5a
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
ee5ad729b90deff435f9875337cbc434be4f8fe7 03-Mar-2015 John Spurlock <jspurlock@google.com> Audio: Remove the concept of master volume.

- Remove two config resources (use master volume, and volume ramp).
- Remove master volume adjustments / getters / intents.
- Retain @hidden setMasterMute, needed for device admin
- Remove master volume logic in AudioService.
- Remove master volume logic in VolumePanel.
- Rename "getMasterStreamType" to "getUiSoundsStreamType" to avoid confusion.

Bug: 19582978
Change-Id: Id02c8fa4898cff3b913147f5ac1b4038e2e7cc24
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
6611bfdaa4dc7688d76d8ab70799c312d0c74446 03-Mar-2015 John Spurlock <jspurlock@google.com> Merge "AudioService: Fix typo/grammar in comment."
bc82b12eb74e5a218894e7ff361767303bf1f2c4 02-Mar-2015 John Spurlock <jspurlock@google.com> AudioService: Fix typo/grammar in comment.

Change-Id: I311fc5d7531464bbaeef5937c5ff2b757a8e675e
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
7b91c55b3ff4857e904a11a0a67fcc86a32868b4 02-Mar-2015 John Spurlock <jspurlock@google.com> Merge "Remove unused imports in frameworks/base."
4b69ac70a1fa7a3bd4bb8b24efdaa6cf626c6853 02-Mar-2015 John Spurlock <jspurlock@google.com> Merge "AudioService: Migrate index map to SparseIntArray."
2bb02ec6a99a08366b4a357aac3683ec5c18c184 02-Mar-2015 John Spurlock <jspurlock@google.com> AudioService: Migrate index map to SparseIntArray.

- Use SparseIntArray instead of a generic hash map.
- Avoids unnecessary boxing/unboxing.
- Avoids unnecessary allocation for iterator temp objects.
- Provides deterministic dumping (by ascending device order).

Change-Id: If5ca5edd94af90cfed65ecbbbc1f4929f50ab6e9
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
59dc9c1d19e52bcbfb05ebe78e097496532062bc 02-Mar-2015 John Spurlock <jspurlock@google.com> AudioService: Fix typo in constant.

Change-Id: I66dba8ffbbe59ab82f97c989163db04741c9a1d1
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
08c7116ab9cd04ad6dd3c04aa1017237e7f409ac 28-Feb-2015 John Spurlock <jspurlock@google.com> Remove unused imports in frameworks/base.

Change-Id: I031443de83f93eb57a98863001826671b18f3b17
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
864908620eabc8594b178f0f970eea0066be4c83 25-Feb-2015 John Spurlock <jspurlock@google.com> AudioService: Use the foreground broadcast queue for fired intents.

Minimize delay for receivers, assume they are providing volume UI.

Change-Id: I054bac4292ad7c608cd46543409595dcea6a7731
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
7a9ba420f440319ca6c31d554c2273f81f10b16f 16-Feb-2015 Jinsuk Kim <jinsukkim@google.com> Pass old and new volume to CEC without rounding up

Unnecessary rounding up was causing volume change requests
not to be converted to CEC commands occasionally. Removed
the operation.

Bug: 19332158
Change-Id: Ia074722058ada55d46f38aea7a2b915bb5fd2a00
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
0dfc90157d6fb9d773e59dfaab08a1722417a489 19-Feb-2015 John Spurlock <jspurlock@google.com> Merge "AudioService: Fire volume-changed intents for all streams."
c16442c515f136e1f014e57dabfa878ed2441552 19-Feb-2015 John Spurlock <jspurlock@google.com> Merge "AudioService: Fire the mute-changed intent for all changes."
f63860cd8072bc9a9e5178ff3b60d262999c78fc 19-Feb-2015 John Spurlock <jspurlock@google.com> AudioService: Fire volume-changed intents for all streams.

Allow observing all stream changed events, including streams
that are bound to another stream via aliasing.

Change-Id: I2c1717ce632c4cb045c06785cb1ecc531a221ff8
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
22b9ee129817f865f69bbcd3d95151c61d2d0ef0 19-Feb-2015 John Spurlock <jspurlock@google.com> AudioService: Fire the mute-changed intent for all changes.

Not merely those coming from explicit mute adjustments.

Change-Id: I79ad7e5800eb0602fd10d966441973800a1c318b
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
5e783732b672e7dc27d89cb9fe945bdf8364c39e 19-Feb-2015 John Spurlock <jspurlock@google.com> AudioService: easier forced camera sound debugging.

- Add mCameraSoundForced to the service state dumpsys output.
- Add a sysprop to opt-in to this behavior for testing. Does
not replace the configuration check.
- Centralize the configuration read in one place.

Change-Id: I83f84394b616f0788029412233ae1412b3cdedf2
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
3ce3725b289dae8ce01ee2e4b43a84424a7c5fbe 17-Feb-2015 John Spurlock <jspurlock@google.com> Use the unresolved stream type for mute checking.

Change-Id: I2eab68727f1d1e6846ad0536ee456daf26f6699e
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
7d3cf59227a9bd8f0a5e29a4d82666d971280d92 17-Feb-2015 John Spurlock <jspurlock@google.com> Merge "Volume: Allow dialog to query "muteable" streams."
a9dfbe8b122d746cf8841fe1b13d31e7e0fc9c52 17-Feb-2015 John Spurlock <jspurlock@google.com> Volume: Allow dialog to query "muteable" streams.

Similar to the existing ability to query streams affected
by ringer mode.

Bug:19260237
Change-Id: I76eb5ab6b7c7e3a4d73ac1909289c560194d4fe8
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
7139fdc001ae78c684604419c7bb3669d2bcd839 13-Feb-2015 Eric Laurent <elaurent@google.com> Merge "AudioService: persist volume of ring stream when ringer mode changed"
cdb57aeb0e2c83a887c86da0ca2a890df7f02f41 12-Feb-2015 John Spurlock <jspurlock@google.com> Allow sysui-managed remote volume controllers.

- Relax restriction on audio service calls that assume the volume
ui is systemui, allow calls from a blessed component app.
- Blessed component app service saved in secure settings.
- SystemUI mediates requests to replace the volume dialog, prompts
the user on activation.
- Show a low pri ongoing notification when the volume dialog is
being replaced, to allow user restoration at any time.
- Replace the controller management code in VolumeUI to use a
ServiceMonitor, backed by the new blessed app component setting.
- Add proper zen-related noman client wrappers, make avail to the
registered volume controller.
- Everything is still @hidden, no api impact.

Bug: 19260237
Change-Id: Ie1383f57659090318a7eda737fdad5b8f88737d4
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
9e0d25fb875b436d9de577ecfdae50511b8aa289 13-Feb-2015 Eric Laurent <elaurent@google.com> AudioService: persist volume of ring stream when ringer mode changed

-Originally, when ringer mode changed from vibrate to normal by
adjusting volume from 0 to 1 , volume index will not be persisted.
After device rebooted, volume of ring stream will be restored to 0
-Persist volume index when ringer mode changed

Bug: 18762217

Change-Id: I75fbeaab01d80b8bcee623795f59a9e9f16b9634
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java
6156017c2217d0fbbbb03434986250ec6bbd69d8 07-Feb-2015 John Spurlock <jspurlock@google.com> Move AudioService to services.

...and a few dependencies. Move remaining shared items to AudioSystem.

Change-Id: Ib9623ff867678d34977337856bb0156e8cdaeeb5
/frameworks/base/services/core/java/com/android/server/audio/AudioService.java