Don’t run on devices with no audio output.

Bug: 19900185
Change-Id: I70128e5ff2b40dadc677ba744e3450a6499b5328
(cherry picked from commit 5dbab866a09481e27976b144a23f189e68b1fb16)
diff --git a/tests/tests/media/src/android/media/cts/VisualizerTest.java b/tests/tests/media/src/android/media/cts/VisualizerTest.java
index ea7a13f..3c639a0 100644
--- a/tests/tests/media/src/android/media/cts/VisualizerTest.java
+++ b/tests/tests/media/src/android/media/cts/VisualizerTest.java
@@ -228,6 +228,9 @@
 
     //Test case 3.0: test setting NONE measurement mode
     public void test3_0MeasurementModeNone() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
         try {
             getVisualizer(0);
             mVisualizer.setEnabled(true);
@@ -257,6 +260,9 @@
 
     //Test case 4.0: test setting peak / RMS measurement mode
     public void test4_0MeasurementModePeakRms() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
         try {
             getVisualizer(0);
             mVisualizer.setEnabled(true);
@@ -282,6 +288,9 @@
 
     //Test case 4.1: test measurement of peak / RMS
     public void test4_1MeasurePeakRms() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
         AudioEffect vc = null;
         try {
             // this test will play a 1kHz sine wave with peaks at -40dB
@@ -352,6 +361,9 @@
 
     //Test case 4.2: test measurement of peak / RMS in Long MP3
     public void test4_2MeasurePeakRmsLongMP3() throws Exception {
+        if (!hasAudioOutput()) {
+            return;
+        }
         AudioEffect vc = null;
         try {
             // this test will play a 1kHz sine wave with peaks at -40dB