From 34831c9330d4f2993ac1d698a7e176c4b8848b48 Mon Sep 17 00:00:00 2001 From: Yu Shan Emily Lau Date: Fri, 25 Sep 2009 11:18:40 -0700 Subject: [PATCH] Removed the device type checking --- .../MediaProfileReader.java | 49 ++++++++++--------- .../functional/MediaRecorderTest.java | 26 +++++----- 2 files changed, 39 insertions(+), 36 deletions(-) diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaProfileReader.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaProfileReader.java index 53afb1da936c7..717f7bac5c0d9 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaProfileReader.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaProfileReader.java @@ -58,19 +58,21 @@ public class MediaProfileReader { public static void createVideoProfileTable() { // push all the property into one big table String encoderType = getVideoCodecProperty(); - String encoder[] = encoderType.split(","); - for (int i = 0; i < encoder.length; i++) { - for (int j = 0; j < VIDEO_ENCODER_PROPERTY.length; j++) { - String propertyName = MEDIA_ENC_VID + encoder[i] + VIDEO_ENCODER_PROPERTY[j]; - String prop = SystemProperties.get(propertyName); - //push to the table - String propRange[] = prop.split(","); - OUTPUT_FORMAT_TABLE.put((encoder[i] + VIDEO_ENCODER_PROPERTY[j] + "_low"), - Integer.parseInt(propRange[0])); - OUTPUT_FORMAT_TABLE.put((encoder[i] + VIDEO_ENCODER_PROPERTY[j] + "_high"), - Integer.parseInt(propRange[1])); - } + if (encoderType.length() != 0) { + String encoder[] = encoderType.split(","); + for (int i = 0; i < encoder.length; i++) { + for (int j = 0; j < VIDEO_ENCODER_PROPERTY.length; j++) { + String propertyName = MEDIA_ENC_VID + encoder[i] + VIDEO_ENCODER_PROPERTY[j]; + String prop = SystemProperties.get(propertyName); + // push to the table + String propRange[] = prop.split(","); + OUTPUT_FORMAT_TABLE.put((encoder[i] + VIDEO_ENCODER_PROPERTY[j] + "_low"), + Integer.parseInt(propRange[0])); + OUTPUT_FORMAT_TABLE.put((encoder[i] + VIDEO_ENCODER_PROPERTY[j] + "_high"), + Integer.parseInt(propRange[1])); + } + } } } @@ -78,18 +80,19 @@ public class MediaProfileReader { // push all the property into one big table String audioType = getAudioCodecProperty(); String encoder[] = audioType.split(","); - for (int i = 0; i < encoder.length; i++) { - for (int j = 0; j < AUDIO_ENCODER_PROPERTY.length; j++) { - String propertyName = MEDIA_AUD_VID + encoder[i] + AUDIO_ENCODER_PROPERTY[j]; - String prop = SystemProperties.get(propertyName); - //push to the table - String propRange[] = prop.split(","); - OUTPUT_FORMAT_TABLE.put((encoder[i] + AUDIO_ENCODER_PROPERTY[j] + "_low"), - Integer.parseInt(propRange[0])); - OUTPUT_FORMAT_TABLE.put((encoder[i] + AUDIO_ENCODER_PROPERTY[j] + "_high"), - Integer.parseInt(propRange[1])); + if (audioType.length() != 0) { + for (int i = 0; i < encoder.length; i++) { + for (int j = 0; j < AUDIO_ENCODER_PROPERTY.length; j++) { + String propertyName = MEDIA_AUD_VID + encoder[i] + AUDIO_ENCODER_PROPERTY[j]; + String prop = SystemProperties.get(propertyName); + // push to the table + String propRange[] = prop.split(","); + OUTPUT_FORMAT_TABLE.put((encoder[i] + AUDIO_ENCODER_PROPERTY[j] + "_low"), + Integer.parseInt(propRange[0])); + OUTPUT_FORMAT_TABLE.put((encoder[i] + AUDIO_ENCODER_PROPERTY[j] + "_high"), + Integer.parseInt(propRange[1])); + } } - } } diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaRecorderTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaRecorderTest.java index 690eff650ec28..fdc5970df92f3 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaRecorderTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaRecorderTest.java @@ -434,15 +434,15 @@ public class MediaRecorderTest extends ActivityInstrumentationTestCase