Check new mediarecorder tests that require mic

Change-Id: I57d23cbec45f736b2d103682e3f1525b92e280ae
diff --git a/tests/tests/media/src/android/media/cts/MediaRecorderTest.java b/tests/tests/media/src/android/media/cts/MediaRecorderTest.java
index bdc6575..db136f2 100644
--- a/tests/tests/media/src/android/media/cts/MediaRecorderTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaRecorderTest.java
@@ -414,6 +414,9 @@
         args = {int.class}
     )
     public void testSetMaxDuration() throws Exception {
+        if (!hasMicrophone()) {
+            return;
+        }
         mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
         mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
         mMediaRecorder.setMaxDuration(0);
@@ -431,15 +434,18 @@
         args = {int.class}
     )
     public void testSetMaxFileSize() throws Exception {
-            mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
-            mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
-            mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
-            mMediaRecorder.setMaxFileSize(0);
-            mMediaRecorder.prepare();
-            mMediaRecorder.start();
-            Thread.sleep(RECORD_TIME * 30);
-            mMediaRecorder.stop();
-            checkOutputExist();
+        if (!hasMicrophone()) {
+            return;
+        }
+        mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
+        mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
+        mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
+        mMediaRecorder.setMaxFileSize(0);
+        mMediaRecorder.prepare();
+        mMediaRecorder.start();
+        Thread.sleep(RECORD_TIME * 30);
+        mMediaRecorder.stop();
+        checkOutputExist();
     }
 
     @TestTargets({