History log of /frameworks/base/services/core/java/com/android/server/audio/AudioService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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