Silent and Vibrate mode clean up

Clean up related to new Vibration policy.
The vibrate behavior is now only derived from:
 - presence of a vibrator on the device
 - current ringer mode selected: NORMAL, VIBRATE or SILENT
If no vibrator is present the ringer mode can only be NORMAL or SILENT.

The control of ringer mode via volume keys when volume keys control the "master"
stream type (RING on phones, MUSIC on tablets) is as follows:
If a vibrator is present:
 VOL- and volume equals 1: NORMAL => VIBRATE
 VOL- and volume equals 0 and not continuous press: VIBRATE => SILENT
 VOL+ and in SILENT mode: SILENT => VIBRATE
 VOL+ and in VIBRATE mode: VIBRATE => NORMAL, volume = 1
If no vibrator is present:
 VOL- and volume equals 0 and not continuous press: NORMAL => SILENT
 VOL+ and in SILENT mode: SILENT => NORMAL, volume = 0

VIBRATE_ON and VIBRATE_IN_SILENT settings are not stored/retreived any more.

AudioService checks and corrects ringer mode and stream volumes if necessary when reading from
DB at boot time.

Also:
 Added dump for stream volumes in AudioService.
 Added device names missing in AudioSystem for USB accessory and USB device.

Issue: 6036529
Issue: 6414950
Issue: 6448163

Change-Id: I77fb821ec63e4e566320cac2701b4ac466e86aef
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
index 5f18b5d..374226d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
@@ -122,8 +122,7 @@
                     action.equals(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED)) {
                 updateBluetooth(intent);
             }
-            else if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION) ||
-                    action.equals(AudioManager.VIBRATE_SETTING_CHANGED_ACTION)) {
+            else if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION)) {
                 updateVolume();
             }
             else if (action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) {
@@ -144,7 +143,6 @@
         filter.addAction(Intent.ACTION_ALARM_CHANGED);
         filter.addAction(Intent.ACTION_SYNC_STATE_CHANGED);
         filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
-        filter.addAction(AudioManager.VIBRATE_SETTING_CHANGED_ACTION);
         filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
         filter.addAction(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED);
         filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
@@ -238,7 +236,7 @@
 
         final int iconId;
         String contentDescription = null;
-        if (audioManager.shouldVibrate(AudioManager.VIBRATE_TYPE_RINGER)) {
+        if (ringerMode == AudioManager.RINGER_MODE_VIBRATE) {
             iconId = R.drawable.stat_sys_ringer_vibrate;
             contentDescription = mContext.getString(R.string.accessibility_ringer_vibrate);
         } else {