AudioService: Catch up to CM

Combo of a few commits we were missing

Send device connection intents from AudioService
AudioService is currently notified of wired headset and A2DP
sink connection states via broadcast intents from WiredAccessoryObserver
and BluetoothA2dpService. This is a problem as there is no guaranty that
AudioService can take actions upon the change before other apps are notified.
For instance, the Play On feature requires the UI to be refreshed when a device
is inserted/removed and we must guaranty that the UI component can read
new A2DP enable state from AudioManager after it receives a device connection state
change intent.

- Added hidden methods to AudioManager so that WiredAccessoryObserver
and BluetoothA2dpService can notify AudioService of device connection directly.
- The wired accessories connection intents are now sent by AudioService.
- The A2DP state change intent is delayed by BluetoothA2DPService when
ACTION_AUDIO_BECOMING_NOISY is sent by AudioService
- ACTION_AUDIO_BECOMING_NOISY intent is not sent when disconnecting A2DP
while a wired headset is present and vice versa.

Bug 6485897.

Change-Id: Ie160b3ee5f451132065530772b868593c90afd94

Audioservice: fix A2dp support on Samsung's Audio Policy HAL.
Samsung's audio policy HAL doesn't handle A2DP delay commands
correctly which was merged in JB.
Adds a nodelaya2dp config option.

Change-Id: I188c6e59fdf1b30bef41d8e1aa84ac5319f3bcc3

Fix code formatting issues.
Change-Id: I5c3cde249cd5b514c616b8c42b8eb2549de247a6

Fix ringer mode being unneededly changed by setting ringer mode volume
to 0.

When having set the ringer mode to silent on a device with vibrator and
calling setStreamVolume() for the ringer stream again (e.g. in one of
the volume control dialogs in the settings app), the ringer mode is set
to vibrate, although there's no reason to do so.

Fix that by remembering the last non-normal (that is, either silent or
vibrate) ringer mode and using that when setting the stream volume to 0.

Change-Id: I27f1c75a0fef52bd63ac20f4101042808ce2c458
JIRA: CYAN-1403

Fix ringer mode being unneededly changed by setting ringer mode volum…
…e to 0.

When having set the ringer mode to silent on a device with vibrator and
calling setStreamVolume() for the ringer stream again (e.g. in one of
the volume control dialogs in the settings app), the ringer mode is set
to vibrate, although there's no reason to do so.

Fix that by remembering the last non-normal (that is, either silent or
vibrate) ringer mode and using that when setting the stream volume to 0.

Change-Id: Idb4a34743c0db5da61b3354889212fbdc9e3ee81
JIRA: CYAN-1403