am 62563bc4: Only run the test if the device has audio output.
* commit '62563bc49472a41517fe082616bfe14628b9649b':
Only run the test if the device has audio output.
diff --git a/tests/tests/media/src/android/media/cts/AudioTrackTest.java b/tests/tests/media/src/android/media/cts/AudioTrackTest.java
index d01ecec..a342c37 100644
--- a/tests/tests/media/src/android/media/cts/AudioTrackTest.java
+++ b/tests/tests/media/src/android/media/cts/AudioTrackTest.java
@@ -16,6 +16,7 @@
package android.media.cts;
+import android.content.pm.PackageManager;
import android.cts.util.CtsAndroidTestCase;
import android.media.AudioFormat;
import android.media.AudioManager;
@@ -1541,7 +1542,16 @@
}
}
+ private boolean hasAudioOutput() {
+ return getContext().getPackageManager()
+ .hasSystemFeature(PackageManager.FEATURE_AUDIO_OUTPUT);
+ }
+
public void testGetTimestamp() throws Exception {
+ if (!hasAudioOutput()) {
+ return;
+ }
+
// constants for test
final String TEST_NAME = "testGetTimestamp";
final int TEST_SR = 22050;