Merge "Increment Version to 3.2_r2" into honeycomb-mr2
diff --git a/CtsTestCoverage.mk b/CtsTestCoverage.mk
index 7053fea..588c8f5 100644
--- a/CtsTestCoverage.mk
+++ b/CtsTestCoverage.mk
@@ -60,6 +60,8 @@
$(hide) echo $(1): file://$(ANDROID_BUILD_TOP)/$(COVERAGE_OUT)/$(4)
endef
+# classes.dex is stripped from package.apk if dex-preopt is enabled,
+# so we use the copy that definitely includes classes.dex.
define add-testcase-apk
- TEST_APKS += $(call intermediates-dir-for,APPS,$(1))/package.apk
+ TEST_APKS += $(call intermediates-dir-for,APPS,$(1))/package.apk.unaligned
endef
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
index 6fc5e59..2ab9457 100644
--- a/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/features/FeatureSummaryActivity.java
@@ -158,8 +158,8 @@
};
public static final Feature[] ALL_HONEYCOMB_MR1_FEATURES = {
- new Feature("android.hardware.usb.host", true),
- new Feature("android.hardware.usb.accessory", true),
+ new Feature("android.hardware.usb.host", false),
+ new Feature("android.hardware.usb.accessory", false),
};
public static final Feature[] ALL_HONEYCOMB_MR2_FEATURES = {
diff --git a/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java b/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
index 6012e7b..c63267c 100644
--- a/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
+++ b/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
@@ -338,10 +338,6 @@
// TODO: Add tests for the other touchscreen features.
}
- public void testUsbFeatures() {
- assertAvailable(PackageManager.FEATURE_USB_ACCESSORY);
- assertAvailable(PackageManager.FEATURE_USB_HOST);
- }
public void testWifiFeature() throws Exception {
boolean enabled = mWifiManager.isWifiEnabled();
diff --git a/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java b/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
index 2af36ff..cb1b7e5 100644
--- a/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
+++ b/tests/tests/dpi/src/android/dpi/cts/ConfigurationTest.java
@@ -48,10 +48,9 @@
int max = Math.max(metrics.widthPixels, metrics.heightPixels);
int min = Math.min(metrics.widthPixels, metrics.heightPixels);
- boolean format16x9 = Math.floor(max * 9.0d / 16.0d) <= min;
- boolean format4x3 = Math.ceil(max * 3.0d / 4.0d) >= min;
- assertTrue("Aspect ratio must be between 4:3 and 16:9. It was " + max + ":" + min,
- format4x3 && format16x9);
+ double aspectRatio = (double) max / min;
+ assertTrue("Aspect ratio must be between 1.333 and 1.86. It was " + aspectRatio,
+ aspectRatio >= 1.333 && aspectRatio <= 1.86);
Set<Integer> allowedDensities = new HashSet<Integer>();
allowedDensities.add(DisplayMetrics.DENSITY_LOW);
diff --git a/tests/tests/media/src/android/media/cts/MediaPlayerTest.java b/tests/tests/media/src/android/media/cts/MediaPlayerTest.java
index d18d684..5ab9b6d 100644
--- a/tests/tests/media/src/android/media/cts/MediaPlayerTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaPlayerTest.java
@@ -45,6 +45,8 @@
import java.io.File;
import java.io.FileDescriptor;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
@TestTargetClass(MediaPlayer.class)
public class MediaPlayerTest extends ActivityInstrumentationTestCase2<MediaStubActivity> {
@@ -63,8 +65,8 @@
private Context mContext;
private Resources mResources;
private CtsTestServer mServer;
- private static Object sVideoSizeChanged;
- private static Object sLock;
+ private CountDownLatch mVideoSizeChanged = new CountDownLatch(1);
+ private CountDownLatch mLock = new CountDownLatch(1);
private static Looper sLooper = null;
private static final int WAIT_FOR_COMMAND_TO_COMPLETE = 60000; //1 min max.
@@ -77,16 +79,6 @@
*/
private MediaPlayer mMediaPlayer = new MediaPlayer();
- static MediaPlayer.OnVideoSizeChangedListener mOnVideoSizeChangedListener =
- new MediaPlayer.OnVideoSizeChangedListener() {
- public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
- synchronized (sVideoSizeChanged) {
- Log.v(TAG, "sizechanged notification received ...");
- sVideoSizeChanged.notify();
- }
- }
- };
-
private static class Monitor {
private boolean signalled;
@@ -310,7 +302,7 @@
* Initializes the message looper so that the mediaPlayer object can
* receive the callback messages.
*/
- private static void initializeMessageLooper() {
+ private void initializeMessageLooper() {
new Thread() {
@Override
public void run() {
@@ -319,9 +311,7 @@
// Save the looper so that we can terminate this thread
// after we are done with it.
sLooper = Looper.myLooper();
- synchronized (sLock) {
- sLock.notify();
- }
+ mLock.countDown();
Looper.loop(); // Blocks forever until Looper.quit() is called.
Log.v(TAG, "initializeMessageLooper: quit.");
}
@@ -342,38 +332,36 @@
final float rightVolume = 0.5f;
final int resid = R.raw.testvideo;
- sLock = new Object();
- sVideoSizeChanged = new Object();
- MediaPlayer mp = new MediaPlayer();
+ mMediaPlayer.setOnVideoSizeChangedListener(new MediaPlayer.OnVideoSizeChangedListener() {
+ public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
+ mVideoSizeChanged.countDown();
+ }
+ });
AssetFileDescriptor afd = mResources.openRawResourceFd(resid);
- mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
+ mMediaPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
afd.close();
- mp.setDisplay(getActivity().getSurfaceHolder());
- mp.setScreenOnWhilePlaying(true);
- mp.prepare();
+ mMediaPlayer.setDisplay(getActivity().getSurfaceHolder());
+ mMediaPlayer.setScreenOnWhilePlaying(true);
+ mMediaPlayer.prepare();
int videoWidth = 0;
int videoHeight = 0;
- synchronized (sLock) {
- initializeMessageLooper();
- try {
- sLock.wait(WAIT_FOR_COMMAND_TO_COMPLETE);
- } catch(Exception e) {
- Log.v(TAG, "looper was interrupted.");
- return;
- }
- }
+ initializeMessageLooper();
try {
- mp.setOnVideoSizeChangedListener(mOnVideoSizeChangedListener);
- synchronized (sVideoSizeChanged) {
- try {
- sVideoSizeChanged.wait(WAIT_FOR_COMMAND_TO_COMPLETE);
- } catch (Exception e) {
- Log.v(TAG, "wait was interrupted");
- }
+ mLock.await(WAIT_FOR_COMMAND_TO_COMPLETE, TimeUnit.MILLISECONDS);
+ } catch(Exception e) {
+ Log.v(TAG, "looper was interrupted.");
+ return;
+ }
+
+ try {
+ try {
+ mVideoSizeChanged.await(WAIT_FOR_COMMAND_TO_COMPLETE, TimeUnit.MILLISECONDS);
+ } catch (InterruptedException e) {
+ Log.v(TAG, "wait was interrupted");
}
- videoWidth = mp.getVideoWidth();
- videoHeight = mp.getVideoHeight();
+ videoWidth = mMediaPlayer.getVideoWidth();
+ videoHeight = mMediaPlayer.getVideoHeight();
terminateMessageLooper();
} catch (Exception e) {
Log.e(TAG, e.getMessage());
@@ -381,15 +369,15 @@
assertEquals(expectedVideoWidth, videoWidth);
assertEquals(expectedVideoHeight, videoHeight);
- mp.start();
- mp.setVolume(leftVolume, rightVolume);
+ mMediaPlayer.start();
+ mMediaPlayer.setVolume(leftVolume, rightVolume);
// waiting to complete
- while (mp.isPlaying()) {
+ while (mMediaPlayer.isPlaying()) {
Thread.sleep(SLEEP_TIME);
}
- mp.release();
+ mMediaPlayer.release();
}
@TestTargets({