Adapt AudioManager volume test to new behavior

The control of silent/vibrate mode by volume keys changed again...
Removed the test of silent/vibrate mode changes induced by volume key presses as
this is defined by the UI spec and not the CDD and is cause for constant mismatch
between CTS and framework behavior.

Change-Id: I62354483357b60848718ca7c73964e2e70f1c2a5
diff --git a/tests/tests/media/src/android/media/cts/AudioManagerTest.java b/tests/tests/media/src/android/media/cts/AudioManagerTest.java
index d52bc33..f4d60c8 100644
--- a/tests/tests/media/src/android/media/cts/AudioManagerTest.java
+++ b/tests/tests/media/src/android/media/cts/AudioManagerTest.java
@@ -523,41 +523,11 @@
             }
             // on voice capable devices, ring and notification volumes cannot be set to 0
             // by continous press on volume minus key
-            mAudioManager.adjustStreamVolume(streams[i], ADJUST_LOWER, FLAG_SHOW_UI);
-            if(!voiceCapable || (streams[i] != AudioManager.STREAM_RING &&
-                    streams[i] != AudioManager.STREAM_NOTIFICATION)) {
-                assertEquals(0, mAudioManager.getStreamVolume(streams[i]));
-            } else {
-                assertEquals(1, mAudioManager.getStreamVolume(streams[i]));
-            }
-
-            // test ringer modes changes
-            mAudioManager.setRingerMode(RINGER_MODE_NORMAL);
-            assertEquals(RINGER_MODE_NORMAL, mAudioManager.getRingerMode());
-            mAudioManager.setStreamVolume(streams[i], 1, FLAG_SHOW_UI);
-            assertEquals(1, mAudioManager.getStreamVolume(streams[i]));
-
             // simulate volume key release
             mAudioManager.adjustStreamVolume(streams[i], ADJUST_SAME,
                     FLAG_SHOW_UI | FLAG_ALLOW_RINGER_MODES);
-
-            // decreasing the volume from 1 to 0 should change ringer mode
-            adjustStreamVolumeAndRingerMode(streams[i], ADJUST_LOWER);
-            assertEquals("Stream: " + i, 0, mAudioManager.getStreamVolume(streams[i]));
-            assertTrue("Stream: " + i, mAudioManager.getRingerMode() == RINGER_MODE_VIBRATE
-                    || mAudioManager.getRingerMode() == RINGER_MODE_SILENT);
-
-            // increasing the volume from 0 should change back to normal
-            adjustStreamVolumeAndRingerMode(streams[i], ADJUST_RAISE);
-            // on voice capable devices, ring and notification volumes will return to 1 when
-            // exiting silent mode. Otherwise, volume will stay at 0.
-            if(!voiceCapable || (streams[i] != AudioManager.STREAM_RING &&
-                    streams[i] != AudioManager.STREAM_NOTIFICATION)) {
-                assertEquals("Stream: " + i, 0, mAudioManager.getStreamVolume(streams[i]));
-            } else {
-                assertEquals("Stream: " + i, 1, mAudioManager.getStreamVolume(streams[i]));
-            }
-            assertTrue("Stream: " + i, mAudioManager.getRingerMode() == RINGER_MODE_NORMAL);
+            mAudioManager.adjustStreamVolume(streams[i], ADJUST_LOWER, FLAG_SHOW_UI);
+            assertEquals(0, mAudioManager.getStreamVolume(streams[i]));
 
             // volume raise
             mAudioManager.setStreamVolume(streams[i], 0, FLAG_SHOW_UI);
@@ -612,17 +582,6 @@
         assertFalse(mAudioManager.isMusicActive());
     }
 
-    /**
-     * Imitate how pressing the volume key adjusts the volume either up or down and releasing the
-     * key causes an ADJUST_SAME direction afterwards.
-     */
-    private void adjustStreamVolumeAndRingerMode(int streamType, int direction) {
-        mAudioManager.adjustStreamVolume(streamType, direction,
-                FLAG_SHOW_UI | FLAG_ALLOW_RINGER_MODES);
-        mAudioManager.adjustStreamVolume(streamType, ADJUST_SAME,
-                FLAG_SHOW_UI | FLAG_ALLOW_RINGER_MODES);
-    }
-
     public void testSetInvalidRingerMode() {
         int ringerMode = mAudioManager.getRingerMode();
         mAudioManager.setRingerMode(-1337);