Merge "Add color selectors for transparent cache color hint when accelerated"
diff --git a/api/current.xml b/api/current.xml
index e2ceb3f..df4b914 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -1949,7 +1949,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843553"
+ value="16843552"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -1960,7 +1960,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843552"
+ value="16843551"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -1971,7 +1971,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843554"
+ value="16843553"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -2147,7 +2147,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843585"
+ value="16843584"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -2180,7 +2180,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843566"
+ value="16843565"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -2312,7 +2312,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843561"
+ value="16843560"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -2389,7 +2389,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843550"
+ value="16843549"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -2499,7 +2499,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843563"
+ value="16843562"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -2543,7 +2543,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843578"
+ value="16843577"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -2675,7 +2675,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843582"
+ value="16843581"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -2686,7 +2686,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843581"
+ value="16843580"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -3588,7 +3588,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843579"
+ value="16843578"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -3599,7 +3599,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843577"
+ value="16843576"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -3610,7 +3610,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843545"
+ value="16843544"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -3940,7 +3940,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843547"
+ value="16843546"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -3995,7 +3995,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843548"
+ value="16843547"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -4193,7 +4193,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843588"
+ value="16843587"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -4215,7 +4215,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843593"
+ value="16843592"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -4226,7 +4226,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843590"
+ value="16843589"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -4237,7 +4237,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843591"
+ value="16843590"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -4248,7 +4248,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843589"
+ value="16843588"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -4259,7 +4259,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843592"
+ value="16843591"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -4952,7 +4952,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843546"
+ value="16843545"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -4963,7 +4963,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843564"
+ value="16843563"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -5293,7 +5293,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843559"
+ value="16843558"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -5469,7 +5469,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843586"
+ value="16843585"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -5568,7 +5568,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843580"
+ value="16843579"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -6844,7 +6844,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843565"
+ value="16843564"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -7394,7 +7394,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843560"
+ value="16843559"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -7867,7 +7867,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843573"
+ value="16843572"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -7878,7 +7878,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843574"
+ value="16843573"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -7889,7 +7889,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843575"
+ value="16843574"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -7988,7 +7988,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843571"
+ value="16843570"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -7999,7 +7999,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843572"
+ value="16843571"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -8351,7 +8351,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843583"
+ value="16843582"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -8384,7 +8384,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843549"
+ value="16843548"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -8538,7 +8538,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843576"
+ value="16843575"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -8791,7 +8791,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843562"
+ value="16843561"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -8978,7 +8978,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843584"
+ value="16843583"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -9737,7 +9737,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843556"
+ value="16843555"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -9748,7 +9748,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843555"
+ value="16843554"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -9770,18 +9770,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843557"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="textLineHeight"
- type="int"
- transient="false"
- volatile="false"
- value="16843544"
+ value="16843556"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -10188,7 +10177,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843567"
+ value="16843566"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -10199,7 +10188,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843568"
+ value="16843567"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -10210,7 +10199,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843569"
+ value="16843568"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -10221,7 +10210,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843570"
+ value="16843569"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -10298,7 +10287,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843551"
+ value="16843550"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -10441,7 +10430,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843587"
+ value="16843586"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -10771,7 +10760,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="16843558"
+ value="16843557"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -29871,6 +29860,36 @@
 <parameter name="a" type="android.app.Activity">
 </parameter>
 </method>
+<method name="setMaxVisible"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="visibleCrumbs" type="int">
+</parameter>
+</method>
+<method name="setParentTitle"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="title" type="java.lang.CharSequence">
+</parameter>
+<parameter name="shortTitle" type="java.lang.CharSequence">
+</parameter>
+<parameter name="listener" type="android.view.View.OnClickListener">
+</parameter>
+</method>
 <method name="setTitle"
  return="void"
  abstract="false"
@@ -148256,6 +148275,23 @@
 <parameter name="view" type="android.view.View">
 </parameter>
 </method>
+<method name="setParentTitle"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="title" type="java.lang.CharSequence">
+</parameter>
+<parameter name="shortTitle" type="java.lang.CharSequence">
+</parameter>
+<parameter name="listener" type="android.view.View.OnClickListener">
+</parameter>
+</method>
 <method name="setPreferenceScreen"
  return="void"
  abstract="false"
@@ -248888,19 +248924,6 @@
 <parameter name="input" type="android.text.method.KeyListener">
 </parameter>
 </method>
-<method name="setLineHeight"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="lineHeight" type="int">
-</parameter>
-</method>
 <method name="setLineSpacing"
  return="void"
  abstract="false"
@@ -251222,7 +251245,7 @@
  deprecated="not deprecated"
  visibility="public"
 >
-<parameter name="arg0" type="T">
+<parameter name="t" type="T">
 </parameter>
 </method>
 </interface>
diff --git a/core/java/android/app/FragmentBreadCrumbs.java b/core/java/android/app/FragmentBreadCrumbs.java
index 8d76ffe..fb89099 100644
--- a/core/java/android/app/FragmentBreadCrumbs.java
+++ b/core/java/android/app/FragmentBreadCrumbs.java
@@ -45,6 +45,10 @@
 
     // Hahah
     BackStackRecord mTopEntry;
+    BackStackRecord mParentEntry;
+
+    /** Listener to inform when a parent entry is clicked */
+    private OnClickListener mParentClickListener;
 
     public FragmentBreadCrumbs(Context context) {
         this(context, null);
@@ -75,27 +79,51 @@
     }
 
     /**
-     * The maximum number of crumbs to show.
-     * @hide
+     * The maximum number of breadcrumbs to show. Older fragment headers will be hidden from view.
+     * @param visibleCrumbs the number of visible breadcrumbs. This should be greater than zero.
      */
     public void setMaxVisible(int visibleCrumbs) {
+        if (visibleCrumbs < 1) {
+            throw new IllegalArgumentException("visibleCrumbs must be greater than zero");
+        }
         mMaxVisible = visibleCrumbs;
     }
 
     /**
+     * Inserts an optional parent entry at the first position in the breadcrumbs. Selecting this
+     * entry will result in a call to the specified listener's 
+     * {@link android.view.View.OnClickListener#onClick(View)}
+     * method.
+     *
+     * @param title the title for the parent entry
+     * @param shortTitle the short title for the parent entry
+     * @param listener the {@link android.view.View.OnClickListener} to be called when clicked.
+     * A null will result in no action being taken when the parent entry is clicked.
+     */
+    public void setParentTitle(CharSequence title, CharSequence shortTitle,
+            OnClickListener listener) {
+        mParentEntry = createBackStackEntry(title, shortTitle);
+        mParentClickListener = listener;
+        updateCrumbs();
+    }
+
+    private BackStackRecord createBackStackEntry(CharSequence title, CharSequence shortTitle) {
+        if (title == null) return null;
+
+        final BackStackRecord entry = new BackStackRecord(
+                (FragmentManagerImpl) mActivity.getFragmentManager());
+        entry.setBreadCrumbTitle(title);
+        entry.setBreadCrumbShortTitle(shortTitle);
+        return entry;
+    }
+
+    /**
      * Set a custom title for the bread crumbs.  This will be the first entry
      * shown at the left, representing the root of the bread crumbs.  If the
      * title is null, it will not be shown.
      */
     public void setTitle(CharSequence title, CharSequence shortTitle) {
-        if (title == null) {
-            mTopEntry = null;
-        } else {
-            mTopEntry = new BackStackRecord((FragmentManagerImpl)
-                    mActivity.getFragmentManager());
-            mTopEntry.setBreadCrumbTitle(title);
-            mTopEntry.setBreadCrumbShortTitle(shortTitle);
-        }
+        mTopEntry = createBackStackEntry(title, shortTitle);
         updateCrumbs();
     }
 
@@ -151,41 +179,66 @@
         updateCrumbs();
     }
 
+    /**
+     * Returns the number of entries before the backstack, including the title of the current
+     * fragment and any custom parent title that was set.
+     */
+    private int getPreEntryCount() {
+        return (mTopEntry != null ? 1 : 0) + (mParentEntry != null ? 1 : 0);
+    }
+
+    /**
+     * Returns the pre-entry corresponding to the index. If there is a parent and a top entry
+     * set, parent has an index of zero and top entry has an index of 1. Returns null if the
+     * specified index doesn't exist or is null.
+     * @param index should not be more than {@link #getPreEntryCount()} - 1
+     */
+    private BackStackEntry getPreEntry(int index) {
+        // If there's a parent entry, then return that for zero'th item, else top entry.
+        if (mParentEntry != null) {
+            return index == 0 ? mParentEntry : mTopEntry;
+        } else {
+            return mTopEntry;
+        }
+    }
+
     void updateCrumbs() {
         FragmentManager fm = mActivity.getFragmentManager();
         int numEntries = fm.countBackStackEntries();
+        int numPreEntries = getPreEntryCount();
         int numViews = mContainer.getChildCount();
-        for (int i = mTopEntry != null ? -1 : 0; i < numEntries; i++) {
-            BackStackEntry bse = i == -1 ? mTopEntry : fm.getBackStackEntry(i);
-            int viewI = mTopEntry != null ? i + 1 : i;
-            if (viewI < numViews) {
-                View v = mContainer.getChildAt(viewI);
+        for (int i = 0; i < numEntries + numPreEntries; i++) {
+            BackStackEntry bse = i < numPreEntries
+                    ? getPreEntry(i)
+                    : fm.getBackStackEntry(i - numPreEntries);
+            if (i < numViews) {
+                View v = mContainer.getChildAt(i);
                 Object tag = v.getTag();
                 if (tag != bse) {
-                    for (int j = viewI; j < numViews; j++) {
-                        mContainer.removeViewAt(viewI);
+                    for (int j = i; j < numViews; j++) {
+                        mContainer.removeViewAt(i);
                     }
-                    numViews = viewI;
+                    numViews = i;
                 }
             }
-            if (viewI >= numViews) {
+            if (i >= numViews) {
                 final View item = mInflater.inflate(
                         com.android.internal.R.layout.fragment_bread_crumb_item,
                         this, false);
                 final TextView text = (TextView) item.findViewById(com.android.internal.R.id.title);
                 text.setText(bse.getBreadCrumbTitle());
                 text.setTag(bse);
-                if (viewI == 0) {
+                if (i == 0) {
                     item.findViewById(com.android.internal.R.id.left_icon).setVisibility(View.GONE);
                 }
                 mContainer.addView(item);
                 text.setOnClickListener(mOnClickListener);
             }
         }
-        int viewI = mTopEntry != null ? numEntries + 1 : numEntries;
+        int viewI = numEntries + numPreEntries;
         numViews = mContainer.getChildCount();
         while (numViews > viewI) {
-            mContainer.removeViewAt(numViews-1);
+            mContainer.removeViewAt(numViews - 1);
             numViews--;
         }
         // Adjust the visibility and availability of the bread crumbs and divider
@@ -208,8 +261,14 @@
         public void onClick(View v) {
             if (v.getTag() instanceof BackStackEntry) {
                 BackStackEntry bse = (BackStackEntry) v.getTag();
-                mActivity.getFragmentManager().popBackStack(bse.getId(),
-                        bse == mTopEntry? FragmentManager.POP_BACK_STACK_INCLUSIVE : 0);
+                if (bse == mParentEntry) {
+                    if (mParentClickListener != null) {
+                        mParentClickListener.onClick(v);
+                    }
+                } else {
+                    mActivity.getFragmentManager().popBackStack(bse.getId(),
+                            bse == mTopEntry? FragmentManager.POP_BACK_STACK_INCLUSIVE : 0);
+                }
             }
         }
     };
diff --git a/core/java/android/net/InterfaceConfiguration.java b/core/java/android/net/InterfaceConfiguration.java
index 915c5d7..980048c 100644
--- a/core/java/android/net/InterfaceConfiguration.java
+++ b/core/java/android/net/InterfaceConfiguration.java
@@ -19,14 +19,17 @@
 import android.os.Parcelable;
 import android.os.Parcel;
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
 /**
  * A simple object for retrieving / setting an interfaces configuration
  * @hide
  */
 public class InterfaceConfiguration implements Parcelable {
     public String hwAddr;
-    public int ipAddr;
-    public int netmask;
+    public InetAddress addr;
+    public InetAddress mask;
     public String interfaceFlags;
 
     public InterfaceConfiguration() {
@@ -36,21 +39,14 @@
     public String toString() {
         StringBuffer str = new StringBuffer();
 
-        str.append("ipddress "); putAddress(str, ipAddr);
-        str.append(" netmask "); putAddress(str, netmask);
+        str.append("ipddress "); str.append(addr.toString());
+        str.append(" netmask "); str.append(mask.toString());
         str.append(" flags ").append(interfaceFlags);
         str.append(" hwaddr ").append(hwAddr);
 
         return str.toString();
     }
 
-    private static void putAddress(StringBuffer buf, int addr) {
-        buf.append((addr >> 24) & 0xff).append('.').
-            append((addr >> 16) & 0xff).append('.').
-            append((addr >> 8) & 0xff).append('.').
-            append(addr & 0xff);
-    }
-
     /** Implement the Parcelable interface {@hide} */
     public int describeContents() {
         return 0;
@@ -59,8 +55,18 @@
     /** Implement the Parcelable interface {@hide} */
     public void writeToParcel(Parcel dest, int flags) {
         dest.writeString(hwAddr);
-        dest.writeInt(ipAddr);
-        dest.writeInt(netmask);
+        if (addr != null) {
+            dest.writeByte((byte)1);
+            dest.writeByteArray(addr.getAddress());
+        } else {
+            dest.writeByte((byte)0);
+        }
+        if (mask != null) {
+            dest.writeByte((byte)1);
+            dest.writeByteArray(mask.getAddress());
+        } else {
+            dest.writeByte((byte)0);
+        }
         dest.writeString(interfaceFlags);
     }
 
@@ -70,8 +76,16 @@
             public InterfaceConfiguration createFromParcel(Parcel in) {
                 InterfaceConfiguration info = new InterfaceConfiguration();
                 info.hwAddr = in.readString();
-                info.ipAddr = in.readInt();
-                info.netmask = in.readInt();
+                if (in.readByte() == 1) {
+                    try {
+                        info.addr = InetAddress.getByAddress(in.createByteArray());
+                    } catch (UnknownHostException e) {}
+                }
+                if (in.readByte() == 1) {
+                    try {
+                        info.mask = InetAddress.getByAddress(in.createByteArray());
+                    } catch (UnknownHostException e) {}
+                }
                 info.interfaceFlags = in.readString();
                 return info;
             }
diff --git a/core/java/android/os/Vibrator.java b/core/java/android/os/Vibrator.java
index e9428f7..3769cfe 100644
--- a/core/java/android/os/Vibrator.java
+++ b/core/java/android/os/Vibrator.java
@@ -22,6 +22,7 @@
  * Class that operates the vibrator on the device.
  * <p>
  * If your process exits, any vibration you started with will stop.
+ * </p>
  */
 public class Vibrator
 {
@@ -56,7 +57,7 @@
     /**
      * Turn the vibrator on.
      *
-     * @param milliseconds How long to vibrate for.
+     * @param milliseconds The number of milliseconds to vibrate.
      */
     public void vibrate(long milliseconds)
     {
@@ -75,12 +76,17 @@
      * Vibrate with a given pattern.
      *
      * <p>
-     * Pass in an array of ints that are the times at which to turn on or off
-     * the vibrator.  The first one is how long to wait before turning it on,
-     * and then after that it alternates.  If you want to repeat, pass the
-     * index into the pattern at which to start the repeat.
+     * Pass in an array of ints that are the durations for which to turn on or off
+     * the vibrator in milliseconds.  The first value indicates the number of milliseconds
+     * to wait before turning the vibrator on.  The next value indicates the number of milliseconds
+     * for which to keep the vibrator on before turning it off.  Subsequent values alternate
+     * between durations in milliseconds to turn the vibrator off or to turn the vibrator on.
+     * </p><p>
+     * To cause the pattern to repeat, pass the index into the pattern array at which
+     * to start the repeat, or -1 to disable repeating.
+     * </p>
      *
-     * @param pattern an array of longs of times to turn the vibrator on or off.
+     * @param pattern an array of longs of times for which to turn the vibrator on or off.
      * @param repeat the index into pattern at which to repeat, or -1 if
      *        you don't want to repeat.
      */
diff --git a/core/java/android/preference/PreferenceActivity.java b/core/java/android/preference/PreferenceActivity.java
index d9039ab..7a186f3 100644
--- a/core/java/android/preference/PreferenceActivity.java
+++ b/core/java/android/preference/PreferenceActivity.java
@@ -1005,6 +1005,21 @@
             mFragmentBreadCrumbs.setActivity(this);
         }
         mFragmentBreadCrumbs.setTitle(title, shortTitle);
+        mFragmentBreadCrumbs.setParentTitle(null, null, null);
+    }
+
+    /**
+     * Should be called after onCreate to ensure that the breadcrumbs, if any, were created.
+     * This prepends a title to the fragment breadcrumbs and attaches a listener to any clicks
+     * on the parent entry.
+     * @param title the title for the breadcrumb
+     * @param shortTitle the short title for the breadcrumb
+     */
+    public void setParentTitle(CharSequence title, CharSequence shortTitle,
+            OnClickListener listener) {
+        if (mFragmentBreadCrumbs != null) {
+            mFragmentBreadCrumbs.setParentTitle(title, shortTitle, listener);
+        }
     }
 
     void setSelectedHeader(Header header) {
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java
index 1f19f9e..9e5abdc 100644
--- a/core/java/android/server/BluetoothService.java
+++ b/core/java/android/server/BluetoothService.java
@@ -75,6 +75,7 @@
 import java.io.InputStreamReader;
 import java.io.PrintWriter;
 import java.io.UnsupportedEncodingException;
+import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -1660,20 +1661,10 @@
         try {
             ifcg = service.getInterfaceConfig(iface);
             if (ifcg != null) {
-                String[] addr = BLUETOOTH_NETMASK.split("\\.");
-                ifcg.netmask = (Integer.parseInt(addr[0]) << 24) +
-                        (Integer.parseInt(addr[1]) << 16) +
-                        (Integer.parseInt(addr[2]) << 8) +
-                        (Integer.parseInt(addr[3]));
-                if (ifcg.ipAddr == 0) {
-                    addr = address.split("\\.");
-
-                    ifcg.ipAddr = (Integer.parseInt(addr[0]) << 24) +
-                            (Integer.parseInt(addr[1]) << 16) +
-                            (Integer.parseInt(addr[2]) << 8) +
-                            (Integer.parseInt(addr[3]));
-                    ifcg.interfaceFlags =
-                        ifcg.interfaceFlags.replace("down", "up");
+                ifcg.mask = InetAddress.getByName(BLUETOOTH_NETMASK);
+                if (ifcg.addr == null) {
+                    ifcg.addr = InetAddress.getByName(address);
+                    ifcg.interfaceFlags = ifcg.interfaceFlags.replace("down", "up");
                 }
                 ifcg.interfaceFlags = ifcg.interfaceFlags.replace("running", "");
                 ifcg.interfaceFlags = ifcg.interfaceFlags.replace("  "," ");
diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java
index 4223040..8fb6fa3 100644
--- a/core/java/android/widget/Switch.java
+++ b/core/java/android/widget/Switch.java
@@ -192,12 +192,6 @@
 
         setSwitchTypefaceByIndex(typefaceIndex, styleIndex);
 
-        int lineHeight = appearance.getDimensionPixelSize(
-                com.android.internal.R.styleable.TextAppearance_textLineHeight, 0);
-        if (lineHeight != 0) {
-            setLineHeight(lineHeight);
-        }
-
         appearance.recycle();
     }
 
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 7fc7e54..c7ee57b 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -766,13 +766,6 @@
                 mEditTextMultilineBackground = a.getDrawable(attr);
                 break;
 
-            case com.android.internal.R.styleable.TextView_textLineHeight:
-                int lineHeight = a.getDimensionPixelSize(attr, 0);
-                if (lineHeight != 0) {
-                    setLineHeight(lineHeight);
-                }
-                break;
-
             case com.android.internal.R.styleable.TextView_textIsSelectable:
                 mTextIsSelectable = a.getBoolean(attr, false);
                 break;
@@ -1133,15 +1126,9 @@
      * within the text can cause individual lines to be taller or shorter
      * than this height, and the layout may contain additional first-
      * or last-line padding.
-     *
-     * @attr ref android.R.styleable#TextView_textLineHeight
      */
     public int getLineHeight() {
-        if (mLineHeight != 0) {
-            return mLineHeight;
-        }
-        return FastMath.round(mTextPaint.getFontMetricsInt(null) * mSpacingMult
-                          + mSpacingAdd);
+        return FastMath.round(mTextPaint.getFontMetricsInt(null) * mSpacingMult + mSpacingAdd);
     }
 
     /**
@@ -1728,26 +1715,10 @@
 
         setTypefaceByIndex(typefaceIndex, styleIndex);
         
-        int lineHeight = appearance.getDimensionPixelSize(
-                com.android.internal.R.styleable.TextAppearance_textLineHeight, 0);
-        if (lineHeight != 0) {
-            setLineHeight(lineHeight);
-        }
-
         appearance.recycle();
     }
 
     /**
-     * Set the height of a line of text in pixels. This value will override line height
-     * values stored in the font modified by lineSpacingExtra and lineSpacingMultiplier.
-     *
-     * @param lineHeight Desired height of a single line of text in pixels
-     */
-    public void setLineHeight(int lineHeight) {
-        mLineHeight = lineHeight;
-    }
-
-    /**
      * @return the size (in pixels) of the default text size in this TextView.
      */
     public float getTextSize() {
@@ -9393,7 +9364,6 @@
 
     private float                   mSpacingMult = 1;
     private float                   mSpacingAdd = 0;
-    private int                     mLineHeight = 0;
     private boolean                 mTextIsSelectable = false;
 
     private static final int        LINES = 1;
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 181bbcc..f10e90f 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -722,9 +722,6 @@
     <!-- Color of link text (URLs). -->
     <attr name="textColorLink" format="reference|color" />
 
-    <!-- Height of a line of text. -->
-    <attr name="textLineHeight" format="dimension" />
-
     <!-- Indicates that the content of a non-editable TextView can be selected.
      Default value is false. EditText content is always selectable. -->
     <attr name="textIsSelectable" format="boolean" />
@@ -2429,8 +2426,6 @@
         <attr name="textColorHint" />
         <!-- Color of the links. -->
         <attr name="textColorLink" />
-        <!-- Height of a single line of text. -->
-        <attr name="textLineHeight" />
     </declare-styleable>
     <declare-styleable name="TextSwitcher">
     </declare-styleable>
@@ -2672,10 +2667,7 @@
         <attr name="textEditPasteWindowLayout" />
         <!-- Variation of textEditPasteWindowLayout displayed when the clipboard is empty. -->
         <attr name="textEditNoPasteWindowLayout" />
-
-        <!-- Height of a line of text. -->
-        <attr name="textLineHeight" />
-        <!-- Indicates that a non-editable text can be selected. -->
+        <!-- Indicates that the content of a non-editable text can be selected. -->
         <attr name="textIsSelectable" />
         <!--  A specific background drawable used by multi-line EditText only. -->
         <attr name="multilineBackground" format="reference"/>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index dcc88f0..3a5b238 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1358,7 +1358,6 @@
   <public type="attr" name="loopViews" />
   <public type="attr" name="dialogTheme" />
   <public type="attr" name="alertDialogTheme" />
-  <public type="attr" name="textLineHeight" />
   <public type="attr" name="dividerVertical" />
   <public type="attr" name="homeAsUpIndicator" />
   <public type="attr" name="enterFadeDuration" />
diff --git a/include/surfaceflinger/Surface.h b/include/surfaceflinger/Surface.h
index cef439c..2df8ca3 100644
--- a/include/surfaceflinger/Surface.h
+++ b/include/surfaceflinger/Surface.h
@@ -249,7 +249,7 @@
             uint32_t *pWidth, uint32_t *pHeight,
             uint32_t *pFormat, uint32_t *pUsage) const;
 
-    static void cleanCachedSurfaces();
+    static void cleanCachedSurfacesLocked();
 
     class BufferInfo {
         uint32_t mWidth;
diff --git a/include/utils/CallStack.h b/include/utils/CallStack.h
index c2c8ce5..8817120 100644
--- a/include/utils/CallStack.h
+++ b/include/utils/CallStack.h
@@ -50,7 +50,7 @@
     
     void clear();
 
-    void update(int32_t ignoreDepth=0, int32_t maxDepth=MAX_DEPTH);
+    void update(int32_t ignoreDepth=1, int32_t maxDepth=MAX_DEPTH);
 
     // Dump a stack trace to the log
     void dump(const char* prefix = 0) const;
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 72c8950..e99f73a 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -856,6 +856,16 @@
     mSetShaderColor = mDescription.setColor(mColorR, mColorG, mColorB, mColorA);
 }
 
+void OpenGLRenderer::setupDrawAlpha8Color(int color, int alpha) {
+    mColorA = alpha / 255.0f;
+    const float a = mColorA / 255.0f;
+    mColorR = a * ((color >> 16) & 0xFF);
+    mColorG = a * ((color >>  8) & 0xFF);
+    mColorB = a * ((color      ) & 0xFF);
+    mColorSet = true;
+    mSetShaderColor = mDescription.setAlpha8Color(mColorR, mColorG, mColorB, mColorA);
+}
+
 void OpenGLRenderer::setupDrawColor(float r, float g, float b, float a) {
     mColorA = a;
     mColorR = r;
@@ -865,6 +875,15 @@
     mSetShaderColor = mDescription.setColor(r, g, b, a);
 }
 
+void OpenGLRenderer::setupDrawAlpha8Color(float r, float g, float b, float a) {
+    mColorA = a;
+    mColorR = r;
+    mColorG = g;
+    mColorB = b;
+    mColorSet = true;
+    mSetShaderColor = mDescription.setAlpha8Color(r, g, b, a);
+}
+
 void OpenGLRenderer::setupDrawShader() {
     if (mShader) {
         mShader->describe(mDescription, mCaches.extensions);
@@ -912,16 +931,19 @@
     if (!ignoreModelView) {
         mModelView.loadTranslate(left, top, 0.0f);
         mModelView.scale(right - left, bottom - top, 1.0f);
-        if (!ignoreTransform) {
-            mCaches.currentProgram->set(mOrthoMatrix, mModelView, *mSnapshot->transform);
-            if (mTrackDirtyRegions) dirtyLayer(left, top, right, bottom, *mSnapshot->transform);
-        } else {
-            mCaches.currentProgram->set(mOrthoMatrix, mModelView, mIdentity);
-            if (mTrackDirtyRegions) dirtyLayer(left, top, right, bottom);
-        }
     } else {
         mModelView.loadIdentity();
     }
+    bool dirty = right - left > 0.0f && bottom - top > 0.0f;
+    if (!ignoreTransform) {
+        mCaches.currentProgram->set(mOrthoMatrix, mModelView, *mSnapshot->transform);
+        if (mTrackDirtyRegions && dirty) {
+            dirtyLayer(left, top, right, bottom, *mSnapshot->transform);
+        }
+    } else {
+        mCaches.currentProgram->set(mOrthoMatrix, mModelView, mIdentity);
+        if (mTrackDirtyRegions && dirty) dirtyLayer(left, top, right, bottom);
+    }
 }
 
 void OpenGLRenderer::setupDrawColorUniforms() {
@@ -930,9 +952,9 @@
     }
 }
 
-void OpenGLRenderer::setupDrawColorAlphaUniforms() {
+void OpenGLRenderer::setupDrawPureColorUniforms() {
     if (mSetShaderColor) {
-        mCaches.currentProgram->setColor(mColorA, mColorA, mColorA, mColorA);
+        mCaches.currentProgram->setColor(mColorR, mColorG, mColorB, mColorA);
     }
 }
 
@@ -1000,7 +1022,7 @@
         return;
     }
 
-    glActiveTexture(GL_TEXTURE0);
+    glActiveTexture(gTextureUnits[0]);
     Texture* texture = mCaches.textureCache.get(bitmap);
     if (!texture) return;
     const AutoTexture autoCleanup(texture);
@@ -1017,7 +1039,7 @@
         return;
     }
 
-    glActiveTexture(GL_TEXTURE0);
+    glActiveTexture(gTextureUnits[0]);
     Texture* texture = mCaches.textureCache.get(bitmap);
     if (!texture) return;
     const AutoTexture autoCleanup(texture);
@@ -1325,48 +1347,60 @@
         y = (int) floorf(y + mSnapshot->transform->getTranslateY() + 0.5f);
     }
 
-    int alpha;
-    SkXfermode::Mode mode;
-    getAlphaAndMode(paint, &alpha, &mode);
-
-    uint32_t color = paint->getColor();
-    const GLfloat a = alpha / 255.0f;
-    const GLfloat r = a * ((color >> 16) & 0xFF) / 255.0f;
-    const GLfloat g = a * ((color >>  8) & 0xFF) / 255.0f;
-    const GLfloat b = a * ((color      ) & 0xFF) / 255.0f;
-
     FontRenderer& fontRenderer = mCaches.fontRenderer.getFontRenderer(paint);
     fontRenderer.setFont(paint, SkTypeface::UniqueID(paint->getTypeface()),
             paint->getTextSize());
 
-    setupDraw();
+    int alpha;
+    SkXfermode::Mode mode;
+    getAlphaAndMode(paint, &alpha, &mode);
 
     if (mHasShadow) {
-        glActiveTexture(gTextureUnits[0]);
         mCaches.dropShadowCache.setFontRenderer(fontRenderer);
         const ShadowTexture* shadow = mCaches.dropShadowCache.get(paint, text, bytesCount,
                 count, mShadowRadius);
         const AutoTexture autoCleanup(shadow);
 
-        setupShadow(shadow, x, y, mode, a, pureTranslate);
+        const float sx = x - shadow->left + mShadowDx;
+        const float sy = y - shadow->top + mShadowDy;
 
-        // Draw the mesh
+        const int shadowAlpha = ((mShadowColor >> 24) & 0xFF);
+
+        glActiveTexture(gTextureUnits[0]);
+        setupDraw();
+        setupDrawWithTexture(true);
+        setupDrawAlpha8Color(mShadowColor, shadowAlpha < 255 ? shadowAlpha : alpha);
+        setupDrawBlending(true, mode);
+        setupDrawProgram();
+        setupDrawModelView(sx, sy, sx + shadow->width, sy + shadow->height, pureTranslate);
+        setupDrawTexture(shadow->id);
+        setupDrawPureColorUniforms();
+        setupDrawMesh(NULL, (GLvoid*) gMeshTextureOffset);
+
         glDrawArrays(GL_TRIANGLE_STRIP, 0, gMeshCount);
-        glDisableVertexAttribArray(mCaches.currentProgram->getAttrib("texCoords"));
+        finishDrawTexture();
     }
 
-    GLuint textureUnit = 0;
-    glActiveTexture(gTextureUnits[textureUnit]);
-
     // Pick the appropriate texture filtering
     bool linearFilter = mSnapshot->transform->changesBounds();
     if (pureTranslate && !linearFilter) {
         linearFilter = fabs(y - (int) y) > 0.0f || fabs(x - (int) x) > 0.0f;
     }
 
-    // Dimensions are set to (0,0), the layer (if any) won't be dirtied
-    setupTextureAlpha8(fontRenderer.getTexture(linearFilter), 0, 0, textureUnit,
-            x, y, r, g, b, a, mode, false, true, NULL, NULL, 0, pureTranslate);
+    glActiveTexture(gTextureUnits[0]);
+    setupDraw();
+    setupDrawDirtyRegionsDisabled();
+    setupDrawWithTexture(true);
+    setupDrawAlpha8Color(paint->getColor(), alpha);
+    setupDrawColorFilter();
+    setupDrawShader();
+    setupDrawBlending(true, mode);
+    setupDrawProgram();
+    setupDrawModelView(x, y, x, y, pureTranslate, true);
+    setupDrawTexture(fontRenderer.getTexture(linearFilter));
+    setupDrawPureColorUniforms();
+    setupDrawColorFilterUniforms();
+    setupDrawShaderUniforms(pureTranslate);
 
     const Rect* clip = pureTranslate ? mSnapshot->clipRect : &mSnapshot->getLocalClip();
     Rect bounds(FLT_MAX / 2.0f, FLT_MAX / 2.0f, FLT_MIN / 2.0f, FLT_MIN / 2.0f);
@@ -1421,19 +1455,23 @@
     SkXfermode::Mode mode;
     getAlphaAndMode(paint, &alpha, &mode);
 
-    uint32_t color = paint->getColor();
-    const GLfloat a = alpha / 255.0f;
-    const GLfloat r = a * ((color >> 16) & 0xFF) / 255.0f;
-    const GLfloat g = a * ((color >>  8) & 0xFF) / 255.0f;
-    const GLfloat b = a * ((color      ) & 0xFF) / 255.0f;
-
-    setupTextureAlpha8(texture, textureUnit, x, y, r, g, b, a, mode, true, true);
-
     setupDraw();
+    setupDrawWithTexture(true);
+    setupDrawAlpha8Color(paint->getColor(), alpha);
+    setupDrawColorFilter();
+    setupDrawShader();
+    setupDrawBlending(true, mode);
+    setupDrawProgram();
+    setupDrawModelView(x, y, x + texture->width, y + texture->height);
+    setupDrawTexture(texture->id);
+    setupDrawPureColorUniforms();
+    setupDrawColorFilterUniforms();
+    setupDrawShaderUniforms();
+    setupDrawMesh(NULL, (GLvoid*) gMeshTextureOffset);
 
-    // Draw the mesh
     glDrawArrays(GL_TRIANGLE_STRIP, 0, gMeshCount);
-    glDisableVertexAttribArray(mCaches.currentProgram->getAttrib("texCoords"));
+
+    finishDrawTexture();
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1483,118 +1521,6 @@
 // Drawing implementation
 ///////////////////////////////////////////////////////////////////////////////
 
-void OpenGLRenderer::setupShadow(const ShadowTexture* texture, float x, float y,
-        SkXfermode::Mode mode, float alpha, bool ignoreTransforms) {
-    const float sx = x - texture->left + mShadowDx;
-    const float sy = y - texture->top + mShadowDy;
-
-    const int shadowAlpha = ((mShadowColor >> 24) & 0xFF);
-    const GLfloat a = shadowAlpha < 255 ? shadowAlpha / 255.0f : alpha;
-    const GLfloat r = a * ((mShadowColor >> 16) & 0xFF) / 255.0f;
-    const GLfloat g = a * ((mShadowColor >>  8) & 0xFF) / 255.0f;
-    const GLfloat b = a * ((mShadowColor      ) & 0xFF) / 255.0f;
-
-    GLuint textureUnit = 0;
-    setupTextureAlpha8(texture->id, texture->width, texture->height, textureUnit,
-            sx, sy, r, g, b, a, mode, true, false,
-            (GLvoid*) 0, (GLvoid*) gMeshTextureOffset, 0, ignoreTransforms);
-}
-
-void OpenGLRenderer::setupTextureAlpha8(const Texture* texture, GLuint& textureUnit,
-        float x, float y, float r, float g, float b, float a, SkXfermode::Mode mode,
-        bool transforms, bool applyFilters) {
-    setupTextureAlpha8(texture->id, texture->width, texture->height, textureUnit,
-            x, y, r, g, b, a, mode, transforms, applyFilters,
-            (GLvoid*) 0, (GLvoid*) gMeshTextureOffset);
-}
-
-void OpenGLRenderer::setupTextureAlpha8(GLuint texture, uint32_t width, uint32_t height,
-        GLuint& textureUnit, float x, float y, float r, float g, float b, float a,
-        SkXfermode::Mode mode, bool transforms, bool applyFilters) {
-    setupTextureAlpha8(texture, width, height, textureUnit, x, y, r, g, b, a, mode,
-            transforms, applyFilters, (GLvoid*) 0, (GLvoid*) gMeshTextureOffset);
-}
-
-void OpenGLRenderer::setupTextureAlpha8(GLuint texture, uint32_t width, uint32_t height,
-        GLuint& textureUnit, float x, float y, float r, float g, float b, float a,
-        SkXfermode::Mode mode, bool transforms, bool applyFilters,
-        GLvoid* vertices, GLvoid* texCoords, GLuint vbo, bool ignoreTransform) {
-     // Describe the required shaders
-     ProgramDescription description;
-     description.hasTexture = true;
-     description.hasAlpha8Texture = true;
-     const bool setColor = description.setAlpha8Color(r, g, b, a);
-
-     if (applyFilters) {
-         if (mShader) {
-             mShader->describe(description, mCaches.extensions);
-         }
-         if (mColorFilter) {
-             mColorFilter->describe(description, mCaches.extensions);
-         }
-     }
-
-     // Setup the blending mode
-     chooseBlending(true, mode, description);
-
-     // Build and use the appropriate shader
-     useProgram(mCaches.programCache.get(description));
-
-     bindTexture(texture);
-     glUniform1i(mCaches.currentProgram->getUniform("sampler"), textureUnit);
-
-     int texCoordsSlot = mCaches.currentProgram->getAttrib("texCoords");
-     glEnableVertexAttribArray(texCoordsSlot);
-
-     if (texCoords) {
-         // Setup attributes
-         if (!vertices) {
-             mCaches.bindMeshBuffer(vbo == 0 ? mCaches.meshBuffer : vbo);
-         } else {
-             mCaches.unbindMeshBuffer();
-         }
-         glVertexAttribPointer(mCaches.currentProgram->position, 2, GL_FLOAT, GL_FALSE,
-                 gMeshStride, vertices);
-         glVertexAttribPointer(texCoordsSlot, 2, GL_FLOAT, GL_FALSE, gMeshStride, texCoords);
-     }
-
-     // Setup uniforms
-     if (transforms) {
-         mModelView.loadTranslate(x, y, 0.0f);
-         mModelView.scale(width, height, 1.0f);
-     } else {
-         mModelView.loadIdentity();
-     }
-
-     mat4 t;
-     if (!ignoreTransform) {
-         t.load(*mSnapshot->transform);
-     }
-
-     mCaches.currentProgram->set(mOrthoMatrix, mModelView, t);
-     if (width > 0 && height > 0) {
-         dirtyLayer(x, y, x + width, y + height, t);
-     }
-
-     if (setColor) {
-         mCaches.currentProgram->setColor(r, g, b, a);
-     }
-
-     textureUnit++;
-     if (applyFilters) {
-         // Setup attributes and uniforms required by the shaders
-         if (mShader) {
-             if (ignoreTransform) {
-                 mModelView.loadInverse(*mSnapshot->transform);
-             }
-             mShader->setupProgram(mCaches.currentProgram, mModelView, *mSnapshot, &textureUnit);
-         }
-         if (mColorFilter) {
-             mColorFilter->setupProgram(mCaches.currentProgram);
-         }
-     }
-}
-
 // Same values used by Skia
 #define kStdStrikeThru_Offset   (-6.0f / 21.0f)
 #define kStdUnderline_Offset    (1.0f / 9.0f)
@@ -1727,7 +1653,7 @@
     } else {
         setupDrawModelViewTranslate(left, top, right, bottom, ignoreTransform);
     }
-    setupDrawColorAlphaUniforms();
+    setupDrawPureColorUniforms();
     setupDrawColorFilterUniforms();
     setupDrawTexture(texture);
     setupDrawMesh(vertices, texCoords, vbo);
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index 5d8653d..c3c6ad6 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -279,73 +279,6 @@
             bool ignoreScale = false, bool dirty = true);
 
     /**
-     * Prepares the renderer to draw the specified shadow. The active texture
-     * unit must be 0 and the other units must be unbound.
-     *
-     * @param texture The shadow texture
-     * @param x The x coordinate of the shadow
-     * @param y The y coordinate of the shadow
-     * @param mode The blending mode
-     * @param alpha The alpha value
-     * @param ignoreTransforms True if the coordinates are already in screen space
-     */
-    void setupShadow(const ShadowTexture* texture, float x, float y, SkXfermode::Mode mode,
-            float alpha, bool ignoreTransforms = false);
-
-    /**
-     * Prepares the renderer to draw the specified Alpha8 texture as a rectangle.
-     *
-     * @param texture The texture to render with
-     * @param textureUnit The texture unit to use, may be modified
-     * @param x The x coordinate of the rectangle to draw
-     * @param y The y coordinate of the rectangle to draw
-     * @param r The red component of the color
-     * @param g The green component of the color
-     * @param b The blue component of the color
-     * @param a The alpha component of the color
-     * @param mode The blending mode
-     * @param transforms True if the matrix passed to the shader should be multiplied
-     *        by the model-view matrix
-     * @param applyFilters Whether or not to take color filters and
-     *        shaders into account
-     */
-    void setupTextureAlpha8(const Texture* texture, GLuint& textureUnit, float x, float y,
-            float r, float g, float b, float a, SkXfermode::Mode mode, bool transforms,
-            bool applyFilters);
-
-    /**
-     * Prepares the renderer to draw the specified Alpha8 texture as a rectangle.
-     *
-     * @param texture The texture to render with
-     * @param width The width of the texture
-     * @param height The height of the texture
-     * @param textureUnit The texture unit to use, may be modified
-     * @param x The x coordinate of the rectangle to draw
-     * @param y The y coordinate of the rectangle to draw
-     * @param r The red component of the color
-     * @param g The green component of the color
-     * @param b The blue component of the color
-     * @param a The alpha component of the color
-     * @param mode The blending mode
-     * @param transforms True if the matrix passed to the shader should be multiplied
-     *        by the model-view matrix
-     * @param applyFilters Whether or not to take color filters and
-     *        shaders into account
-     */
-    void setupTextureAlpha8(GLuint texture, uint32_t width, uint32_t height,
-            GLuint& textureUnit, float x, float y, float r, float g, float b, float a,
-            SkXfermode::Mode mode, bool transforms, bool applyFilters);
-
-    /**
-     * Same as above setupTextureAlpha8() but specifies the mesh's vertices
-     * and texCoords pointers. The pointers become offsets when a VBO is bound.
-     */
-    void setupTextureAlpha8(GLuint texture, uint32_t width, uint32_t height,
-            GLuint& textureUnit, float x, float y, float r, float g, float b, float a,
-            SkXfermode::Mode mode, bool transforms, bool applyFilters,
-            GLvoid* vertices, GLvoid* texCoords, GLuint vbo = 0, bool ignoreTransform = false);
-
-    /**
      * Draws text underline and strike-through if needed.
      *
      * @param text The text to decor
@@ -430,6 +363,8 @@
     void setupDrawWithTexture(bool isAlpha8 = false);
     void setupDrawColor(int color);
     void setupDrawColor(float r, float g, float b, float a);
+    void setupDrawAlpha8Color(int color, int alpha);
+    void setupDrawAlpha8Color(float r, float g, float b, float a);
     void setupDrawShader();
     void setupDrawColorFilter();
     void setupDrawBlending(SkXfermode::Mode mode = SkXfermode::kSrcOver_Mode,
@@ -443,7 +378,7 @@
     void setupDrawModelViewTranslate(float left, float top, float right, float bottom,
             bool ignoreTransform = false);
     void setupDrawColorUniforms();
-    void setupDrawColorAlphaUniforms();
+    void setupDrawPureColorUniforms();
     void setupDrawShaderUniforms(bool ignoreTransform = false);
     void setupDrawColorFilterUniforms();
     void setupDrawSimpleMesh();
diff --git a/libs/surfaceflinger_client/Surface.cpp b/libs/surfaceflinger_client/Surface.cpp
index 9467a4c..aa0c2e8 100644
--- a/libs/surfaceflinger_client/Surface.cpp
+++ b/libs/surfaceflinger_client/Surface.cpp
@@ -384,7 +384,7 @@
 
 
 Mutex Surface::sCachedSurfacesLock;
-DefaultKeyedVector<wp<IBinder>, wp<Surface> > Surface::sCachedSurfaces(wp<Surface>(0));
+DefaultKeyedVector<wp<IBinder>, wp<Surface> > Surface::sCachedSurfaces;
 
 sp<Surface> Surface::readFromParcel(const Parcel& data) {
     Mutex::Autolock _l(sCachedSurfacesLock);
@@ -397,13 +397,13 @@
     if (surface->mSurface == 0) {
       surface = 0;
     }
-    cleanCachedSurfaces();
+    cleanCachedSurfacesLocked();
     return surface;
 }
 
 // Remove the stale entries from the surface cache.  This should only be called
 // with sCachedSurfacesLock held.
-void Surface::cleanCachedSurfaces() {
+void Surface::cleanCachedSurfacesLocked() {
     for (int i = sCachedSurfaces.size()-1; i >= 0; --i) {
         wp<Surface> s(sCachedSurfaces.valueAt(i));
         if (s == 0 || s.promote() == 0) {
@@ -489,6 +489,9 @@
         LOGE("[Surface] using an invalid surface, "
                 "identity=%u should be %d",
                 mIdentity, identity);
+        CallStack stack;
+        stack.update();
+        stack.dump("Surface");
         return NO_INIT;
     }
 
@@ -497,6 +500,9 @@
     if (err != NO_ERROR) {
         LOGE("surface (identity=%u) is invalid, err=%d (%s)",
                 mIdentity, err, strerror(-err));
+        CallStack stack;
+        stack.update();
+        stack.dump("Surface");
         return err;
     }
 
diff --git a/opengl/tests/hwc/hwc_stress.cpp b/opengl/tests/hwc/hwc_stress.cpp
index d41b074..580eb83 100644
--- a/opengl/tests/hwc/hwc_stress.cpp
+++ b/opengl/tests/hwc/hwc_stress.cpp
@@ -1061,16 +1061,16 @@
         size_t h = (height * maxSizeRatio) * testRandFract();
         w = max(1u, w);
         h = max(1u, h);
-        if (verbose) {
-            testPrintI("  frame %u width: %u height: %u format: %u %s",
-                       row, w, h, format, graphicFormat2str(format));
-        }
         if ((w % formatPtr->wMod) != 0) {
             w += formatPtr->wMod - (w % formatPtr->wMod);
         }
         if ((h % formatPtr->hMod) != 0) {
             h += formatPtr->hMod - (h % formatPtr->hMod);
         }
+        if (verbose) {
+            testPrintI("  frame %u width: %u height: %u format: %u %s",
+                       row, w, h, format, graphicFormat2str(format));
+        }
 
         size_t cols = testRandMod((maxCols + 1) - minCols) + minCols;
         frames[row].resize(cols);
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java
index 8dbd3e7..4290ce7 100644
--- a/services/java/com/android/server/NetworkManagementService.java
+++ b/services/java/com/android/server/NetworkManagementService.java
@@ -219,28 +219,6 @@
         }
     }
 
-    private static int stringToIpAddr(String addrString) throws UnknownHostException {
-        try {
-            String[] parts = addrString.split("\\.");
-            if (parts.length != 4) {
-                throw new UnknownHostException(addrString);
-            }
-
-            int a = Integer.parseInt(parts[0]) << 24;
-            int b = Integer.parseInt(parts[1]) << 16;
-            int c = Integer.parseInt(parts[2]) <<  8;
-            int d = Integer.parseInt(parts[3])      ;
-
-            return a | b | c | d;
-        } catch (NumberFormatException ex) {
-            throw new UnknownHostException(addrString);
-        }
-    }
-
-    public static String intToIpString(int i) {
-        return ((i >> 24 ) & 0xFF) + "." + ((i >> 16 ) & 0xFF) + "." + ((i >>  8 ) & 0xFF) + "." +
-               (i & 0xFF);
-    }
 
     //
     // INetworkManagementService members
@@ -288,18 +266,17 @@
             cfg = new InterfaceConfiguration();
             cfg.hwAddr = st.nextToken(" ");
             try {
-                cfg.ipAddr = stringToIpAddr(st.nextToken(" "));
+                cfg.addr = InetAddress.getByName(st.nextToken(" "));
             } catch (UnknownHostException uhe) {
                 Slog.e(TAG, "Failed to parse ipaddr", uhe);
-                cfg.ipAddr = 0;
             }
 
             try {
-                cfg.netmask = stringToIpAddr(st.nextToken(" "));
+                cfg.mask = InetAddress.getByName(st.nextToken(" "));
             } catch (UnknownHostException uhe) {
                 Slog.e(TAG, "Failed to parse netmask", uhe);
-                cfg.netmask = 0;
             }
+
             cfg.interfaceFlags = st.nextToken("]").trim() +"]";
         } catch (NoSuchElementException nsee) {
             throw new IllegalStateException(
@@ -312,7 +289,8 @@
     public void setInterfaceConfig(
             String iface, InterfaceConfiguration cfg) throws IllegalStateException {
         String cmd = String.format("interface setcfg %s %s %s %s", iface,
-                intToIpString(cfg.ipAddr), intToIpString(cfg.netmask), cfg.interfaceFlags);
+                cfg.addr.getHostAddress(), cfg.mask.getHostAddress(),
+                cfg.interfaceFlags);
         try {
             mConnector.doCommand(cmd);
         } catch (NativeDaemonConnectorException e) {
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java
index 07813b0..ff703fd 100644
--- a/services/java/com/android/server/WifiService.java
+++ b/services/java/com/android/server/WifiService.java
@@ -58,6 +58,7 @@
 import android.text.TextUtils;
 import android.util.Slog;
 
+import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
@@ -347,8 +348,8 @@
                         ifcg = service.getInterfaceConfig(intf);
                         if (ifcg != null) {
                             /* IP/netmask: 192.168.43.1/255.255.255.0 */
-                            ifcg.ipAddr = (192 << 24) + (168 << 16) + (43 << 8) + 1;
-                            ifcg.netmask = (255 << 24) + (255 << 16) + (255 << 8) + 0;
+                            ifcg.addr = InetAddress.getByName("192.168.43.1");
+                            ifcg.mask = InetAddress.getByName("255.255.255.0");
                             ifcg.interfaceFlags = "[up]";
 
                             service.setInterfaceConfig(intf, ifcg);
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java
index 75a0e82..d742d4c 100644
--- a/services/java/com/android/server/connectivity/Tethering.java
+++ b/services/java/com/android/server/connectivity/Tethering.java
@@ -51,6 +51,7 @@
 
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
+import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedList;
@@ -585,16 +586,8 @@
                 try {
                     ifcg = service.getInterfaceConfig(iface);
                     if (ifcg != null) {
-                        String[] addr = USB_NEAR_IFACE_ADDR.split("\\.");
-                        ifcg.ipAddr = (Integer.parseInt(addr[0]) << 24) +
-                                (Integer.parseInt(addr[1]) << 16) +
-                                (Integer.parseInt(addr[2]) << 8) +
-                                (Integer.parseInt(addr[3]));
-                        addr = USB_NETMASK.split("\\.");
-                        ifcg.netmask = (Integer.parseInt(addr[0]) << 24) +
-                                (Integer.parseInt(addr[1]) << 16) +
-                                (Integer.parseInt(addr[2]) << 8) +
-                                (Integer.parseInt(addr[3]));
+                        ifcg.addr = InetAddress.getByName(USB_NEAR_IFACE_ADDR);
+                        ifcg.mask = InetAddress.getByName(USB_NETMASK);
                         if (enabled) {
                             ifcg.interfaceFlags = ifcg.interfaceFlags.replace("down", "up");
                         } else {
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index 74d1ac9..8a00a2e 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -35,7 +35,6 @@
 
 LOCAL_SHARED_LIBRARIES := \
 	libcutils \
-	libpixelflinger \
 	libhardware \
 	libutils \
 	libEGL \
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 80aef5f..5a0f115 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -83,8 +83,28 @@
             sharedClient, token, mBufferManager.getDefaultBufferCount(),
             getIdentity());
 
-    status_t err = mUserClientRef.setToken(userClient, lcblk, token);
 
+    sp<UserClient> ourClient(mUserClientRef.getClient());
+
+    /*
+     *  Here it is guaranteed that userClient != ourClient
+     *  (see UserClient::getTokenForSurface()).
+     *
+     *  We release the token used by this surface in ourClient below.
+     *  This should be safe to do so now, since this layer won't be attached
+     *  to this client, it should be okay to reuse that id.
+     *
+     *  If this causes problems, an other solution would be to keep a list
+     *  of all the {UserClient, token} ever used and release them when the
+     *  Layer is destroyed.
+     *
+     */
+
+    if (ourClient != 0) {
+        ourClient->detachLayer(this);
+    }
+
+    status_t err = mUserClientRef.setToken(userClient, lcblk, token);
     LOGE_IF(err != NO_ERROR,
             "ClientRef::setToken(%p, %p, %u) failed",
             userClient.get(), lcblk.get(), token);
@@ -226,9 +246,10 @@
 void Layer::setPerFrameData(hwc_layer_t* hwcl) {
     sp<GraphicBuffer> buffer(mBufferManager.getActiveBuffer());
     if (buffer == NULL) {
-        // this situation can happen if we ran out of memory for instance.
-        // not much we can do. continue to use whatever texture was bound
-        // to this context.
+        // this can happen if the client never drew into this layer yet,
+        // or if we ran out of memory. In that case, don't let
+        // HWC handle it.
+        hwcl->flags |= HWC_SKIP_LAYER;
         hwcl->handle = NULL;
         return;
     }
@@ -561,12 +582,20 @@
     }
 
     // we retired a buffer, which becomes the new front buffer
+
+    const bool noActiveBuffer = !mBufferManager.hasActiveBuffer();
     if (mBufferManager.setActiveBufferIndex(buf) < NO_ERROR) {
         LOGE("retireAndLock() buffer index (%d) out of range", int(buf));
         mPostedDirtyRegion.clear();
         return;
     }
 
+    if (noActiveBuffer) {
+        // we didn't have an active buffer, we need to recompute
+        // our visible region
+        recomputeVisibleRegions = true;
+    }
+
     sp<GraphicBuffer> newFrontBuffer(getBuffer(buf));
     if (newFrontBuffer != NULL) {
         // get the dirty region
@@ -868,6 +897,10 @@
     return result;
 }
 
+bool Layer::BufferManager::hasActiveBuffer() const {
+    return mActiveBuffer >= 0;
+}
+
 sp<GraphicBuffer> Layer::BufferManager::detachBuffer(size_t index)
 {
     BufferData* const buffers = mBufferData;
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 30021d3..c367a8d 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -188,6 +188,8 @@
         size_t getActiveBufferIndex() const;
         // return the active buffer
         sp<GraphicBuffer> getActiveBuffer() const;
+        // return wether we have an active buffer
+        bool hasActiveBuffer() const;
         // return the active texture (or fail-over)
         Texture getActiveTexture() const;
         // frees resources associated with all buffers
diff --git a/tests/CoreTests/android/core/ArrayListTest.java b/tests/CoreTests/android/core/ArrayListTest.java
deleted file mode 100644
index 763bf99..0000000
--- a/tests/CoreTests/android/core/ArrayListTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.util.ArrayList;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * This test case tests several often used functionality of ArrayLists.
- */
-public class ArrayListTest extends TestCase {
-
-    @SuppressWarnings("unchecked")
-    @SmallTest
-    public void testArrayList() throws Exception {
-        ArrayList array = new ArrayList();
-        assertEquals(0, array.size());
-        assertTrue(array.isEmpty());
-
-        array.add(new Integer(0));
-        array.add(0, new Integer(1));
-        array.add(1, new Integer(2));
-        array.add(new Integer(3));
-        array.add(new Integer(1));
-
-        assertEquals(5, array.size());
-        assertFalse(array.isEmpty());
-
-        assertEquals(1, ((Integer) array.get(0)).intValue());
-        assertEquals(2, ((Integer) array.get(1)).intValue());
-        assertEquals(0, ((Integer) array.get(2)).intValue());
-        assertEquals(3, ((Integer) array.get(3)).intValue());
-        assertEquals(1, ((Integer) array.get(4)).intValue());
-
-        assertFalse(array.contains(null));
-        assertTrue(array.contains(new Integer(2)));
-        assertEquals(0, array.indexOf(new Integer(1)));
-        assertEquals(4, array.lastIndexOf(new Integer(1)));
-        assertTrue(array.indexOf(new Integer(5)) < 0);
-        assertTrue(array.lastIndexOf(new Integer(5)) < 0);
-
-
-        array.remove(1);
-        array.remove(1);
-
-        assertEquals(3, array.size());
-        assertFalse(array.isEmpty());
-        assertEquals(1, ((Integer) array.get(0)).intValue());
-        assertEquals(3, ((Integer) array.get(1)).intValue());
-        assertEquals(1, ((Integer) array.get(2)).intValue());
-
-        assertFalse(array.contains(null));
-        assertFalse(array.contains(new Integer(2)));
-        assertEquals(0, array.indexOf(new Integer(1)));
-        assertEquals(2, array.lastIndexOf(new Integer(1)));
-        assertTrue(array.indexOf(new Integer(5)) < 0);
-        assertTrue(array.lastIndexOf(new Integer(5)) < 0);
-
-        array.clear();
-
-        assertEquals(0, array.size());
-        assertTrue(array.isEmpty());
-        assertTrue(array.indexOf(new Integer(5)) < 0);
-        assertTrue(array.lastIndexOf(new Integer(5)) < 0);
-
-        ArrayList al = new ArrayList();
-
-        assertFalse(al.remove(null));
-        assertFalse(al.remove("string"));
-
-        al.add("string");
-        al.add(null);
-
-        assertTrue(al.remove(null));
-        assertTrue(al.remove("string"));
-    }
-}
-
diff --git a/tests/CoreTests/android/core/BooleanTest.java b/tests/CoreTests/android/core/BooleanTest.java
deleted file mode 100644
index 211947e..0000000
--- a/tests/CoreTests/android/core/BooleanTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Tests some basic functionality of Booleans.
- */
-public class BooleanTest extends TestCase {
-
-    @SmallTest
-    public void testBoolean() throws Exception {
-        Boolean a = new Boolean(true);
-        Boolean b = new Boolean("True");
-        Boolean c = new Boolean(false);
-        Boolean d = new Boolean("Yes");
-
-        assertEquals(a, b);
-        assertEquals(c, d);
-        assertTrue(a.booleanValue());
-        assertFalse(c.booleanValue());
-        assertEquals("true", a.toString());
-        assertEquals("false", c.toString());
-        assertEquals(Boolean.TRUE, a);
-        assertEquals(Boolean.FALSE, c);
-        assertSame(Boolean.valueOf(true), Boolean.TRUE);
-        assertSame(Boolean.valueOf(false), Boolean.FALSE);
-    }
-}
-
diff --git a/tests/CoreTests/android/core/BufferedInputStreamTest.java b/tests/CoreTests/android/core/BufferedInputStreamTest.java
deleted file mode 100644
index 1ad95a1..0000000
--- a/tests/CoreTests/android/core/BufferedInputStreamTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Tests to verify that simple functionality works for BufferedInputStreams.
- */
-public class BufferedInputStreamTest extends TestCase {
-
-    @SmallTest
-    public void testBufferedInputStream() throws Exception {
-        String str = "AbCdEfGhIjKlM\nOpQrStUvWxYz";
-        ByteArrayInputStream aa = new ByteArrayInputStream(str.getBytes());
-        ByteArrayInputStream ba = new ByteArrayInputStream(str.getBytes());
-        ByteArrayInputStream ca = new ByteArrayInputStream(str.getBytes());
-        ByteArrayInputStream da = new ByteArrayInputStream(str.getBytes());
-        ByteArrayInputStream ea = new ByteArrayInputStream(str.getBytes());
-
-        BufferedInputStream a = new BufferedInputStream(aa, 6);
-        try {
-            assertEquals(str, IOUtil.read(a));
-        } finally {
-            a.close();
-        }
-
-        BufferedInputStream b = new BufferedInputStream(ba, 7);
-        try {
-            assertEquals("AbCdEfGhIj", IOUtil.read(b, 10));
-        } finally {
-            b.close();
-        }
-
-        BufferedInputStream c = new BufferedInputStream(ca, 9);
-        try {
-            assertEquals("bdfhjl\nprtvxz", IOUtil.skipRead(c));
-        } finally {
-            c.close();
-        }
-
-        BufferedInputStream d = new BufferedInputStream(da, 9);
-        try {
-            assertEquals('A', d.read());
-            d.mark(15);
-            assertEquals('b', d.read());
-            assertEquals('C', d.read());
-            d.reset();
-            assertEquals('b', d.read());
-        } finally {
-            d.close();
-        }
-
-        BufferedInputStream e = new BufferedInputStream(ea, 11);
-        try {
-            // test that we can ask for more than is present, and that we'll get
-            // back only what is there.
-            assertEquals(str, IOUtil.read(e, 10000));
-        } finally {
-            e.close();
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/BufferedOutputStreamTest.java b/tests/CoreTests/android/core/BufferedOutputStreamTest.java
deleted file mode 100644
index cd8ec08..0000000
--- a/tests/CoreTests/android/core/BufferedOutputStreamTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayOutputStream;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Tests to verify that simple functionality works for BufferedOutputStreams.
- */
-public class BufferedOutputStreamTest extends TestCase {
-
-    @SmallTest
-    public void testBufferedOutputStream() throws Exception {
-        String str = "AbCdEfGhIjKlMnOpQrStUvWxYz";
-        ByteArrayOutputStream aa = new ByteArrayOutputStream();
-        BufferedOutputStream a = new BufferedOutputStream(aa, 15);
-        try {
-            a.write(str.getBytes(), 0, 26);
-            a.write('A');
-
-            assertEquals(26, aa.size());
-            assertEquals(aa.toString(), str);
-
-            a.flush();
-
-            assertEquals(27, aa.size());
-            assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzA", aa.toString());
-        } finally {
-            a.close();
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/BufferedReaderTest.java b/tests/CoreTests/android/core/BufferedReaderTest.java
deleted file mode 100644
index a94ca02..0000000
--- a/tests/CoreTests/android/core/BufferedReaderTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.BufferedReader;
-import java.io.StringReader;
-import android.test.suitebuilder.annotation.MediumTest;
-
-/**
- * Tests to verify that simple functionality works for BufferedReaders.
- */
-public class BufferedReaderTest extends TestCase {
-
-    @MediumTest
-    public void testBufferedReader() throws Exception {
-        String str = "AbCdEfGhIjKlMnOpQrStUvWxYz";
-        StringReader aa = new StringReader(str);
-        StringReader ba = new StringReader(str);
-        StringReader ca = new StringReader(str);
-        StringReader da = new StringReader(str);
-
-        BufferedReader a = new BufferedReader(aa, 5);
-        try {
-            assertEquals(str, IOUtil.read(a));
-        } finally {
-            a.close();
-        }
-
-        BufferedReader b = new BufferedReader(ba, 15);
-        try {
-            assertEquals("AbCdEfGhIj", IOUtil.read(b, 10));
-        } finally {
-            b.close();
-        }
-
-        BufferedReader c = new BufferedReader(ca);
-        try {
-            assertEquals("bdfhjlnprtvxz", IOUtil.skipRead(c));
-        } finally {
-            c.close();
-        }
-
-        BufferedReader d = new BufferedReader(da);
-        try {
-            assertEquals("AbCdEfGdEfGhIjKlMnOpQrStUvWxYz", IOUtil.markRead(d, 3, 4));
-        } finally {
-            d.close();
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/BufferedWriterTest.java b/tests/CoreTests/android/core/BufferedWriterTest.java
deleted file mode 100644
index 12dfcef2..0000000
--- a/tests/CoreTests/android/core/BufferedWriterTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.BufferedWriter;
-import java.io.StringWriter;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Some basic tests for BufferedWriter.
- */
-public class BufferedWriterTest extends TestCase {
-
-    @SmallTest
-    public void testBufferedWriter() throws Exception {
-        String str = "AbCdEfGhIjKlMnOpQrStUvWxYz";
-        StringWriter aa = new StringWriter();
-
-        BufferedWriter a = new BufferedWriter(aa, 20);
-        try {
-            a.write(str.toCharArray(), 0, 26);
-            a.write('X');
-            a.flush();
-            assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzX", aa.toString());
-
-            a.write("alphabravodelta", 5, 5);
-            a.flush();
-            assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzXbravo", aa.toString());
-            a.newLine();
-            a.write("I'm on a new line.");
-            a.flush();
-            assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzXbravo\nI\'m on a new line.", aa.toString());
-        } finally {
-            a.close();
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/ByteArrayInputStreamTest.java b/tests/CoreTests/android/core/ByteArrayInputStreamTest.java
deleted file mode 100644
index d964102..0000000
--- a/tests/CoreTests/android/core/ByteArrayInputStreamTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.ByteArrayInputStream;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Tests to verify that simple functionality works for ByteArrayInputStreams.
- */
-public class ByteArrayInputStreamTest extends TestCase {
-
-    @SmallTest
-    public void testByteArrayInputStream() throws Exception {
-        String str = "AbCdEfGhIjKlMnOpQrStUvWxYz";
-
-        ByteArrayInputStream a = new ByteArrayInputStream(str.getBytes());
-        ByteArrayInputStream b = new ByteArrayInputStream(str.getBytes());
-        ByteArrayInputStream c = new ByteArrayInputStream(str.getBytes());
-        ByteArrayInputStream d = new ByteArrayInputStream(str.getBytes());
-
-        assertEquals(str, IOUtil.read(a));
-        assertEquals("AbCdEfGhIj", IOUtil.read(b, 10));
-        assertEquals("bdfhjlnprtvxz", IOUtil.skipRead(c));
-        assertEquals("AbCdEfGdEfGhIjKlMnOpQrStUvWxYz", IOUtil.markRead(d, 3, 4));
-    }
-}
diff --git a/tests/CoreTests/android/core/ByteArrayOutputStreamTest.java b/tests/CoreTests/android/core/ByteArrayOutputStreamTest.java
deleted file mode 100644
index e605214..0000000
--- a/tests/CoreTests/android/core/ByteArrayOutputStreamTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.ByteArrayOutputStream;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * A basic test for ByteArrayOutputStraem.
- */
-public class ByteArrayOutputStreamTest extends TestCase {
-
-    @SmallTest
-    public void testByteArrayOutputStream() throws Exception {
-        String str = "AbCdEfGhIjKlMnOpQrStUvWxYz";
-        ByteArrayOutputStream a = new ByteArrayOutputStream();
-        ByteArrayOutputStream b = new ByteArrayOutputStream(10);
-
-        a.write(str.getBytes(), 0, 26);
-        a.write('X');
-        a.writeTo(b);
-
-        assertEquals(27, a.size());
-        assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzX", a.toString());
-        assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzX", b.toString());
-    }
-}
diff --git a/tests/CoreTests/android/core/CharArrayReaderTest.java b/tests/CoreTests/android/core/CharArrayReaderTest.java
deleted file mode 100644
index 50a217a..0000000
--- a/tests/CoreTests/android/core/CharArrayReaderTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.CharArrayReader;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Basic tests for CharArrayReader.
- */
-public class CharArrayReaderTest extends TestCase {
-
-    @SmallTest
-    public void testCharArrayReader() throws Exception {
-        String str = "AbCdEfGhIjKlMnOpQrStUvWxYz";
-        CharArrayReader a = new CharArrayReader(str.toCharArray());
-        CharArrayReader b = new CharArrayReader(str.toCharArray());
-        CharArrayReader c = new CharArrayReader(str.toCharArray());
-        CharArrayReader d = new CharArrayReader(str.toCharArray());
-
-        assertEquals(str, IOUtil.read(a));
-        assertEquals("AbCdEfGhIj", IOUtil.read(b, 10));
-        assertEquals("bdfhjlnprtvxz", IOUtil.skipRead(c));
-        assertEquals("AbCdEfGdEfGhIjKlMnOpQrStUvWxYz", IOUtil.markRead(d, 3, 4));
-    }
-}
diff --git a/tests/CoreTests/android/core/ChecksumTest.java b/tests/CoreTests/android/core/ChecksumTest.java
deleted file mode 100644
index 24fb739..0000000
--- a/tests/CoreTests/android/core/ChecksumTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.util.zip.Adler32;
-import java.util.zip.CRC32;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * tests for CRC32 and Adler32 checksum algorithms.
- */
-public class ChecksumTest extends TestCase {
-
-    @SmallTest
-    public void testChecksum() throws Exception {
-        /*
-         * Values computed experimentally, using C interfaces.
-         */
-        adler32Test(mTestString, 0x9de210dbL);
-        cRC32Test(mTestString, 0x939f04afL);
-
-        // Test for issue 1016037
-        wrongChecksumWithAdler32Test();
-    }
-
-    private void adler32Test(byte[] values, long expected) {
-        Adler32 adler = new Adler32();
-
-        // try it all at once
-        adler.update(values);
-        assertEquals(adler.getValue(), expected);
-
-        // try resetting and computing one byte at a time
-        adler.reset();
-        for (int i = 0; i < values.length; i++) {
-            adler.update(values[i]);
-        }
-        assertEquals(adler.getValue(), expected);
-    }
-
-    private void cRC32Test(byte[] values, long expected) {
-        CRC32 crc = new CRC32();
-
-        // try it all at once
-        crc.update(values);
-        assertEquals(crc.getValue(), expected);
-
-        // try resetting and computing one byte at a time
-        crc.reset();
-        for (int i = 0; i < values.length; i++) {
-            crc.update(values[i]);
-        }
-        assertEquals(crc.getValue(), expected);
-    }
-
-    // "The quick brown fox jumped over the lazy dogs\n"
-    private static byte[] mTestString = {
-            0x54, 0x68, 0x65, 0x20, 0x71, 0x75, 0x69, 0x63,
-            0x6b, 0x20, 0x62, 0x72, 0x6f, 0x77, 0x6e, 0x20,
-            0x66, 0x6f, 0x78, 0x20, 0x6a, 0x75, 0x6d, 0x70,
-            0x65, 0x64, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x20,
-            0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x7a, 0x79,
-            0x20, 0x64, 0x6f, 0x67, 0x73, 0x2e, 0x0a
-    };
-
-
-    // Test for issue 1016037
-    private void wrongChecksumWithAdler32Test() {
-        byte[] bytes = {1, 0, 5, 0, 15, 0, 1, 11, 0, 1};
-        Adler32 adler = new Adler32();
-        adler.update(bytes);
-        long arrayChecksum = adler.getValue();
-        adler.reset();
-        for (int i = 0; i < bytes.length; i++) {
-            adler.update(bytes[i]);
-        }
-        assertEquals("Checksums not equal: expected: " + arrayChecksum +
-                " actual: " + adler.getValue(), arrayChecksum, adler.getValue());
-    }
-}
-
diff --git a/tests/CoreTests/android/core/DataInputStreamTest.java b/tests/CoreTests/android/core/DataInputStreamTest.java
deleted file mode 100644
index ca801d6..0000000
--- a/tests/CoreTests/android/core/DataInputStreamTest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import android.test.suitebuilder.annotation.SmallTest;
-
-public class DataInputStreamTest extends TestCase {
-
-    @SmallTest
-    public void testDataInputStream() throws Exception {
-        String str = "AbCdEfGhIjKlM\nOpQ\rStUvWxYz";
-        ByteArrayInputStream aa = new ByteArrayInputStream(str.getBytes());
-        ByteArrayInputStream ba = new ByteArrayInputStream(str.getBytes());
-        ByteArrayInputStream ca = new ByteArrayInputStream(str.getBytes());
-        ByteArrayInputStream da = new ByteArrayInputStream(str.getBytes());
-
-        DataInputStream a = new DataInputStream(aa);
-        try {
-            assertEquals(str, IOUtil.read(a));
-        } finally {
-            a.close();
-        }
-
-        DataInputStream b = new DataInputStream(ba);
-        try {
-            assertEquals("AbCdEfGhIj", IOUtil.read(b, 10));
-        } finally {
-            b.close();
-        }
-
-        DataInputStream c = new DataInputStream(ca);
-        try {
-            assertEquals("bdfhjl\np\rtvxz", IOUtil.skipRead(c));
-        } finally {
-            c.close();
-        }
-
-        DataInputStream d = new DataInputStream(da);
-        try {
-            assertEquals("AbCdEfGhIjKlM", d.readLine());
-            assertEquals("OpQ", d.readLine());
-            assertEquals("StUvWxYz", d.readLine());
-        } finally {
-            d.close();
-        }
-
-        ByteArrayOutputStream e = new ByteArrayOutputStream();
-        DataOutputStream f = new DataOutputStream(e);
-        try {
-            f.writeBoolean(true);
-            f.writeByte('a');
-            f.writeBytes("BCD");
-            f.writeChar('e');
-            f.writeChars("FGH");
-            f.writeUTF("ijklm");
-            f.writeDouble(1);
-            f.writeFloat(2);
-            f.writeInt(3);
-            f.writeLong(4);
-            f.writeShort(5);
-        } finally {
-            f.close();
-        }
-        
-        ByteArrayInputStream ga = new ByteArrayInputStream(e.toByteArray());
-        DataInputStream g = new DataInputStream(ga);
-
-        try {
-            assertTrue(g.readBoolean());
-            assertEquals('a', g.readByte());
-            assertEquals(2, g.skipBytes(2));
-            assertEquals('D', g.readByte());
-            assertEquals('e', g.readChar());
-            assertEquals('F', g.readChar());
-            assertEquals('G', g.readChar());
-            assertEquals('H', g.readChar());
-            assertEquals("ijklm", g.readUTF());
-            assertEquals(1, g.readDouble(), 0);
-            assertEquals(2f, g.readFloat(), 0f);
-            assertEquals(3, g.readInt());
-            assertEquals(4, g.readLong());
-            assertEquals(5, g.readShort());
-        } finally {
-            g.close();
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/DataOutputStreamTest.java b/tests/CoreTests/android/core/DataOutputStreamTest.java
deleted file mode 100644
index 95502b3..0000000
--- a/tests/CoreTests/android/core/DataOutputStreamTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Basic tests for DataOutputStreams.
- */
-public class DataOutputStreamTest extends TestCase {
-
-    @SmallTest
-    public void testDataOutputStream() throws Exception {
-        String str = "AbCdEfGhIjKlMnOpQrStUvWxYz";
-        ByteArrayOutputStream aa = new ByteArrayOutputStream();
-        DataOutputStream a = new DataOutputStream(aa);
-
-        try {
-            a.write(str.getBytes(), 0, 26);
-            a.write('A');
-
-            assertEquals(27, aa.size());
-            assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzA", aa.toString());
-
-            a.writeByte('B');
-            assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzAB", aa.toString());
-            a.writeBytes("BYTES");
-            assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzABBYTES", aa.toString());
-        } finally {
-            a.close();
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/DatagramTest.java b/tests/CoreTests/android/core/DatagramTest.java
deleted file mode 100644
index 355a267..0000000
--- a/tests/CoreTests/android/core/DatagramTest.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.IOException;
-import java.net.DatagramPacket;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.net.SocketTimeoutException;
-import android.test.suitebuilder.annotation.LargeTest;
-
-/**
- * Implements some simple tests for datagrams. Not as excessive as the core
- * tests, but good enough for the harness.
- */
-public class DatagramTest extends TestCase {
-
-    /**
-     * Helper class that listens to incoming datagrams and reflects them to the
-     * sender. Incoming datagram is interpreted as a String. It is uppercased
-     * before being sent back.
-     */
-
-    class Reflector extends Thread {
-        // Helper class for reflecting incoming datagrams. 
-        DatagramSocket socket;
-
-        boolean alive = true;
-
-        byte[] buffer = new byte[256];
-
-        DatagramPacket packet;
-
-        /**
-         * Main loop. Receives datagrams and reflects them.
-         */
-        @Override
-        public void run() {
-            try {
-                while (alive) {
-                    try {
-                        packet.setLength(buffer.length);
-                        socket.receive(packet);
-                        String s = stringFromPacket(packet);
-                        // System.out.println(s + " (from " + packet.getAddress() + ":" + packet.getPort() + ")");
-
-                        try {
-                            Thread.sleep(100);
-                        } catch (InterruptedException ex) {
-                            // Ignore.
-                        }
-
-                        stringToPacket(s.toUpperCase(), packet);
-
-                        packet.setAddress(InetAddress.getLocalHost());
-                        packet.setPort(2345);
-
-                        socket.send(packet);
-                    } catch (java.io.InterruptedIOException e) {
-                    }
-                }
-            } catch (java.io.IOException ex) {
-                ex.printStackTrace();
-            } finally {
-                socket.close();
-            }
-        }
-
-        /**
-         * Creates a new Relfector object for the given local address and port.
-         */
-        public Reflector(int port, InetAddress address) {
-            try {
-                packet = new DatagramPacket(buffer, buffer.length);
-                socket = new DatagramSocket(port, address);
-            } catch (IOException ex) {
-                throw new RuntimeException(
-                        "Creating datagram reflector failed", ex);
-            }
-        }
-    }
-
-    /**
-     * Converts a given datagram packet's contents to a String.
-     */
-    static String stringFromPacket(DatagramPacket packet) {
-        return new String(packet.getData(), 0, packet.getLength());
-    }
-
-    /**
-     * Converts a given String into a datagram packet.
-     */
-    static void stringToPacket(String s, DatagramPacket packet) {
-        byte[] bytes = s.getBytes();
-        System.arraycopy(bytes, 0, packet.getData(), 0, bytes.length);
-        packet.setLength(bytes.length);
-    }
-
-    /**
-     * Implements the main part of the Datagram test.
-     */
-    @LargeTest
-    public void testDatagram() throws Exception {
-
-        Reflector reflector = null;
-        DatagramSocket socket = null;
-
-        try {
-            // Setup the reflector, so we have a partner to send to
-            reflector = new Reflector(1234, InetAddress.getLocalHost());
-            reflector.start();
-
-            byte[] buffer = new byte[256];
-
-            DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
-            socket = new DatagramSocket(2345, InetAddress.getLocalHost());
-
-            // Send ten simple packets and check for the expected responses.
-            for (int i = 1; i <= 10; i++) {
-                String s = "Hello, Android world #" + i + "!";
-                stringToPacket(s, packet);
-
-                packet.setAddress(InetAddress.getLocalHost());
-                packet.setPort(1234);
-
-                socket.send(packet);
-
-                try {
-                    Thread.sleep(100);
-                } catch (InterruptedException ex) {
-                    // Ignore.
-                }
-
-                packet.setLength(buffer.length);
-                socket.receive(packet);
-                String t = stringFromPacket(packet);
-                // System.out.println(t + " (from " + packet.getAddress() + ":" + packet.getPort() + ")");
-
-                assertEquals(s.toUpperCase(), t);
-            }
-        } finally {
-            if (reflector != null) {
-                reflector.alive = false;
-            }
-
-            if (socket != null) {
-                socket.close();
-            }
-        }
-    }
-
-    // Regression test for issue 1018003: DatagramSocket ignored a set timeout.
-    @LargeTest
-    public void testDatagramSocketSetSOTimeout() throws Exception {
-        DatagramSocket sock = null;
-        int timeout = 5000;
-        long start = System.currentTimeMillis();
-        try {
-            sock = new DatagramSocket();
-            DatagramPacket pack = new DatagramPacket(new byte[100], 100);
-            sock.setSoTimeout(timeout);
-            sock.receive(pack);
-        } catch (SocketTimeoutException e) {
-            // expected
-            long delay = System.currentTimeMillis() - start;
-            if (Math.abs(delay - timeout) > 1000) {
-                fail("timeout was not accurate. expected: " + timeout
-                        + " actual: " + delay + " miliseconds.");
-            }
-        } finally {
-            if (sock != null) {
-                sock.close();
-            }
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/DeflateTest.java b/tests/CoreTests/android/core/DeflateTest.java
deleted file mode 100644
index d68d697..0000000
--- a/tests/CoreTests/android/core/DeflateTest.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.UnsupportedEncodingException;
-import java.util.zip.DataFormatException;
-import java.util.zip.Deflater;
-import java.util.zip.Inflater;
-import android.test.suitebuilder.annotation.LargeTest;
-
-public class DeflateTest extends TestCase {
-
-    @LargeTest
-    public void testDeflate() throws Exception {
-        simpleTest();
-
-        bigTest(0, 1738149618);
-        bigTest(1, 934350518);
-        bigTest(2, -532869390);
-    }
-
-    /*
-     * Simple inflate/deflate test, taken from the reference docs for the
-     * Inflater/Deflater classes.
-     */
-    private void simpleTest()
-            throws UnsupportedEncodingException, DataFormatException {
-        // Encode a String into bytes
-        String inputString = "blahblahblah??";
-        byte[] input = inputString.getBytes("UTF-8");
-
-        // Compress the bytes
-        byte[] output = new byte[100];
-        Deflater compresser = new Deflater();
-        compresser.setInput(input);
-        compresser.finish();
-        int compressedDataLength = compresser.deflate(output);
-
-        // Decompress the bytes
-        Inflater decompresser = new Inflater();
-        decompresser.setInput(output, 0, compressedDataLength);
-        byte[] result = new byte[100];
-        int resultLength = decompresser.inflate(result);
-
-        // Decode the bytes into a String
-        String outputString = new String(result, 0, resultLength, "UTF-8");
-
-        assertEquals(inputString, outputString);
-        assertEquals(compresser.getAdler(), decompresser.getAdler());
-
-        decompresser.end();
-    }
-
-    /*
-     * "step" determines how compressible the data is.
-     *
-     * Note we must set "nowrap" to false, or the Adler-32 doesn't get
-     * computed.
-     */
-    private void bigTest(int step, int expectedAdler)
-            throws UnsupportedEncodingException, DataFormatException {
-        byte[] input = new byte[128 * 1024];
-        byte[] comp = new byte[128 * 1024 + 512];
-        byte[] output = new byte[128 * 1024 + 512];
-        Inflater inflater = new Inflater(false);
-        Deflater deflater = new Deflater(Deflater.BEST_COMPRESSION, false);
-
-        createSample(input, step);
-
-        compress(deflater, input, comp);
-        expand(inflater, comp, (int) deflater.getBytesWritten(), output);
-
-        assertEquals(inflater.getBytesWritten(), input.length);
-        assertEquals(deflater.getAdler(), inflater.getAdler());
-        assertEquals(deflater.getAdler(), expectedAdler);
-    }
-
-    /*
-     * Create a large data sample.
-     * stepStep = 0 --> >99% compression
-     * stepStep = 1 --> ~30% compression
-     * stepStep = 2 --> no compression
-     */
-    private void createSample(byte[] sample, int stepStep) {
-        byte val, step;
-        int i, j, offset;
-
-        assertTrue(sample.length >= 128 * 1024);
-
-        val = 0;
-        step = 1;
-        offset = 0;
-        for (i = 0; i < (128 * 1024) / 256; i++) {
-            for (j = 0; j < 256; j++) {
-                sample[offset++] = val;
-                val += step;
-            }
-
-            step += stepStep;
-        }
-    }
-
-    private static final int LOCAL_BUF_SIZE = 256;
-
-    /*
-     * Compress all data in "in" to "out".  We use a small window on input
-     * and output to exercise that part of the code.
-     *
-     * It's the caller's responsibility to ensure that "out" has enough
-     * space.
-     */
-    private void compress(Deflater deflater, byte[] inBuf, byte[] outBuf) {
-        int inCount = inBuf.length;        // use all
-        int inPosn;
-        int outPosn;
-
-        inPosn = outPosn = 0;
-
-        //System.out.println("### starting compress");
-
-        while (!deflater.finished()) {
-            int want = -1, got;
-
-            // only read if the input buffer is empty
-            if (deflater.needsInput() && inCount != 0) {
-                want = (inCount < LOCAL_BUF_SIZE) ? inCount : LOCAL_BUF_SIZE;
-
-                deflater.setInput(inBuf, inPosn, want);
-
-                inCount -= want;
-                inPosn += want;
-                if (inCount == 0) {
-                    deflater.finish();
-                }
-            }
-
-            // deflate to current position in output buffer
-            int compCount;
-
-            compCount = deflater.deflate(outBuf, outPosn, LOCAL_BUF_SIZE);
-            outPosn += compCount;
-
-            //System.out.println("Compressed " + want + ", output " + compCount);
-        }
-    }
-
-    /*
-     * Expand data from "inBuf" to "outBuf".  Uses a small window to better
-     * exercise the code.
-     */
-    private void expand(Inflater inflater, byte[] inBuf, int inCount,
-            byte[] outBuf) throws DataFormatException {
-        int inPosn;
-        int outPosn;
-
-        inPosn = outPosn = 0;
-
-        //System.out.println("### starting expand, inCount is " + inCount);
-
-        while (!inflater.finished()) {
-            int want = -1, got;
-
-            // only read if the input buffer is empty
-            if (inflater.needsInput() && inCount != 0) {
-                want = (inCount < LOCAL_BUF_SIZE) ? inCount : LOCAL_BUF_SIZE;
-
-                inflater.setInput(inBuf, inPosn, want);
-
-                inCount -= want;
-                inPosn += want;
-            }
-
-            // inflate to current position in output buffer
-            int compCount;
-
-            compCount = inflater.inflate(outBuf, outPosn, LOCAL_BUF_SIZE);
-            outPosn += compCount;
-
-            //System.out.println("Expanded " + want + ", output " + compCount);
-        }
-    }
-}
-
diff --git a/tests/CoreTests/android/core/EnumTest.java b/tests/CoreTests/android/core/EnumTest.java
deleted file mode 100644
index d479491..0000000
--- a/tests/CoreTests/android/core/EnumTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Tests basic behavior of enums.
- */
-public class EnumTest extends TestCase {
-    enum MyEnum {
-        ZERO, ONE, TWO, THREE, FOUR {boolean isFour() {
-        return true;
-    }};
-
-        boolean isFour() {
-            return false;
-        }
-    }
-
-    enum MyEnumTwo {
-        FIVE, SIX
-    }
-
-    @SmallTest
-    public void testEnum() throws Exception {
-        assertTrue(MyEnum.ZERO.compareTo(MyEnum.ONE) < 0);
-        assertEquals(MyEnum.ZERO, MyEnum.ZERO);
-        assertTrue(MyEnum.TWO.compareTo(MyEnum.ONE) > 0);
-        assertTrue(MyEnum.FOUR.compareTo(MyEnum.ONE) > 0);
-
-        assertEquals("ONE", MyEnum.ONE.name());
-        assertSame(MyEnum.ONE.getDeclaringClass(), MyEnum.class);
-        assertSame(MyEnum.FOUR.getDeclaringClass(), MyEnum.class);
-
-        assertTrue(MyEnum.FOUR.isFour());
-
-        MyEnum e;
-
-        e = MyEnum.ZERO;
-
-        switch (e) {
-            case ZERO:
-                break;
-            default:
-                fail("wrong switch");
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/FileTest.java b/tests/CoreTests/android/core/FileTest.java
deleted file mode 100644
index 980452e..0000000
--- a/tests/CoreTests/android/core/FileTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.File;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Checks creation and deletion of a file.
- */
-public class FileTest extends TestCase {
-
-    @SmallTest
-    public void testFile() throws Exception {
-
-        File file = File.createTempFile(String.valueOf(System.currentTimeMillis()), null, null);
-
-        assertTrue(file.exists());
-        assertTrue(file.delete());
-        assertFalse(file.exists());
-    }
-}
diff --git a/tests/CoreTests/android/core/FloatDoubleTest.java b/tests/CoreTests/android/core/FloatDoubleTest.java
deleted file mode 100644
index 8c8455b..0000000
--- a/tests/CoreTests/android/core/FloatDoubleTest.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Tests for basic functionality of floats and doubles.
- */
-public class FloatDoubleTest extends TestCase {
-
-    @SmallTest
-    public void testFloatDouble() throws Exception {
-        Double d = Double.valueOf(1.0);
-        Float f = Float.valueOf(1.0f);
-        Object o = new Object();
-
-        assertFalse(f.equals(d));
-        assertFalse(d.equals(f));
-        assertFalse(f.equals(o));
-        assertFalse(d.equals(o));
-        assertFalse(f.equals(null));
-        assertFalse(d.equals(null));
-    }
-
-    @SmallTest
-    public void testFloat() throws Exception {
-        float pz = 0.0f;
-        float nz = -0.0f;
-
-        float pzero = 1.0f / Float.POSITIVE_INFINITY;
-        float nzero = 1.0f / Float.NEGATIVE_INFINITY;
-
-        // Everything compares as '=='
-        assertTrue(pz == pz);
-        assertTrue(pz == nz);
-        assertTrue(pz == pzero);
-        assertTrue(pz == nzero);
-
-        assertTrue(nz == pz);
-        assertTrue(nz == nz);
-        assertTrue(nz == pzero);
-        assertTrue(nz == nzero);
-
-        assertTrue(pzero == pz);
-        assertTrue(pzero == nz);
-        assertTrue(pzero == pzero);
-        assertTrue(pzero == nzero);
-
-        assertTrue(nzero == pz);
-        assertTrue(nzero == nz);
-        assertTrue(nzero == pzero);
-        assertTrue(nzero == nzero);
-
-        // +-0 are distinct as Floats
-        assertEquals(Float.valueOf(pz), Float.valueOf(pz));
-        assertTrue(!Float.valueOf(pz).equals(Float.valueOf(nz)));
-        assertEquals(Float.valueOf(pz), Float.valueOf(pzero));
-        assertTrue(!Float.valueOf(pz).equals(Float.valueOf(nzero)));
-
-        assertTrue(!Float.valueOf(nz).equals(Float.valueOf(pz)));
-        assertEquals(Float.valueOf(nz), Float.valueOf(nz));
-        assertTrue(!Float.valueOf(nz).equals(Float.valueOf(pzero)));
-        assertEquals(Float.valueOf(nz), Float.valueOf(nzero));
-
-        assertEquals(Float.valueOf(pzero), Float.valueOf(pz));
-        assertTrue(!Float.valueOf(pzero).equals(Float.valueOf(nz)));
-        assertEquals(Float.valueOf(pzero), Float.valueOf(pzero));
-        assertTrue(!Float.valueOf(pzero).equals(Float.valueOf(nzero)));
-
-        assertTrue(!Float.valueOf(nzero).equals(Float.valueOf(pz)));
-        assertEquals(Float.valueOf(nzero), Float.valueOf(nz));
-        assertTrue(!Float.valueOf(nzero).equals(Float.valueOf(pzero)));
-        assertEquals(Float.valueOf(nzero), Float.valueOf(nzero));
-
-        // Nan's compare as equal
-        Float sqrtm2 = Float.valueOf((float) Math.sqrt(-2.0f));
-        Float sqrtm3 = Float.valueOf((float) Math.sqrt(-3.0f));
-        assertEquals(sqrtm2, sqrtm3);
-    }
-
-    @SmallTest
-    public void testDouble() throws Exception {
-        double pz = 0.0;
-        double nz = -0.0;
-
-        double pzero = 1.0 / Double.POSITIVE_INFINITY;
-        double nzero = 1.0 / Double.NEGATIVE_INFINITY;
-
-        // Everything compares as '=='
-        assertTrue(pz == pz);
-        assertTrue(pz == nz);
-        assertTrue(pz == pzero);
-        assertTrue(pz == nzero);
-
-        assertTrue(nz == pz);
-        assertTrue(nz == nz);
-        assertTrue(nz == pzero);
-        assertTrue(nz == nzero);
-
-        assertTrue(pzero == pz);
-        assertTrue(pzero == nz);
-        assertTrue(pzero == pzero);
-        assertTrue(pzero == nzero);
-
-        assertTrue(nzero == pz);
-        assertTrue(nzero == nz);
-        assertTrue(nzero == pzero);
-        assertTrue(nzero == nzero);
-
-        // +-0 are distinct as Doubles
-        assertEquals(Double.valueOf(pz), Double.valueOf(pz));
-        assertTrue(!Double.valueOf(pz).equals(Double.valueOf(nz)));
-        assertEquals(Double.valueOf(pz), Double.valueOf(pzero));
-        assertTrue(!Double.valueOf(pz).equals(Double.valueOf(nzero)));
-
-        assertTrue(!Double.valueOf(nz).equals(Double.valueOf(pz)));
-        assertEquals(Double.valueOf(nz), Double.valueOf(nz));
-        assertTrue(!Double.valueOf(nz).equals(Double.valueOf(pzero)));
-        assertEquals(Double.valueOf(nz), Double.valueOf(nzero));
-
-        assertEquals(Double.valueOf(pzero), Double.valueOf(pz));
-        assertTrue(!Double.valueOf(pzero).equals(Double.valueOf(nz)));
-        assertEquals(Double.valueOf(pzero), Double.valueOf(pzero));
-        assertTrue(!Double.valueOf(pzero).equals(Double.valueOf(nzero)));
-
-        assertTrue(!Double.valueOf(nzero).equals(Double.valueOf(pz)));
-        assertEquals(Double.valueOf(nzero), Double.valueOf(nz));
-        assertTrue(!Double.valueOf(nzero).equals(Double.valueOf(pzero)));
-        assertEquals(Double.valueOf(nzero), Double.valueOf(nzero));
-
-        // Nan's compare as equal
-        Double sqrtm2 = Double.valueOf(Math.sqrt(-2.0));
-        Double sqrtm3 = Double.valueOf(Math.sqrt(-3.0));
-        assertEquals(sqrtm2, sqrtm3);
-    }
-}
diff --git a/tests/CoreTests/android/core/GZIPStreamTest.java b/tests/CoreTests/android/core/GZIPStreamTest.java
deleted file mode 100644
index dd56fb7..0000000
--- a/tests/CoreTests/android/core/GZIPStreamTest.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.GZIPOutputStream;
-import android.test.suitebuilder.annotation.MediumTest;
-
-/**
- * Deflates and inflates some test data with GZipStreams
- */
-public class GZIPStreamTest extends TestCase {
-
-    @MediumTest
-    public void testGZIPStream() throws Exception {
-        ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
-        createGZIP(bytesOut);
-
-        byte[] zipData;
-        zipData = bytesOut.toByteArray();
-
-        /*
-        FileOutputStream outFile = new FileOutputStream("/tmp/foo.gz");
-        outFile.write(zipData, 0, zipData.length);
-        outFile.close();
-        */
-
-        /*
-        FileInputStream inFile = new FileInputStream("/tmp/foo.gz");
-        int inputLength = inFile.available();
-        zipData = new byte[inputLength];
-        if (inFile.read(zipData) != inputLength)
-            throw new RuntimeException();
-        inFile.close();
-        */
-
-        ByteArrayInputStream bytesIn = new ByteArrayInputStream(zipData);
-        scanGZIP(bytesIn);
-    }
-
-    /*
-     * stepStep == 0 --> >99% compression
-     * stepStep == 1 --> ~30% compression
-     * stepStep == 2 --> no compression
-     */
-    static byte[] makeSampleFile(int stepStep) throws IOException {
-        byte[] sample = new byte[128 * 1024];
-        byte val, step;
-        int i, j, offset;
-
-        val = 0;
-        step = 1;
-        offset = 0;
-        for (i = 0; i < (128 * 1024) / 256; i++) {
-            for (j = 0; j < 256; j++) {
-                sample[offset++] = val;
-                val += step;
-            }
-
-            step += stepStep;
-        }
-
-        return sample;
-    }
-
-    static void createGZIP(ByteArrayOutputStream bytesOut) throws IOException {
-        GZIPOutputStream out = new GZIPOutputStream(bytesOut);
-        try {
-            byte[] input = makeSampleFile(1);
-            out.write(input, 0, input.length);
-            //out.finish();
-        } finally {
-            out.close();
-        }
-    }
-
-    static void scanGZIP(ByteArrayInputStream bytesIn) throws IOException {
-        GZIPInputStream in = new GZIPInputStream(bytesIn);
-        try {
-            ByteArrayOutputStream contents = new ByteArrayOutputStream();
-            byte[] buf = new byte[4096];
-            int len, totalLen = 0;
-
-            while ((len = in.read(buf)) > 0) {
-                contents.write(buf, 0, len);
-                totalLen += len;
-            }
-
-            assertEquals(totalLen, 128 * 1024);
-        } finally {
-            in.close();
-        }
-    }
-}
-
diff --git a/tests/CoreTests/android/core/IOUtil.java b/tests/CoreTests/android/core/IOUtil.java
deleted file mode 100644
index 6f69418..0000000
--- a/tests/CoreTests/android/core/IOUtil.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.InputStreamReader;
-
-public final class IOUtil {
-
-    private IOUtil() {
-    }
-
-    /**
-     * returns the content of an InputStream as a String.
-     *
-     * @param a the input stream.
-     * @return the string
-     * @throws java.io.IOException
-     */
-    public static String read(InputStream a) throws IOException {
-        int r;
-        StringBuilder builder = new StringBuilder();
-        do {
-            r = a.read();
-            if (r != -1)
-                builder.append((char) r);
-        } while (r != -1);
-        return builder.toString();
-    }
-
-    /**
-     * reads characters from a reader and returns them as a string.
-     *
-     * @param a the reader.
-     * @return the string.
-     * @throws IOException
-     */
-    public static String read(Reader a) throws IOException {
-        int r;
-        StringBuilder builder = new StringBuilder();
-        do {
-            r = a.read();
-            if (r != -1)
-                builder.append((char) r);
-        } while (r != -1);
-        return builder.toString();
-    }
-
-    /**
-     * returns the content of an InputStream as a String. It reads x characters.
-     *
-     * @param a the input stream.
-     * @param x number of characters to read.
-     * @return the string
-     * @throws IOException
-     */
-    public static String read(InputStream a, int x) throws IOException {
-        byte[] b = new byte[x];
-        int len = a.read(b, 0, x);
-        if (len < 0) {
-            return "";
-        }
-        return new String(b, 0, len);
-    }
-
-    /**
-     * reads a number of characters from a reader and returns them as a string.
-     *
-     * @param a the reader.
-     * @param x the number of characters to read.
-     * @return the string.
-     * @throws IOException
-     */
-    public static String read(Reader a, int x) throws IOException {
-        char[] b = new char[x];
-        int len = a.read(b, 0, x);
-        if (len < 0) {
-            return "";
-        }
-        return new String(b, 0, len);
-    }
-
-    /**
-     * returns the content of the input stream as a String. It only appends
-     * every second character.
-     *
-     * @param a the input stream.
-     * @return the string created from every second character of the input stream.
-     * @throws IOException
-     */
-    public static String skipRead(InputStream a) throws IOException {
-        int r;
-        StringBuilder builder = new StringBuilder();
-        do {
-            a.skip(1);
-            r = a.read();
-            if (r != -1)
-                builder.append((char) r);
-        } while (r != -1);
-        return builder.toString();
-    }
-
-    /**
-     * reads every second characters from a reader and returns them as a string.
-     *
-     * @param a the reader.
-     * @return the string.
-     * @throws IOException
-     */
-    public static String skipRead(Reader a) throws IOException {
-        int r;
-        StringBuilder builder = new StringBuilder();
-        do {
-            a.skip(1);
-            r = a.read();
-            if (r != -1)
-                builder.append((char) r);
-        } while (r != -1);
-        return builder.toString();
-    }
-
-    /**
-     * reads characters from a InputStream, skips back y characters and continues
-     * reading from that new position up to the end.
-     *
-     * @param a the InputStream.
-     * @param x the position of the mark. the marks position is x+y
-     * @param y the number of characters to jump back after the position x+y was reached.
-     * @return the string.
-     * @throws IOException
-     */
-    public static String markRead(InputStream a, int x, int y) throws IOException {
-        int m = 0;
-        int r;
-        StringBuilder builder = new StringBuilder();
-        do {
-            m++;
-            r = a.read();
-            if (m == x)
-                a.mark((x + y));
-            if (m == (x + y))
-                a.reset();
-
-            if (r != -1)
-                builder.append((char) r);
-        } while (r != -1);
-        return builder.toString();
-    }
-
-    /**
-     * reads characters from a reader, skips back y characters and continues
-     * reading from that new position up to the end.
-     *
-     * @param a the reader.
-     * @param x the position of the mark. the marks position is x+y
-     * @param y the number of characters to jump back after the position x+y was reached.
-     * @return the string.
-     * @throws IOException
-     */
-    public static String markRead(Reader a, int x, int y) throws IOException {
-        int m = 0;
-        int r;
-        StringBuilder builder = new StringBuilder();
-        do {
-            m++;
-            r = a.read();
-            if (m == x)
-                a.mark((x + y));
-            if (m == (x + y))
-                a.reset();
-
-            if (r != -1)
-                builder.append((char) r);
-        } while (r != -1);
-        return builder.toString();
-    }
-}
diff --git a/tests/CoreTests/android/core/InputStreamReaderTest.java b/tests/CoreTests/android/core/InputStreamReaderTest.java
deleted file mode 100644
index 1e8d87c..0000000
--- a/tests/CoreTests/android/core/InputStreamReaderTest.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStreamReader;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Checks basic InputStreamReader functionality.
- */
-public class InputStreamReaderTest extends TestCase {
-
-    /**
-     * Checks if ASCII encoding works with InputStreamReader
-     */
-    @SmallTest
-    public void testAscii() throws Exception {
-        String str = "AbCdEfGhIjKlMnOpQrStUvWxYzX";
-        ByteArrayInputStream aa = new ByteArrayInputStream(str.getBytes("ISO8859_1"));
-        InputStreamReader a = new InputStreamReader(aa, "ISO8859_1");
-
-        try {
-            int x = a.read();
-            assertEquals('A', x);
-            char[] c = new char[26];
-            x = a.read(c, 0, 26);
-            assertTrue(a.getEncoding().equalsIgnoreCase("ISO8859_1"));
-            assertEquals(26, x);
-            assertEquals("bCdEfGhIjKlMnOpQrStUvWxYzX", String.valueOf(c));
-        } finally {
-            a.close();
-        }
-    }
-
-    /**
-     * Checks if Utf8 encoding works with InputStreamReader
-     */
-    @SmallTest
-    public void testUtf8() throws Exception {
-        String str = "AbCdEfGhIjKlMnOpQrStUvWxYzX" +
-                "\u00a3\u00c5\u00c9";       // total of 30 characters
-        ByteArrayInputStream aa =
-                new ByteArrayInputStream(str.getBytes());
-
-        InputStreamReader a = new InputStreamReader(aa);
-
-        try {
-            assertEquals("UTF8", a.getEncoding());
-
-            int x = a.read();
-            assertEquals('A', x);
-
-            char[] c = new char[29];
-            x = a.read(c, 0, 3);
-            assertEquals(3, x);
-            assertEquals("bCd", new String(c, 0, 3));
-
-            x = a.read(c, 3, 26);
-            assertEquals(26, x);
-            assertEquals("EfGhIjKlMnOpQrStUvWxYzX\u00a3\u00c5\u00c9", new String(c, 3, 26));
-        } finally {
-            a.close();
-        }
-    }
-
-    /**
-     * Checks if several encodings works with InputStreamReader
-     */
-    @SmallTest
-    public void testStringy() throws Exception {
-        String src = "The quick brown fox\u00A0\u00FF" +
-                "\uFFFC\uD7C5\uDC03bloof";
-
-        String[] enc = new String[]{
-                "utf-8", "us-ascii", "iso-8859-1", "utf-16be", "utf-16le",
-                "utf-16",
-        };
-
-        for (int i = 0; i < enc.length; i++) {
-            byte[] ba = src.getBytes(enc[i]);
-
-            String s1 = new String(ba, enc[i]);
-
-            ByteArrayInputStream bais = new ByteArrayInputStream(ba);
-            InputStreamReader r = new InputStreamReader(bais, enc[i]);
-            try {
-                char[] ca = new char[600];
-                int n = r.read(ca, 0, 600);
-
-                String s2 = new String(ca, 0, n);
-                assertEquals(s1, s2);
-            } finally {
-                r.close();
-            }
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/InstanceofTest.java b/tests/CoreTests/android/core/InstanceofTest.java
deleted file mode 100644
index b35ef6b..0000000
--- a/tests/CoreTests/android/core/InstanceofTest.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (C) 2006 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-import android.test.suitebuilder.annotation.MediumTest;
-
-
-public class InstanceofTest extends TestCase {
-
-    protected A mA;
-    protected ChildOfAOne mOne;
-    protected ChildOfAOne mTwo;
-    protected ChildOfAOne mThree;
-    protected ChildOfAOne mFour;
-    protected ChildOfAFive mFive;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        mA = new A();
-        mOne = new ChildOfAOne();
-        mTwo = new ChildOfATwo();
-        mThree = new ChildOfAThree();
-        mFour = new ChildOfAFour();
-        mFive = new ChildOfAFive();
-    }
-
-
-    @MediumTest
-    public void testNoInterface() throws Exception {
-        A a = mA;
-        for (int i = 0; i < 100000; i++) {
-            assertFalse("m_a should not be a ChildOfAFive", a instanceof ChildOfAFive);
-        }
-    }
-
-    @MediumTest
-    public void testDerivedOne() throws Exception {
-        InterfaceOne one = mOne;
-        for (int i = 0; i < 100000; i++) {
-            assertFalse("m_one should not be a ChildOfAFive", one instanceof ChildOfAFive);
-        }
-    }
-
-    @MediumTest
-    public void testDerivedTwo() throws Exception {
-        InterfaceTwo two = mTwo;
-        for (int i = 0; i < 100000; i++) {
-            assertFalse("m_two should not be a ChildOfAFive", two instanceof ChildOfAFive);
-        }
-    }
-
-    @MediumTest
-    public void testDerivedThree() throws Exception {
-        InterfaceThree three = mThree;
-        for (int i = 0; i < 100000; i++) {
-            assertFalse("m_three should not be a ChildOfAFive", three instanceof ChildOfAFive);
-        }
-    }
-
-    @MediumTest
-    public void testDerivedFour() throws Exception {
-        InterfaceFour four = mFour;
-        for (int i = 0; i < 100000; i++) {
-            assertFalse("m_four should not be a ChildOfAFive", four instanceof ChildOfAFive);
-        }
-    }
-
-    @MediumTest
-    public void testSuccessClass() throws Exception {
-        ChildOfAOne five = mFive;
-        for (int i = 0; i < 100000; i++) {
-            assertTrue("m_five is suppose to be a ChildOfAFive", five instanceof ChildOfAFive);
-        }
-    }
-
-    @MediumTest
-    public void testSuccessInterface() throws Exception {
-        ChildOfAFive five = mFive;
-        for (int i = 0; i < 100000; i++) {
-            assertTrue("m_five is suppose to be a InterfaceFour", five instanceof InterfaceFour);
-        }
-    }
-
-    @MediumTest
-    public void testFailInterface() throws Exception {
-        InterfaceOne one = mFive;
-        for (int i = 0; i < 100000; i++) {
-            assertFalse("m_five does not implement InterfaceFive", one instanceof InterfaceFive);
-        }
-    }
-
-    private interface InterfaceOne {
-    }
-
-    private interface InterfaceTwo {
-    }
-
-    private interface InterfaceThree {
-    }
-
-    private interface InterfaceFour {
-    }
-
-    private interface InterfaceFive {
-    }
-
-    private static class A {
-    }
-
-    private static class ChildOfAOne extends A implements InterfaceOne, InterfaceTwo, InterfaceThree, InterfaceFour {
-    }
-
-    private static class ChildOfATwo extends ChildOfAOne {
-    }
-
-    private static class ChildOfAThree extends ChildOfATwo {
-    }
-
-    private static class ChildOfAFour extends ChildOfAThree {
-    }
-
-    private static class ChildOfAFive extends ChildOfAFour {
-    }
-}
diff --git a/tests/CoreTests/android/core/LineNumberReaderTest.java b/tests/CoreTests/android/core/LineNumberReaderTest.java
deleted file mode 100644
index 6380ebe..0000000
--- a/tests/CoreTests/android/core/LineNumberReaderTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.LineNumberReader;
-import java.io.StringReader;
-import android.test.suitebuilder.annotation.MediumTest;
-
-/**
- * Checks basic functionality for LineNumberReader.
- */
-public class LineNumberReaderTest extends TestCase {
-
-    @MediumTest
-    public void testLineNumberReader() throws Exception {
-        String str = "AbCdEfGhIjKlM\nOpQrStUvWxYz";
-
-        StringReader aa = new StringReader(str);
-        StringReader ba = new StringReader(str);
-        StringReader ca = new StringReader(str);
-        StringReader da = new StringReader(str);
-        StringReader ea = new StringReader(str);
-
-        LineNumberReader a = new LineNumberReader(aa);
-        try {
-            assertEquals(0, a.getLineNumber());
-            assertEquals(str, IOUtil.read(a));
-            assertEquals(1, a.getLineNumber());
-            a.setLineNumber(5);
-            assertEquals(5, a.getLineNumber());
-        } finally {
-            a.close();
-        }
-
-        LineNumberReader b = new LineNumberReader(ba);
-        try {
-            assertEquals("AbCdEfGhIj", IOUtil.read(b, 10));
-        } finally {
-            b.close();
-        }
-
-        LineNumberReader c = new LineNumberReader(ca);
-        try {
-            assertEquals("bdfhjl\nprtvxz", IOUtil.skipRead(c));
-        } finally {
-            c.close();
-        }
-
-        LineNumberReader d = new LineNumberReader(da);
-        try {
-            assertEquals("AbCdEfGdEfGhIjKlM\nOpQrStUvWxYz", IOUtil.markRead(d, 3, 4));
-        } finally {
-            d.close();
-        }
-
-        LineNumberReader e = new LineNumberReader(ea);
-        try {
-            assertEquals("AbCdEfGhIjKlM", e.readLine());
-        } finally {
-            e.close();
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/LocaleTest.java b/tests/CoreTests/android/core/LocaleTest.java
deleted file mode 100644
index 72489c6..0000000
--- a/tests/CoreTests/android/core/LocaleTest.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.nio.charset.Charset;
-import java.text.DateFormatSymbols;
-import java.util.Calendar;
-import java.util.Currency;
-import java.util.Locale;
-import java.util.Set;
-import java.util.TimeZone;
-import android.test.suitebuilder.annotation.MediumTest;
-import android.test.suitebuilder.annotation.SmallTest;
-import android.test.suitebuilder.annotation.LargeTest;
-import android.test.suitebuilder.annotation.Suppress;
-
-/**
- * Test some locale-dependent stuff for Android. This test mainly ensures that
- * our ICU configuration is correct and contains all the needed locales and
- * resource bundles. 
- */
-public class LocaleTest extends TestCase {
-
-    // Test basic Locale infrastructure.
-    @SmallTest
-    public void testLocale() throws Exception {
-        Locale locale = new Locale("en");
-        assertEquals("en", locale.toString());
-
-        locale = new Locale("en", "US");
-        assertEquals("en_US", locale.toString());
-
-        locale = new Locale("en", "", "POSIX");
-        assertEquals("en__POSIX", locale.toString());
-
-        locale = new Locale("en", "US", "POSIX");
-        assertEquals("en_US_POSIX", locale.toString());
-    }
-
-    /*
-     * Tests some must-have locales. TODO: Add back "de". See discussion
-     * immediately below this method.
-     */
-    @LargeTest
-    public void testResourceBundles() throws Exception {
-        Locale eng = new Locale("en", "US");
-        DateFormatSymbols engSymbols = new DateFormatSymbols(eng);
-        
-        //Locale deu = new Locale("de", "DE");
-        //DateFormatSymbols deuSymbols = new DateFormatSymbols(deu);
-        
-        TimeZone berlin = TimeZone.getTimeZone("Europe/Berlin");
-        
-        assertEquals("January", engSymbols.getMonths()[0]);
-        //assertEquals("Januar", deuSymbols.getMonths()[0]);
-
-        assertEquals("Sunday", engSymbols.getWeekdays()[Calendar.SUNDAY]);
-        //assertEquals("Sonntag", deuSymbols.getWeekdays()[Calendar.SUNDAY]);
-        
-        assertEquals("Central European Time",
-                berlin.getDisplayName(false, TimeZone.LONG, eng));
-        assertEquals("Central European Summer Time",
-                berlin.getDisplayName(true, TimeZone.LONG, eng));
-
-        //assertEquals("Mitteleurop\u00E4ische Zeit",
-        //        berlin.getDisplayName(false, TimeZone.LONG, deu));
-        //assertEquals("Mitteleurop\u00E4ische Sommerzeit",
-        //        berlin.getDisplayName(true, TimeZone.LONG, deu));
-        
-        assertTrue(engSymbols.getZoneStrings().length > 100);
-    }
-
-    /*
-     * Disabled version of the above test. The version above omits
-     * checks for stuff in the "de" locale, because we stripped that
-     * out as part of the flash reduction effort (so that we could
-     * still ship on Dream). We expect to have a baseline target that
-     * includes a large enough system partition to include "de"
-     * immediately after the last official release for Dream (whenever
-     * that may be).
-     * 
-    // Test some must-have locales.
-    @LargeTest
-    public void testResourceBundles() throws Exception {
-        Locale eng = new Locale("en", "US");
-        DateFormatSymbols engSymbols = new DateFormatSymbols(eng);
-        
-        Locale deu = new Locale("de", "DE");
-        DateFormatSymbols deuSymbols = new DateFormatSymbols(deu);
-        
-        TimeZone berlin = TimeZone.getTimeZone("Europe/Berlin");
-        
-        assertEquals("January", engSymbols.getMonths()[0]);
-        assertEquals("Januar", deuSymbols.getMonths()[0]);
-
-        assertEquals("Sunday", engSymbols.getWeekdays()[Calendar.SUNDAY]);
-        assertEquals("Sonntag", deuSymbols.getWeekdays()[Calendar.SUNDAY]);
-        
-        assertEquals("Central European Time",
-                berlin.getDisplayName(false, TimeZone.LONG, eng));
-        assertEquals("Central European Summer Time",
-                berlin.getDisplayName(true, TimeZone.LONG, eng));
-
-        assertEquals("Mitteleurop\u00E4ische Zeit",
-                berlin.getDisplayName(false, TimeZone.LONG, deu));
-        assertEquals("Mitteleurop\u00E4ische Sommerzeit",
-                berlin.getDisplayName(true, TimeZone.LONG, deu));
-        
-        assertTrue(engSymbols.getZoneStrings().length > 100);
-    }
-    */
-
-    // This one makes sure we have all necessary locales installed.
-    // Suppress this flaky test for now.
-    @Suppress
-    public void testICULocales() {
-        String[] locales = new String[] {
-                // List of locales currently required for Android.
-                "en_US", "es_US", "en_GB", "fr_FR", "de_DE", "de_AT", "cs_CZ", "nl_NL" };
-        
-        String[] mondays = new String[] {
-                "Monday", "lunes", "Monday", "lundi", "Montag", "Montag", "pond\u011bl\u00ed", "maandag" };
-        
-        String[] currencies = new String[] {
-                "USD", "USD", "GBP", "EUR", "EUR", "EUR", "CZK", "EUR"};
-
-        for (int i = 0; i < locales.length; i++) {
-            Locale l = new Locale(locales[i].substring(0, 2), locales[i].substring(3));
-            
-            // Check language part of locale.
-            DateFormatSymbols d = new DateFormatSymbols(l);
-            assertEquals("Monday name for " + locales[i] + " must match",
-                    mondays[i], d.getWeekdays()[2]);
-            
-            // Check country part of locale.
-            Currency c = Currency.getInstance(l);
-            assertEquals("Currency code for " + locales[i] + " must match",
-                    currencies[i], c.getCurrencyCode());
-        }
-    }
-
-    // Regression test for 1118570: Create test cases for tracking ICU config
-    // changes. This one makes sure we have the necessary converters installed
-    // and don't lose the changes to the converter alias table.
-    @MediumTest
-    public void testICUConverters() {
-        // List of encodings currently required for Android.
-        String[] encodings = new String[] {
-                // Encoding required by the language specification.
-                "US-ASCII",
-                "UTF-8",
-                "UTF-16",
-                "UTF-16BE",
-                "UTF-16LE",
-                "ISO-8859-1",
-                
-                // Additional encodings included in standard ICU
-                "ISO-8859-2",
-                "ISO-8859-3",
-                "ISO-8859-4",
-                "ISO-8859-5",
-                "ISO-8859-6",
-                "ISO-8859-7",
-                "ISO-8859-8",
-                "ISO-8859-8-I",
-                "ISO-8859-9",
-                "ISO-8859-10", 
-                "ISO-8859-11", 
-                "ISO-8859-13",
-                "ISO-8859-14", 
-                "ISO-8859-15",
-                "ISO-8859-16", 
-                "ISO-2022-JP",
-                "Windows-950",
-                "Windows-1250",
-                "Windows-1251",
-                "Windows-1252",
-                "Windows-1253",
-                "Windows-1254",
-                "Windows-1255",
-                "Windows-1256",
-                "Windows-1257",
-                "Windows-1258",              
-                "Big5",
-                "CP864",
-                "CP874",
-                "EUC-CN",
-                "EUC-JP",
-                "KOI8-R",
-                "Macintosh",
-                "GBK",
-                "GB2312",
-                "EUC-KR",
-                
-                // Additional encoding not included in standard ICU.
-                "GSM0338" };
-        
-        for (int i = 0; i < encodings.length; i++) {
-            assertTrue("Charset " + encodings[i] + " must be supported",
-                    Charset.isSupported(encodings[i]));
-            
-            Charset cs = Charset.forName(encodings[i]);
-            android.util.Log.d("LocaleTest", cs.name());
-            
-            Set<String> aliases = cs.aliases();
-            for (String s: aliases) {
-                android.util.Log.d("LocaleTest", " - " + s);
-            }
-        }
-        
-        // Test for valid encoding that is not included in Android. IBM-37 is
-        // a perfect candidate for this, as it is being used for mainframes and
-        // thus somewhat out of the scope of Android.
-        assertFalse("Charset IBM-37 must not be supported",
-                Charset.isSupported("IBM-37"));
-
-        // Test for a bogus encoding.
-        assertFalse("Charset KLINGON must not be supported",
-                Charset.isSupported("KLINGON"));
-        
-        // Make sure our local change to the real translation table used for
-        // EUC-JP doesn't get lost.
-        Charset cs = Charset.forName("EUC-JP");
-        assertTrue("EUC-JP must use 'ibm-954_P101-2007'", cs.aliases().contains("ibm-954_P101-2007"));
-    }
-    
-}
diff --git a/tests/CoreTests/android/core/MathTest.java b/tests/CoreTests/android/core/MathTest.java
deleted file mode 100644
index 50009db..0000000
--- a/tests/CoreTests/android/core/MathTest.java
+++ /dev/null
@@ -1,831 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-import android.test.suitebuilder.annotation.MediumTest;
-
-public class MathTest extends TestCase {
-
-    private final double HYP = Math.sqrt(2.0);
-
-    private final double OPP = 1.0;
-
-    private final double ADJ = 1.0;
-
-    /* Required to make previous preprocessor flags work - do not remove */
-    int unused = 0;
-
-    public static void assertEquals(String message, double expected, double actual, double delta) {
-        if (delta == 0D) {
-            Assert.assertEquals(message, expected, actual, Math.ulp(expected));
-        } else {
-            Assert.assertEquals(message, expected, actual, delta);
-        }
-    }
-
-    public static void assertEquals(String message, float expected, float actual, float delta) {
-        if (delta == 0F) {
-            Assert.assertEquals(message, expected, actual, Math.ulp(expected));
-        } else {
-            Assert.assertEquals(message, expected, actual, delta);
-        }
-    }
-    
-    /**
-     * @tests java.lang.Math#abs(double)
-     */
-    @SmallTest
-    public void testAbsD() {
-        // Test for method double java.lang.Math.abs(double)
-
-        assertTrue("Incorrect double abs value",
-                (Math.abs(-1908.8976) == 1908.8976));
-        assertTrue("Incorrect double abs value",
-                (Math.abs(1908.8976) == 1908.8976));
-    }
-
-    /**
-     * @tests java.lang.Math#abs(float)
-     */
-    @SmallTest
-    public void testAbsF() {
-        // Test for method float java.lang.Math.abs(float)
-        assertTrue("Incorrect float abs value",
-                (Math.abs(-1908.8976f) == 1908.8976f));
-        assertTrue("Incorrect float abs value",
-                (Math.abs(1908.8976f) == 1908.8976f));
-    }
-
-    /**
-     * @tests java.lang.Math#abs(int)
-     */
-    @SmallTest
-    public void testAbsI() {
-        // Test for method int java.lang.Math.abs(int)
-        assertTrue("Incorrect int abs value", (Math.abs(-1908897) == 1908897));
-        assertTrue("Incorrect int abs value", (Math.abs(1908897) == 1908897));
-    }
-
-    /**
-     * @tests java.lang.Math#abs(long)
-     */
-    @SmallTest
-    public void testAbsJ() {
-        // Test for method long java.lang.Math.abs(long)
-        assertTrue("Incorrect long abs value",
-                (Math.abs(-19088976000089L) == 19088976000089L));
-        assertTrue("Incorrect long abs value",
-                (Math.abs(19088976000089L) == 19088976000089L));
-    }
-
-    /**
-     * @tests java.lang.Math#acos(double)
-     */
-    @SmallTest
-    public void testAcosD() {
-        // Test for method double java.lang.Math.acos(double)
-        double r = Math.cos(Math.acos(ADJ / HYP));
-        long lr = Double.doubleToLongBits(r);
-        long t = Double.doubleToLongBits(ADJ / HYP);
-        assertTrue("Returned incorrect arc cosine", lr == t || (lr + 1) == t
-                || (lr - 1) == t);
-    }
-
-    /**
-     * @tests java.lang.Math#asin(double)
-     */
-    @SmallTest
-    public void testAsinD() {
-        // Test for method double java.lang.Math.asin(double)
-        double r = Math.sin(Math.asin(OPP / HYP));
-        long lr = Double.doubleToLongBits(r);
-        long t = Double.doubleToLongBits(OPP / HYP);
-        assertTrue("Returned incorrect arc sine", lr == t || (lr + 1) == t
-                || (lr - 1) == t);
-    }
-
-    /**
-     * @tests java.lang.Math#atan(double)
-     */
-    @SmallTest
-    public void testAtanD() {
-        // Test for method double java.lang.Math.atan(double)
-        double answer = Math.tan(Math.atan(1.0));
-        assertTrue("Returned incorrect arc tangent: " + answer, answer <= 1.0
-                && answer >= 9.9999999999999983E-1);
-    }
-
-    /**
-     * @tests java.lang.Math#atan2(double, double)
-     */
-    @SmallTest
-    public void testAtan2DD() {
-        // Test for method double java.lang.Math.atan2(double, double)
-        double answer = Math.atan(Math.tan(1.0));
-        assertTrue("Returned incorrect arc tangent: " + answer, answer <= 1.0
-                && answer >= 9.9999999999999983E-1);
-    }
-    
-     /**
-     * @tests java.lang.Math#cbrt(double)
-     */
-    @SmallTest
-    public void testCbrtD() {
-        //Test for special situations
-        assertTrue("Should return Double.NaN", Double.isNaN(Math
-                .cbrt(Double.NaN)));
-        assertEquals("Should return Double.POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math
-                        .cbrt(Double.POSITIVE_INFINITY), 0D);
-        assertEquals("Should return Double.NEGATIVE_INFINITY",
-                Double.NEGATIVE_INFINITY, Math
-                        .cbrt(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
-                .cbrt(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double.doubleToLongBits(Math
-                .cbrt(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double.doubleToLongBits(Math
-                .cbrt(-0.0)));
-
-        assertEquals("Should return 3.0", 3.0, Math.cbrt(27.0), 0D);
-        assertEquals("Should return 23.111993172558684", 23.111993172558684,
-                Math.cbrt(12345.6), 0D);
-        assertEquals("Should return 5.643803094122362E102",
-                5.643803094122362E102, Math.cbrt(Double.MAX_VALUE), 0D);
-        assertEquals("Should return 0.01", 0.01, Math.cbrt(0.000001), 0D);
-
-        assertEquals("Should return -3.0", -3.0, Math.cbrt(-27.0), 0D);
-        assertEquals("Should return -23.111993172558684", -23.111993172558684,
-                Math.cbrt(-12345.6), 0D);
-        assertEquals("Should return 1.7031839360032603E-108",
-                1.7031839360032603E-108, Math.cbrt(Double.MIN_VALUE), 0D);
-        assertEquals("Should return -0.01", -0.01, Math.cbrt(-0.000001), 0D);
-    }
-
-    /**
-     * @tests java.lang.Math#ceil(double)
-     */
-    @SmallTest
-    public void testCeilD() {
-        // Test for method double java.lang.Math.ceil(double)
-                assertEquals("Incorrect ceiling for double",
-                             79, Math.ceil(78.89), 0);
-        assertEquals("Incorrect ceiling for double",
-                             -78, Math.ceil(-78.89), 0);
-    }
-
-    /**
-     * @tests java.lang.Math#cos(double)
-     */
-    @SmallTest
-    public void testCosD() {
-        // Test for method double java.lang.Math.cos(double)
-        assertEquals("Incorrect answer", 1.0, Math.cos(0), 0D);
-        assertEquals("Incorrect answer", 0.5403023058681398, Math.cos(1), 0D);
-    }
-
-    /**
-     * @tests java.lang.Math#cosh(double)
-     */
-    @SmallTest
-    public void testCoshD() {
-        // Test for special situations
-        assertTrue(Double.isNaN(Math.cosh(Double.NaN)));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.cosh(Double.POSITIVE_INFINITY), 0D);
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.cosh(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals("Should return 1.0", 1.0, Math.cosh(+0.0), 0D);
-        assertEquals("Should return 1.0", 1.0, Math.cosh(-0.0), 0D);
-
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.cosh(1234.56), 0D);
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.cosh(-1234.56), 0D);
-        assertEquals("Should return 1.0000000000005", 1.0000000000005, Math
-                .cosh(0.000001), 0D);
-        assertEquals("Should return 1.0000000000005", 1.0000000000005, Math
-                .cosh(-0.000001), 0D);
-        assertEquals("Should return 5.212214351945598", 5.212214351945598, Math
-                .cosh(2.33482), 0D);
-
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.cosh(Double.MAX_VALUE), 0D);
-        assertEquals("Should return 1.0", 1.0, Math.cosh(Double.MIN_VALUE), 0D);
-    }
-    
-    /**
-     * @tests java.lang.Math#exp(double)
-     */
-    @SmallTest
-    public void testExpD() {
-        // Test for method double java.lang.Math.exp(double)
-        assertTrue("Incorrect answer returned for simple power", Math.abs(Math
-                .exp(4D)
-                - Math.E * Math.E * Math.E * Math.E) < 0.1D);
-        assertTrue("Incorrect answer returned for larger power", Math.log(Math
-                .abs(Math.exp(5.5D)) - 5.5D) < 10.0D);
-    }
-    
-    /**
-     * @tests java.lang.Math#expm1(double)
-     */
-    @SmallTest
-    public void testExpm1D() {
-        // Test for special cases
-        assertTrue("Should return NaN", Double.isNaN(Math.expm1(Double.NaN)));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.expm1(Double.POSITIVE_INFINITY), 0D);
-        assertEquals("Should return -1.0", -1.0, Math
-                .expm1(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
-                .expm1(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(Math.expm1(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(Math.expm1(-0.0)));
-
-        assertEquals("Should return -9.999950000166666E-6",
-                -9.999950000166666E-6, Math.expm1(-0.00001), 0D);
-        assertEquals("Should return 1.0145103074469635E60",
-                1.0145103074469635E60, Math.expm1(138.16951162), 0D);
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math
-                        .expm1(123456789123456789123456789.4521584223), 0D);
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.expm1(Double.MAX_VALUE), 0D);
-        assertEquals("Should return MIN_VALUE", Double.MIN_VALUE, Math
-                .expm1(Double.MIN_VALUE), 0D);
-    }
-
-    /**
-     * @tests java.lang.Math#floor(double)
-     */
-    @SmallTest
-    public void testFloorD() {
-        // Test for method double java.lang.Math.floor(double)
-                assertEquals("Incorrect floor for double",
-                             78, Math.floor(78.89), 0);
-        assertEquals("Incorrect floor for double",
-                             -79, Math.floor(-78.89), 0);
-    }
-    
-    /**
-     * @tests java.lang.Math#hypot(double, double)
-     */
-    @SmallTest
-    public void testHypotDD() {
-        // Test for special cases
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.hypot(Double.POSITIVE_INFINITY,
-                        1.0), 0D);
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.hypot(Double.NEGATIVE_INFINITY,
-                        123.324), 0D);
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.hypot(-758.2587,
-                        Double.POSITIVE_INFINITY), 0D);
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.hypot(5687.21,
-                        Double.NEGATIVE_INFINITY), 0D);
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.hypot(Double.POSITIVE_INFINITY,
-                        Double.NEGATIVE_INFINITY), 0D);
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.hypot(Double.NEGATIVE_INFINITY,
-                        Double.POSITIVE_INFINITY), 0D);        
-        assertTrue("Should be NaN", Double.isNaN(Math.hypot(Double.NaN,
-                2342301.89843)));
-        assertTrue("Should be NaN", Double.isNaN(Math.hypot(-345.2680,
-                Double.NaN)));        
-
-        assertEquals("Should return 2396424.905416697", 2396424.905416697, Math
-                .hypot(12322.12, -2396393.2258), 0D);
-        assertEquals("Should return 138.16958070558556", 138.16958070558556,
-                Math.hypot(-138.16951162, 0.13817035864), 0D);
-        assertEquals("Should return 1.7976931348623157E308",
-                1.7976931348623157E308, Math.hypot(Double.MAX_VALUE, 211370.35), 0D);
-        assertEquals("Should return 5413.7185", 5413.7185, Math.hypot(
-                -5413.7185, Double.MIN_VALUE), 0D);
-    }
-
-    /**
-     * @tests java.lang.Math#IEEEremainder(double, double)
-     */
-    @SmallTest
-    public void testIEEEremainderDD() {
-        // Test for method double java.lang.Math.IEEEremainder(double, double)
-        assertEquals("Incorrect remainder returned",
-                0.0, Math.IEEEremainder(1.0, 1.0), 0D);
-        assertTrue("Incorrect remainder returned", Math.IEEEremainder(1.32,
-                89.765) >= 1.4705063220631647E-2
-                || Math.IEEEremainder(1.32, 89.765) >= 1.4705063220631649E-2);
-    }
-
-    /**
-     * @tests java.lang.Math#log(double)
-     */
-    @SmallTest
-    public void testLogD() {
-        // Test for method double java.lang.Math.log(double)
-        for (double d = 10; d >= -10; d -= 0.5) {
-            double answer = Math.log(Math.exp(d));
-            assertTrue("Answer does not equal expected answer for d = " + d
-                    + " answer = " + answer, Math.abs(answer - d) <= Math
-                    .abs(d * 0.00000001));
-        }
-    }
-    
-    /**
-     * @tests java.lang.Math#log10(double)
-     */
-    @SuppressWarnings("boxing")
-    @SmallTest
-    public void testLog10D() {
-        // Test for special cases
-        assertTrue(Double.isNaN(Math.log10(Double.NaN)));
-        assertTrue(Double.isNaN(Math.log10(-2541.05745687234187532)));
-        assertTrue(Double.isNaN(Math.log10(-0.1)));
-        assertEquals(Double.POSITIVE_INFINITY, Math.log10(Double.POSITIVE_INFINITY));
-        assertEquals(Double.NEGATIVE_INFINITY, Math.log10(0.0));
-        assertEquals(Double.NEGATIVE_INFINITY, Math.log10(+0.0));
-        assertEquals(Double.NEGATIVE_INFINITY, Math.log10(-0.0));
-        
-        assertEquals(3.0, Math.log10(1000.0));
-        assertEquals(14.0, Math.log10(Math.pow(10, 14)));
-        assertEquals(3.7389561269540406, Math.log10(5482.2158));
-        assertEquals(14.661551142893833, Math.log10(458723662312872.125782332587));
-        assertEquals(-0.9083828622192334, Math.log10(0.12348583358871));
-        assertEquals(308.25471555991675, Math.log10(Double.MAX_VALUE));
-        assertEquals(-323.3062153431158, Math.log10(Double.MIN_VALUE));
-    }
-    
-    /**
-     * @tests java.lang.Math#log1p(double)
-     */
-    @SmallTest
-    public void testLog1pD() {
-        // Test for special cases
-        assertTrue("Should return NaN", Double.isNaN(Math.log1p(Double.NaN)));
-        assertTrue("Should return NaN", Double.isNaN(Math.log1p(-32.0482175)));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.log1p(Double.POSITIVE_INFINITY), 0D);
-        assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
-                .log1p(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(Math.log1p(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(Math.log1p(-0.0)));
-
-        assertEquals("Should return -0.2941782295312541", -0.2941782295312541,
-                Math.log1p(-0.254856327), 0D);
-        assertEquals("Should return 7.368050685564151", 7.368050685564151, Math
-                .log1p(1583.542), 0D);
-        assertEquals("Should return 0.4633708685409921", 0.4633708685409921,
-                Math.log1p(0.5894227), 0D);
-        assertEquals("Should return 709.782712893384", 709.782712893384, Math
-                .log1p(Double.MAX_VALUE), 0D);
-        assertEquals("Should return Double.MIN_VALUE", Double.MIN_VALUE, Math
-                .log1p(Double.MIN_VALUE), 0D);
-    }
-
-    /**
-     * @tests java.lang.Math#max(double, double)
-     */
-    @SmallTest
-    public void testMaxDD() {
-        // Test for method double java.lang.Math.max(double, double)
-        assertEquals("Incorrect double max value", 1908897.6000089, Math.max(-1908897.6000089,
-                1908897.6000089), 0D);
-        assertEquals("Incorrect double max value",
-                1908897.6000089, Math.max(2.0, 1908897.6000089), 0D);
-        assertEquals("Incorrect double max value", -2.0, Math.max(-2.0,
-                -1908897.6000089), 0D);
-
-    }
-
-    /**
-     * @tests java.lang.Math#max(float, float)
-     */
-    @SmallTest
-    public void testMaxFF() {
-        // Test for method float java.lang.Math.max(float, float)
-        assertTrue("Incorrect float max value", Math.max(-1908897.600f,
-                1908897.600f) == 1908897.600f);
-        assertTrue("Incorrect float max value",
-                Math.max(2.0f, 1908897.600f) == 1908897.600f);
-        assertTrue("Incorrect float max value",
-                Math.max(-2.0f, -1908897.600f) == -2.0f);
-    }
-
-    /**
-     * @tests java.lang.Math#max(int, int)
-     */
-    @SmallTest
-    public void testMaxII() {
-        // Test for method int java.lang.Math.max(int, int)
-        assertEquals("Incorrect int max value",
-                19088976, Math.max(-19088976, 19088976));
-        assertEquals("Incorrect int max value",
-                19088976, Math.max(20, 19088976));
-        assertEquals("Incorrect int max value", -20, Math.max(-20, -19088976));
-    }
-
-    /**
-     * @tests java.lang.Math#max(long, long)
-     */
-    @SmallTest
-    public void testMaxJJ() {
-        // Test for method long java.lang.Math.max(long, long)
-        assertEquals("Incorrect long max value", 19088976000089L, Math.max(-19088976000089L,
-                19088976000089L));
-        assertEquals("Incorrect long max value",
-                19088976000089L, Math.max(20, 19088976000089L));
-        assertEquals("Incorrect long max value",
-                -20, Math.max(-20, -19088976000089L));
-    }
-
-    /**
-     * @tests java.lang.Math#min(double, double)
-     */
-    @SmallTest
-    public void testMinDD() {
-        // Test for method double java.lang.Math.min(double, double)
-        assertEquals("Incorrect double min value", -1908897.6000089, Math.min(-1908897.6000089,
-                1908897.6000089), 0D);
-        assertEquals("Incorrect double min value",
-                2.0, Math.min(2.0, 1908897.6000089), 0D);
-        assertEquals("Incorrect double min value", -1908897.6000089, Math.min(-2.0,
-                -1908897.6000089), 0D);
-    }
-
-    /**
-     * @tests java.lang.Math#min(float, float)
-     */
-    @SmallTest
-    public void testMinFF() {
-        // Test for method float java.lang.Math.min(float, float)
-        assertTrue("Incorrect float min value", Math.min(-1908897.600f,
-                1908897.600f) == -1908897.600f);
-        assertTrue("Incorrect float min value",
-                Math.min(2.0f, 1908897.600f) == 2.0f);
-        assertTrue("Incorrect float min value",
-                Math.min(-2.0f, -1908897.600f) == -1908897.600f);
-    }
-
-    /**
-     * @tests java.lang.Math#min(int, int)
-     */
-    @SmallTest
-    public void testMinII() {
-        // Test for method int java.lang.Math.min(int, int)
-        assertEquals("Incorrect int min value",
-                -19088976, Math.min(-19088976, 19088976));
-        assertEquals("Incorrect int min value", 20, Math.min(20, 19088976));
-        assertEquals("Incorrect int min value",
-                -19088976, Math.min(-20, -19088976));
-
-    }
-
-    /**
-     * @tests java.lang.Math#min(long, long)
-     */
-    @SmallTest
-    public void testMinJJ() {
-        // Test for method long java.lang.Math.min(long, long)
-        assertEquals("Incorrect long min value", -19088976000089L, Math.min(-19088976000089L,
-                19088976000089L));
-        assertEquals("Incorrect long min value",
-                20, Math.min(20, 19088976000089L));
-        assertEquals("Incorrect long min value",
-                -19088976000089L, Math.min(-20, -19088976000089L));
-    }
-
-    /**
-     * @tests java.lang.Math#pow(double, double)
-     */
-    @SmallTest
-    public void testPowDD() {
-        // Test for method double java.lang.Math.pow(double, double)
-        assertTrue("pow returned incorrect value",
-                (long) Math.pow(2, 8) == 256l);
-        assertTrue("pow returned incorrect value",
-                Math.pow(2, -8) == 0.00390625d);
-        assertEquals("Incorrect root returned1",
-                             2, Math.sqrt(Math.pow(Math.sqrt(2), 4)), 0);
-    }
-
-    /**
-     * @tests java.lang.Math#rint(double)
-     */
-    @SmallTest
-    public void testRintD() {
-        // Test for method double java.lang.Math.rint(double)
-        assertEquals("Failed to round properly - up to odd",
-                3.0, Math.rint(2.9), 0D);
-        assertTrue("Failed to round properly - NaN", Double.isNaN(Math
-                .rint(Double.NaN)));
-        assertEquals("Failed to round properly down  to even",
-                2.0, Math.rint(2.1), 0D);
-        assertTrue("Failed to round properly " + 2.5 + " to even", Math
-                .rint(2.5) == 2.0);
-    }
-
-    /**
-     * @tests java.lang.Math#round(double)
-     */
-    @SmallTest
-    public void testRoundD() {
-        // Test for method long java.lang.Math.round(double)
-        assertEquals("Incorrect rounding of a float", -91, Math.round(-90.89d));
-    }
-
-    /**
-     * @tests java.lang.Math#round(float)
-     */
-    @SmallTest
-    public void testRoundF() {
-        // Test for method int java.lang.Math.round(float)
-        assertEquals("Incorrect rounding of a float", -91, Math.round(-90.89f));
-    }
-    
-    /**
-     * @tests java.lang.Math#signum(double)
-     */
-    @SmallTest
-    public void testSignumD() {
-        assertTrue(Double.isNaN(Math.signum(Double.NaN)));
-        assertTrue(Double.isNaN(Math.signum(Double.NaN)));
-        assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
-                .signum(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(Math.signum(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(Math.signum(-0.0)));
-
-        assertEquals(1.0, Math.signum(253681.2187962), 0D);
-        assertEquals(-1.0, Math.signum(-125874693.56), 0D);
-        assertEquals(1.0, Math.signum(1.2587E-308), 0D);
-        assertEquals(-1.0, Math.signum(-1.2587E-308), 0D);
-
-        assertEquals(1.0, Math.signum(Double.MAX_VALUE), 0D);
-        assertEquals(1.0, Math.signum(Double.MIN_VALUE), 0D);
-        assertEquals(-1.0, Math.signum(-Double.MAX_VALUE), 0D);
-        assertEquals(-1.0, Math.signum(-Double.MIN_VALUE), 0D);
-        assertEquals(1.0, Math.signum(Double.POSITIVE_INFINITY), 0D);
-        assertEquals(-1.0, Math.signum(Double.NEGATIVE_INFINITY), 0D);
-    }
-
-    /**
-     * @tests java.lang.Math#signum(float)
-     */
-    @SmallTest
-    public void testSignumF() {
-        assertTrue(Float.isNaN(Math.signum(Float.NaN)));
-        assertEquals(Float.floatToIntBits(0.0f), Float
-                .floatToIntBits(Math.signum(0.0f)));
-        assertEquals(Float.floatToIntBits(+0.0f), Float
-                .floatToIntBits(Math.signum(+0.0f)));
-        assertEquals(Float.floatToIntBits(-0.0f), Float
-                .floatToIntBits(Math.signum(-0.0f)));
-
-        assertEquals(1.0f, Math.signum(253681.2187962f), 0f);
-        assertEquals(-1.0f, Math.signum(-125874693.56f), 0f);
-        assertEquals(1.0f, Math.signum(1.2587E-11f), 0f);
-        assertEquals(-1.0f, Math.signum(-1.2587E-11f), 0f);
-
-        assertEquals(1.0f, Math.signum(Float.MAX_VALUE), 0f);
-        assertEquals(1.0f, Math.signum(Float.MIN_VALUE), 0f);
-        assertEquals(-1.0f, Math.signum(-Float.MAX_VALUE), 0f);
-        assertEquals(-1.0f, Math.signum(-Float.MIN_VALUE), 0f);
-        assertEquals(1.0f, Math.signum(Float.POSITIVE_INFINITY), 0f);
-        assertEquals(-1.0f, Math.signum(Float.NEGATIVE_INFINITY), 0f);
-    }
-
-    /**
-     * @tests java.lang.Math#sin(double)
-     */
-    @SmallTest
-    public void testSinD() {
-        // Test for method double java.lang.Math.sin(double)
-        assertEquals("Incorrect answer", 0.0, Math.sin(0), 0D);
-        assertEquals("Incorrect answer", 0.8414709848078965, Math.sin(1), 0D);
-    }
-    
-    /**
-     * @tests java.lang.Math#sinh(double)
-     */
-    @SmallTest
-    public void testSinhD() {
-        // Test for special situations
-        assertTrue("Should return NaN", Double.isNaN(Math.sinh(Double.NaN)));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.sinh(Double.POSITIVE_INFINITY), 0D);
-        assertEquals("Should return NEGATIVE_INFINITY",
-                Double.NEGATIVE_INFINITY, Math.sinh(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
-                .sinh(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(Math.sinh(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(Math.sinh(-0.0)));
-
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.sinh(1234.56), 0D);
-        assertEquals("Should return NEGATIVE_INFINITY",
-                Double.NEGATIVE_INFINITY, Math.sinh(-1234.56), 0D);
-        assertEquals("Should return 1.0000000000001666E-6",
-                1.0000000000001666E-6, Math.sinh(0.000001), 0D);
-        assertEquals("Should return -1.0000000000001666E-6",
-                -1.0000000000001666E-6, Math.sinh(-0.000001), 0D);
-        assertEquals("Should return 5.115386441963859", 5.115386441963859, Math
-                .sinh(2.33482), 0D);
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, Math.sinh(Double.MAX_VALUE), 0D);
-        assertEquals("Should return 4.9E-324", 4.9E-324, Math
-                .sinh(Double.MIN_VALUE), 0D);
-    }
-    
-    /**
-     * @tests java.lang.Math#sqrt(double)
-     */
-    @SmallTest
-    public void testSqrtD() {
-        // Test for method double java.lang.Math.sqrt(double)
-                assertEquals("Incorrect root returned2", 7, Math.sqrt(49), 0);
-    }
-
-    /**
-     * @tests java.lang.Math#tan(double)
-     */
-    @SmallTest
-    public void testTanD() {
-        // Test for method double java.lang.Math.tan(double)
-        assertEquals("Incorrect answer", 0.0, Math.tan(0), 0D);
-        assertEquals("Incorrect answer", 1.5574077246549023, Math.tan(1), 0D);
-
-    }
-
-    /**
-     * @tests java.lang.Math#tanh(double)
-     */
-    @SmallTest
-    public void testTanhD() {
-        // Test for special situations
-        assertTrue("Should return NaN", Double.isNaN(Math.tanh(Double.NaN)));
-        assertEquals("Should return +1.0", +1.0, Math
-                .tanh(Double.POSITIVE_INFINITY), 0D);
-        assertEquals("Should return -1.0", -1.0, Math
-                .tanh(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals(Double.doubleToLongBits(0.0), Double.doubleToLongBits(Math
-                .tanh(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(Math.tanh(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(Math.tanh(-0.0)));
-
-        assertEquals("Should return 1.0", 1.0, Math.tanh(1234.56), 0D);
-        assertEquals("Should return -1.0", -1.0, Math.tanh(-1234.56), 0D);
-        assertEquals("Should return 9.999999999996666E-7",
-                9.999999999996666E-7, Math.tanh(0.000001), 0D);
-        assertEquals("Should return 0.981422884124941", 0.981422884124941, Math
-                .tanh(2.33482), 0D);
-        assertEquals("Should return 1.0", 1.0, Math.tanh(Double.MAX_VALUE), 0D);
-        assertEquals("Should return 4.9E-324", 4.9E-324, Math
-                .tanh(Double.MIN_VALUE), 0D);
-    }
-    
-    /**
-     * @tests java.lang.Math#random()
-     */
-    @MediumTest
-    public void testRandom() {
-        // There isn't a place for these tests so just stick them here
-        assertEquals("Wrong value E",
-                4613303445314885481L, Double.doubleToLongBits(Math.E));
-        assertEquals("Wrong value PI",
-                4614256656552045848L, Double.doubleToLongBits(Math.PI));
-
-        for (int i = 500; i >= 0; i--) {
-            double d = Math.random();
-            assertTrue("Generated number is out of range: " + d, d >= 0.0
-                    && d < 1.0);
-        }
-    }
-
-    /**
-     * @tests java.lang.Math#toRadians(double)
-     */
-    @MediumTest
-    public void testToRadiansD() {
-        for (double d = 500; d >= 0; d -= 1.0) {
-            double converted = Math.toDegrees(Math.toRadians(d));
-            assertTrue("Converted number not equal to original. d = " + d,
-                    converted >= d * 0.99999999 && converted <= d * 1.00000001);
-        }
-    }
-
-    /**
-     * @tests java.lang.Math#toDegrees(double)
-     */
-    @MediumTest
-    public void testToDegreesD() {
-        for (double d = 500; d >= 0; d -= 1.0) {
-            double converted = Math.toRadians(Math.toDegrees(d));
-            assertTrue("Converted number not equal to original. d = " + d,
-                    converted >= d * 0.99999999 && converted <= d * 1.00000001);
-        }
-    }
-    
-    /**
-     * @tests java.lang.Math#ulp(double)
-     */
-    @SuppressWarnings("boxing")
-    @SmallTest
-    public void testUlpD() {
-        // Test for special cases
-        assertTrue("Should return NaN", Double.isNaN(Math.ulp(Double.NaN)));
-        assertEquals("Returned incorrect value", Double.POSITIVE_INFINITY, Math
-                .ulp(Double.POSITIVE_INFINITY), 0D);
-        assertEquals("Returned incorrect value", Double.POSITIVE_INFINITY, Math
-                .ulp(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
-                .ulp(0.0), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
-                .ulp(+0.0), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
-                .ulp(-0.0), 0D);
-        assertEquals("Returned incorrect value", Math.pow(2, 971), Math
-                .ulp(Double.MAX_VALUE), 0D);
-        assertEquals("Returned incorrect value", Math.pow(2, 971), Math
-                .ulp(-Double.MAX_VALUE), 0D);
-
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
-                .ulp(Double.MIN_VALUE), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, Math
-                .ulp(-Double.MIN_VALUE), 0D);
-
-        assertEquals("Returned incorrect value", 2.220446049250313E-16, Math
-                .ulp(1.0), 0D);
-        assertEquals("Returned incorrect value", 2.220446049250313E-16, Math
-                .ulp(-1.0), 0D);
-        assertEquals("Returned incorrect value", 2.2737367544323206E-13, Math
-                .ulp(1153.0), 0D);
-    }
-
-    /**
-     * @tests java.lang.Math#ulp(float)
-     */
-    @SuppressWarnings("boxing")
-    @SmallTest
-    public void testUlpf() {
-        // Test for special cases
-        assertTrue("Should return NaN", Float.isNaN(Math.ulp(Float.NaN)));
-        assertEquals("Returned incorrect value", Float.POSITIVE_INFINITY, Math
-                .ulp(Float.POSITIVE_INFINITY), 0f);
-        assertEquals("Returned incorrect value", Float.POSITIVE_INFINITY, Math
-                .ulp(Float.NEGATIVE_INFINITY), 0f);
-        assertEquals("Returned incorrect value", Float.MIN_VALUE, Math
-                .ulp(0.0f), 0f);
-        assertEquals("Returned incorrect value", Float.MIN_VALUE, Math
-                .ulp(+0.0f), 0f);
-        assertEquals("Returned incorrect value", Float.MIN_VALUE, Math
-                .ulp(-0.0f), 0f);
-        assertEquals("Returned incorrect value", 2.028241E31f, Math
-                .ulp(Float.MAX_VALUE), 0f);
-        assertEquals("Returned incorrect value", 2.028241E31f, Math
-                .ulp(-Float.MAX_VALUE), 0f);
-
-        assertEquals("Returned incorrect value", 1.4E-45f, Math
-                .ulp(Float.MIN_VALUE), 0f);
-        assertEquals("Returned incorrect value", 1.4E-45f, Math
-                .ulp(-Float.MIN_VALUE), 0f);
-
-        assertEquals("Returned incorrect value", 1.1920929E-7f, Math.ulp(1.0f),
-                0f);
-        assertEquals("Returned incorrect value", 1.1920929E-7f,
-                Math.ulp(-1.0f), 0f);
-        assertEquals("Returned incorrect value", 1.2207031E-4f, Math
-                .ulp(1153.0f), 0f);
-        assertEquals("Returned incorrect value", 5.6E-45f, Math
-                .ulp(9.403954E-38f), 0f);
-    }
-}
diff --git a/tests/CoreTests/android/core/MonitorTest.java b/tests/CoreTests/android/core/MonitorTest.java
deleted file mode 100644
index 73c33db..0000000
--- a/tests/CoreTests/android/core/MonitorTest.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-import android.test.suitebuilder.annotation.MediumTest;
-import android.test.suitebuilder.annotation.LargeTest;
-import android.test.suitebuilder.annotation.SmallTest;
-
-public class MonitorTest extends TestCase {
-
-    @MediumTest
-    public void testWaitArgumentsTest() throws Exception {
-            /* Try some valid arguments.  These should all
-             * return very quickly.
-             */
-            try {
-                synchronized (this) {
-                    /* millisecond version */
-                    wait(1);
-                    wait(10);
-
-                    /* millisecond + nanosecond version */
-                    wait(0, 1);
-                    wait(0, 999999);
-                    wait(1, 1);
-                    wait(1, 999999);
-                }
-            } catch (InterruptedException ex) {
-                throw new RuntimeException("good Object.wait() interrupted",
-                        ex);
-            } catch (Exception ex) {
-                throw new RuntimeException("Unexpected exception when calling" +
-                        "Object.wait() with good arguments", ex);
-            }
-
-            /* Try some invalid arguments.
-             */
-            boolean sawException = false;
-            try {
-                synchronized (this) {
-                    wait(-1);
-                }
-            } catch (InterruptedException ex) {
-                throw new RuntimeException("bad Object.wait() interrupted", ex);
-            } catch (IllegalArgumentException ex) {
-                sawException = true;
-            } catch (Exception ex) {
-                throw new RuntimeException("Unexpected exception when calling" +
-                        "Object.wait() with bad arguments", ex);
-            }
-            if (!sawException) {
-                throw new RuntimeException("bad call to Object.wait() should " +
-                        "have thrown IllegalArgumentException");
-            }
-
-            sawException = false;
-            try {
-                synchronized (this) {
-                    wait(0, -1);
-                }
-            } catch (InterruptedException ex) {
-                throw new RuntimeException("bad Object.wait() interrupted", ex);
-            } catch (IllegalArgumentException ex) {
-                sawException = true;
-            } catch (Exception ex) {
-                throw new RuntimeException("Unexpected exception when calling" +
-                        "Object.wait() with bad arguments", ex);
-            }
-            if (!sawException) {
-                throw new RuntimeException("bad call to Object.wait() should " +
-                        "have thrown IllegalArgumentException");
-            }
-
-            sawException = false;
-            try {
-                synchronized (this) {
-                    /* The legal range of nanos is 0-999999. */
-                    wait(0, 1000000);
-                }
-            } catch (InterruptedException ex) {
-                throw new RuntimeException("bad Object.wait() interrupted", ex);
-            } catch (IllegalArgumentException ex) {
-                sawException = true;
-            } catch (Exception ex) {
-                throw new RuntimeException("Unexpected exception when calling" +
-                        "Object.wait() with bad arguments", ex);
-            }
-            if (!sawException) {
-                throw new RuntimeException("bad call to Object.wait() should " +
-                        "have thrown IllegalArgumentException");
-            }
-    }
-
-    private class Interrupter extends Thread {
-            Waiter waiter;
-
-            Interrupter(String name, Waiter waiter) {
-                super(name);
-                this.waiter = waiter;
-            }
-
-            public void run() {
-                try {
-                    run_inner();
-                } catch (Throwable t) {
-                    MonitorTest.errorException = t;
-                    MonitorTest.testThread.interrupt();
-                }
-            }
-
-            void run_inner() {
-                waiter.spin = true;
-                // System.out.println("InterruptTest: starting waiter");
-                waiter.start();
-
-                try {
-                    Thread.currentThread().sleep(500);
-                } catch (InterruptedException ex) {
-                    throw new RuntimeException("Test sleep interrupted.", ex);
-                }
-
-                /* Waiter is spinning, and its monitor should still be thin.
-                 */
-                // System.out.println("Test interrupting waiter");
-                waiter.interrupt();
-                waiter.spin = false;
-
-                for (int i = 0; i < 3; i++) {
-                    /* Wait for the waiter to start waiting.
-                     */
-                    synchronized (waiter.interrupterLock) {
-                        try {
-                            waiter.interrupterLock.wait();
-                        } catch (InterruptedException ex) {
-                            throw new RuntimeException("Test wait interrupted.", ex);
-                        }
-                    }
-
-                    /* Before interrupting, grab the waiter lock, which
-                     * guarantees that the waiter is already sitting in wait().
-                     */
-                    synchronized (waiter) {
-                        //System.out.println("Test interrupting waiter (" + i + ")");
-                        waiter.interrupt();
-                    }
-                }
-
-                // System.out.println("Test waiting for waiter to die.");
-                try {
-                    waiter.join();
-                } catch (InterruptedException ex) {
-                    throw new RuntimeException("Test join interrupted.", ex);
-                }
-                // System.out.println("InterruptTest done.");
-            }
-        }
-
-    private class Waiter extends Thread {
-            Object interrupterLock = new Object();
-            Boolean spin = false;
-
-            Waiter(String name) {
-                super(name);
-            }
-
-            public void run() {
-                try {
-                    run_inner();
-                } catch (Throwable t) {
-                    MonitorTest.errorException = t;
-                    MonitorTest.testThread.interrupt();
-                }
-            }
-
-            void run_inner() {
-                // System.out.println("Waiter spinning");
-                while (spin) {
-                    // We're going to get interrupted while we spin.
-                }
-                if (interrupted()) {
-                    // System.out.println("Waiter done spinning; interrupted.");
-                } else {
-                    throw new RuntimeException("Thread not interrupted " +
-                                               "during spin");
-                }
-
-                synchronized (this) {
-                    Boolean sawEx = false;
-
-                    try {
-                        synchronized (interrupterLock) {
-                            interrupterLock.notify();
-                        }
-                        // System.out.println("Waiter calling wait()");
-                        this.wait();
-                    } catch (InterruptedException ex) {
-                        sawEx = true;
-                        // System.out.println("wait(): Waiter caught " + ex);
-                    }
-                    // System.out.println("wait() finished");
-
-                    if (!sawEx) {
-                        throw new RuntimeException("Thread not interrupted " +
-                                                   "during wait()");
-                    }
-                }
-                synchronized (this) {
-                    Boolean sawEx = false;
-
-                    try {
-                        synchronized (interrupterLock) {
-                            interrupterLock.notify();
-                        }
-                        // System.out.println("Waiter calling wait(1000)");
-                        this.wait(1000);
-                    } catch (InterruptedException ex) {
-                        sawEx = true;
-                        // System.out.println("wait(1000): Waiter caught " + ex);
-                    }
-                    // System.out.println("wait(1000) finished");
-
-                    if (!sawEx) {
-                        throw new RuntimeException("Thread not interrupted " +
-                                                   "during wait(1000)");
-                    }
-                }
-                synchronized (this) {
-                    Boolean sawEx = false;
-
-                    try {
-                        synchronized (interrupterLock) {
-                            interrupterLock.notify();
-                        }
-                        // System.out.println("Waiter calling wait(1000, 5000)");
-                        this.wait(1000, 5000);
-                    } catch (InterruptedException ex) {
-                        sawEx = true;
-                        // System.out.println("wait(1000, 5000): Waiter caught " + ex);
-                    }
-                    // System.out.println("wait(1000, 5000) finished");
-
-                    if (!sawEx) {
-                        throw new RuntimeException("Thread not interrupted " +
-                                                   "during wait(1000, 5000)");
-                    }
-                }
-
-               //  System.out.println("Waiter returning");
-            }
-        }
-
-    private static Throwable errorException;
-    private static Thread testThread;
-
-    // TODO: Flaky test. Add back MediumTest annotation once fixed
-    public void testInterruptTest() throws Exception {
-
-
-            testThread = Thread.currentThread();
-            errorException = null;
-
-            Waiter waiter = new Waiter("InterruptTest Waiter");
-            Interrupter interrupter =
-                    new Interrupter("InterruptTest Interrupter", waiter);
-            interrupter.start();
-
-            try {
-                interrupter.join();
-                waiter.join();
-            } catch (InterruptedException ex) {
-                throw new RuntimeException("Test join interrupted.", ex);
-            }
-
-            if (errorException != null) {
-                throw new RuntimeException("InterruptTest failed",
-                                           errorException);
-            }
-
-
-
-
-    }
-
-     private static void deepWait(int depth, Object lock) {
-            synchronized (lock) {
-                if (depth > 0) {
-                    deepWait(depth - 1, lock);
-                } else {
-                    String threadName = Thread.currentThread().getName();
-                    try {
-                        // System.out.println(threadName + " waiting");
-                        lock.wait();
-                        // System.out.println(threadName + " done waiting");
-                    } catch (InterruptedException ex) {
-                        // System.out.println(threadName + " interrupted.");
-                    }
-                }
-            }
-        }
-
-        private class Worker extends Thread {
-            Object lock;
-            int id;
-
-            Worker(int id, Object lock) {
-                super("Worker(" + id + ")");
-                this.id = id;
-                this.lock = lock;
-            }
-
-            public void run() {
-                int iterations = 0;
-
-                while (MonitorTest.running) {
-                    MonitorTest.deepWait(id, lock);
-                    iterations++;
-                }
-                // System.out.println(getName() + " done after " + iterations + " iterations.");
-            }
-        }
-
-    private static Object commonLock = new Object();
-        private static Boolean running = false;
-
-
-    @LargeTest
-    public void testNestedMonitors() throws Exception {
-        final int NUM_WORKERS = 5;
-
-            Worker w[] = new Worker[NUM_WORKERS];
-            int i;
-
-            for (i = 0; i < NUM_WORKERS; i++) {
-                w[i] = new Worker(i * 2 - 1, new Object());
-            }
-
-            running = true;
-
-            // System.out.println("NestedMonitors: starting workers");
-            for (i = 0; i < NUM_WORKERS; i++) {
-                w[i].start();
-            }
-
-            try {
-                Thread.currentThread().sleep(1000);
-            } catch (InterruptedException ex) {
-               // System.out.println("Test sleep interrupted.");
-            }
-
-            for (i = 0; i < 100; i++) {
-                for (int j = 0; j < NUM_WORKERS; j++) {
-                    synchronized (w[j].lock) {
-                        w[j].lock.notify();
-                    }
-                }
-            }
-
-            // System.out.println("NesterMonitors: stopping workers");
-            running = false;
-            for (i = 0; i < NUM_WORKERS; i++) {
-                synchronized (w[i].lock) {
-                    w[i].lock.notifyAll();
-                }
-            }
-    }
-
-    private static class CompareAndExchange extends Thread {
-        static Object toggleLock = null;
-        static int toggle = -1;
-        static Boolean running = false;
-
-        public void run() {
-            toggleLock = new Object();
-            toggle = -1;
-
-            Worker w1 = new Worker(0, 1);
-            Worker w2 = new Worker(2, 3);
-            Worker w3 = new Worker(4, 5);
-            Worker w4 = new Worker(6, 7);
-
-            running = true;
-
-            // System.out.println("CompareAndExchange: starting workers");
-
-            w1.start();
-            w2.start();
-            w3.start();
-            w4.start();
-
-            try {
-                this.sleep(10000);
-            } catch (InterruptedException ex) {
-                // System.out.println(getName() + " interrupted.");
-            }
-
-            // System.out.println("MonitorTest: stopping workers");
-            running = false;
-
-            toggleLock = null;
-        }
-
-        class Worker extends Thread {
-            int i1;
-            int i2;
-
-            Worker(int i1, int i2) {
-                super("Worker(" + i1 + ", " + i2 + ")");
-                this.i1 = i1;
-                this.i2 = i2;
-            }
-
-            public void run() {
-                int iterations = 0;
-
-                /* Latch this because run() may set the static field to
-                 * null at some point.
-                 */
-                Object toggleLock = CompareAndExchange.toggleLock;
-
-                // System.out.println(getName() + " running");
-                try {
-                    while (CompareAndExchange.running) {
-                        synchronized (toggleLock) {
-                            int test;
-                            int check;
-
-                            if (CompareAndExchange.toggle == i1) {
-                                this.sleep(5 + i2);
-                                CompareAndExchange.toggle = test = i2;
-                            } else {
-                                this.sleep(5 + i1);
-                                CompareAndExchange.toggle = test = i1;
-                            }
-                            if ((check = CompareAndExchange.toggle) != test) {
-//                                System.out.println("Worker(" + i1 + ", " +
-//                                                   i2 + ") " + "test " + test +
-//                                                   " != toggle " + check);
-                                throw new RuntimeException(
-                                        "locked value changed");
-                            }
-                        }
-
-                        iterations++;
-                    }
-                } catch (InterruptedException ex) {
-                   // System.out.println(getName() + " interrupted.");
-                }
-
-//                System.out.println(getName() + " done after " +
-//                                   iterations + " iterations.");
-            }
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/NIOTest.java b/tests/CoreTests/android/core/NIOTest.java
deleted file mode 100644
index 9476d07..0000000
--- a/tests/CoreTests/android/core/NIOTest.java
+++ /dev/null
@@ -1,707 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.nio.Buffer;
-import java.nio.BufferOverflowException;
-import java.nio.BufferUnderflowException;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.nio.ShortBuffer;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Tests for some buffers from the java.nio package.
- */
-public class NIOTest extends TestCase {
-
-    void checkBuffer(Buffer b) {
-        assertTrue(0 <= b.position());
-        assertTrue(b.position() <= b.limit());
-        assertTrue(b.limit() <= b.capacity());
-    }
-
-    @SmallTest
-    public void testNIO_byte_array() throws Exception {
-        // Test byte array-based buffer
-        byteBufferTest(ByteBuffer.allocate(12));
-    }
-
-    public void testNIO_direct() throws Exception {
-        // Test native heap-allocated buffer
-        byteBufferTest(ByteBuffer.allocateDirect(12));
-    }
-
-    public void testNIO_short_array() throws Exception {
-        // Test short array-based buffer
-        short[] shortArray = new short[8];
-        ShortBuffer sb = ShortBuffer.wrap(shortArray);
-        shortBufferTest(sb);
-    }
-
-    public void testNIO_int_array() throws Exception {
-        // Test int array-based buffer
-        int[] intArray = new int[8];
-        IntBuffer ib = IntBuffer.wrap(intArray);
-        intBufferTest(ib);
-    }
-
-    public void testNIO_float_array() throws Exception {
-        // Test float array-based buffer
-        float[] floatArray = new float[8];
-        FloatBuffer fb = FloatBuffer.wrap(floatArray);
-        floatBufferTest(fb);
-    }
-
-    private void byteBufferTest(ByteBuffer b) {
-        checkBuffer(b);
-
-        // Duplicate buffers revert to big-endian.
-        b.order(ByteOrder.LITTLE_ENDIAN);
-        ByteBuffer dupe = b.duplicate();
-        assertEquals(ByteOrder.BIG_ENDIAN, dupe.order());
-        b.order(ByteOrder.BIG_ENDIAN);
-
-        // Bounds checks
-        try {
-            b.put(-1, (byte) 0);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        try {
-            b.put(b.limit(), (byte) 0);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        // IndexOutOfBoundsException: offset < 0
-        try {
-            byte[] data = new byte[8];
-            b.position(0);
-            b.put(data, -1, 2);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        // IndexOutOfBoundsException: length > array.length - offset
-        try {
-            byte[] data = new byte[8];
-            b.position(0);
-            b.put(data, 1, 8);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        // BufferOverflowException: length > remaining()
-        try {
-            byte[] data = new byte[8];
-            b.position(b.limit() - 2);
-            b.put(data, 0, 3);
-            fail("expected exception not thrown");
-        } catch (BufferOverflowException e) {
-            // expected
-        }
-
-        // Fill buffer with bytes A0 A1 A2 A3 ...
-        b.position(0);
-        for (int i = 0; i < b.capacity(); i++) {
-            b.put((byte) (0xA0 + i));
-        }
-        try {
-            b.put((byte) 0xFF);
-            fail("expected exception not thrown");
-        } catch (BufferOverflowException e) {
-            // expected
-        }
-
-        b.position(0);
-        assertEquals((byte) 0xA7, b.get(7));
-        try {
-            b.get(12);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-        try {
-            b.get(-10);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        b.position(0);
-        b.order(ByteOrder.LITTLE_ENDIAN);
-        assertEquals((byte) 0xA0, b.get());
-        assertEquals((byte) 0xA1, b.get());
-        assertEquals((byte) 0xA2, b.get());
-        assertEquals((byte) 0xA3, b.get());
-        assertEquals((byte) 0xA4, b.get());
-        assertEquals((byte) 0xA5, b.get());
-        assertEquals((byte) 0xA6, b.get());
-        assertEquals((byte) 0xA7, b.get());
-        assertEquals((byte) 0xA8, b.get());
-        assertEquals((byte) 0xA9, b.get());
-        assertEquals((byte) 0xAA, b.get());
-        assertEquals((byte) 0xAB, b.get());
-        try {
-            b.get();
-            fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-
-        b.position(0);
-        b.order(ByteOrder.BIG_ENDIAN);
-        assertEquals((byte) 0xA0, b.get());
-        assertEquals((byte) 0xA1, b.get());
-        assertEquals((byte) 0xA2, b.get());
-        assertEquals((byte) 0xA3, b.get());
-        assertEquals((byte) 0xA4, b.get());
-        assertEquals((byte) 0xA5, b.get());
-        assertEquals((byte) 0xA6, b.get());
-        assertEquals((byte) 0xA7, b.get());
-        assertEquals((byte) 0xA8, b.get());
-        assertEquals((byte) 0xA9, b.get());
-        assertEquals((byte) 0xAA, b.get());
-        assertEquals((byte) 0xAB, b.get());
-        try {
-            b.get();
-            fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-
-        b.position(6);
-        b.limit(10);
-        assertEquals((byte) 0xA6, b.get());
-
-        // Check sliced buffer
-        b.position(6);
-
-        ByteBuffer bb = b.slice();
-        checkBuffer(bb);
-
-        assertEquals(0, bb.position());
-        assertEquals(4, bb.limit());
-        assertEquals(4, bb.capacity());
-
-        assertEquals((byte) 0xA6, bb.get());
-        assertEquals((byte) 0xA7, bb.get());
-        assertEquals((byte) 0xA8, bb.get());
-        assertEquals((byte) 0xA9, bb.get());
-        try {
-            bb.get();
-            fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-
-        // Reset position and limit
-        b.position(0);
-        b.limit(b.capacity());
-
-        // Check 'getShort'
-        b.order(ByteOrder.LITTLE_ENDIAN);
-        b.position(0);
-        assertEquals((short) 0xA1A0, b.getShort());
-        assertEquals((short) 0xA3A2, b.getShort());
-        assertEquals((short) 0xA5A4, b.getShort());
-        assertEquals((short) 0xA7A6, b.getShort());
-        assertEquals((short) 0xA9A8, b.getShort());
-        assertEquals((short) 0xABAA, b.getShort());
-        try {
-            bb.getShort();
-            fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-
-        b.order(ByteOrder.BIG_ENDIAN);
-        b.position(0);
-        assertEquals((short) 0xA0A1, b.getShort());
-        assertEquals((short) 0xA2A3, b.getShort());
-        assertEquals((short) 0xA4A5, b.getShort());
-        assertEquals((short) 0xA6A7, b.getShort());
-        assertEquals((short) 0xA8A9, b.getShort());
-        assertEquals((short) 0xAAAB, b.getShort());
-        try {
-            bb.getShort();
-           fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-
-        // Check 'getInt'
-        b.order(ByteOrder.LITTLE_ENDIAN);
-        b.position(0);
-        assertEquals(0xA3A2A1A0, b.getInt());
-        assertEquals(0xA7A6A5A4, b.getInt());
-        assertEquals(0xABAAA9A8, b.getInt());
-        try {
-            bb.getInt();
-            fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-
-        b.order(ByteOrder.BIG_ENDIAN);
-        b.position(0);
-        assertEquals(0xA0A1A2A3, b.getInt());
-        assertEquals(0xA4A5A6A7, b.getInt());
-        assertEquals(0xA8A9AAAB, b.getInt());
-        try {
-            bb.getInt();
-            fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-
-        // Check 'getFloat'
-        b.order(ByteOrder.LITTLE_ENDIAN);
-        b.position(0);
-        assertEquals(0xA3A2A1A0, Float.floatToRawIntBits(b.getFloat()));
-        assertEquals(0xA7A6A5A4, Float.floatToRawIntBits(b.getFloat()));
-        assertEquals(0xABAAA9A8, Float.floatToRawIntBits(b.getFloat()));
-        try {
-            b.getFloat();
-            fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-
-        b.order(ByteOrder.BIG_ENDIAN);
-        b.position(0);
-        assertEquals(0xA0A1A2A3, Float.floatToRawIntBits(b.getFloat()));
-        assertEquals(0xA4A5A6A7, Float.floatToRawIntBits(b.getFloat()));
-        assertEquals(0xA8A9AAAB, Float.floatToRawIntBits(b.getFloat()));
-        try {
-            b.getFloat();
-            fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-
-        // Check 'getDouble(int position)'
-        b.order(ByteOrder.LITTLE_ENDIAN);
-        assertEquals(0xA7A6A5A4A3A2A1A0L, Double.doubleToRawLongBits(b.getDouble(0)));
-        assertEquals(0xA8A7A6A5A4A3A2A1L, Double.doubleToRawLongBits(b.getDouble(1)));
-        try {
-            b.getDouble(-1);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-        try {
-            b.getDouble(5);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        b.order(ByteOrder.BIG_ENDIAN);
-        assertEquals(0xA0A1A2A3A4A5A6A7L, Double.doubleToRawLongBits(b.getDouble(0)));
-        assertEquals(0xA1A2A3A4A5A6A7A8L, Double.doubleToRawLongBits(b.getDouble(1)));
-        try {
-            b.getDouble(-1);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-        try {
-            b.getDouble(5);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        // Slice and check 'getInt'
-        b.position(1);
-        b.limit(5);
-        b.order(ByteOrder.LITTLE_ENDIAN);
-        bb = b.slice();
-        assertEquals(4, bb.capacity());
-        assertEquals(ByteOrder.BIG_ENDIAN, bb.order());
-        assertEquals(0xA1A2A3A4, bb.getInt(0));
-        bb.order(ByteOrder.LITTLE_ENDIAN);
-        assertEquals(0xA4A3A2A1, bb.getInt(0));
-
-        bb.order(ByteOrder.LITTLE_ENDIAN);
-        ShortBuffer sb = bb.asShortBuffer();
-
-        checkBuffer(sb);
-        assertEquals(2, sb.capacity());
-        assertEquals((short) 0xA2A1, sb.get());
-        assertEquals((short) 0xA4A3, sb.get());
-
-        bb.order(ByteOrder.BIG_ENDIAN);
-        sb = bb.asShortBuffer();
-
-        checkBuffer(sb);
-        assertEquals(2, sb.capacity());
-        assertEquals((short) 0xA1A2, sb.get());
-        assertEquals((short) 0xA3A4, sb.get());
-
-        bb.order(ByteOrder.LITTLE_ENDIAN);
-        IntBuffer ib = bb.asIntBuffer();
-
-        checkBuffer(ib);
-        assertEquals(1, ib.capacity());
-        assertEquals(0xA4A3A2A1, ib.get());
-
-        bb.order(ByteOrder.BIG_ENDIAN);
-        ib = bb.asIntBuffer();
-
-        checkBuffer(ib);
-        assertEquals(1, ib.capacity());
-        assertEquals(0xA1A2A3A4, ib.get());
-
-        bb.order(ByteOrder.LITTLE_ENDIAN);
-        FloatBuffer fb = bb.asFloatBuffer();
-
-        checkBuffer(fb);
-        assertEquals(1, fb.capacity());
-        assertEquals(0xA4A3A2A1, Float.floatToRawIntBits(fb.get()));
-
-        bb.order(ByteOrder.BIG_ENDIAN);
-        fb = bb.asFloatBuffer();
-
-        checkBuffer(fb);
-        assertEquals(1, fb.capacity());
-        assertEquals(0xA1A2A3A4, Float.floatToRawIntBits(fb.get()));
-    }
-
-    private void shortBufferTest(ShortBuffer sb) {
-        checkBuffer(sb);
-
-        try {
-            sb.put(-1, (short) 0);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        try {
-            sb.put(sb.limit(), (short) 0);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        // IndexOutOfBoundsException: offset < 0
-        try {
-            short[] data = new short[8];
-            sb.position(0);
-            sb.put(data, -1, 2);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        // IndexOutOfBoundsException: length > array.length - offset
-        try {
-            short[] data = new short[8];
-            sb.position(0);
-            sb.put(data, 1, 8);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        // BufferOverflowException: length > remaining()
-        try {
-            short[] data = new short[8];
-            sb.position(sb.limit() - 2);
-            sb.put(data, 0, 3);
-            fail("expected exception not thrown");
-        } catch (BufferOverflowException e) {
-            // expected
-        }
-
-        short[] data = {0, 10, 20, 30, 40, 50, 60, 70};
-        sb.position(0);
-        sb.put(data);
-
-        try {
-            sb.get();
-            fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-
-        sb.position(0);
-        assertEquals((short) 0, sb.get());
-        assertEquals((short) 10, sb.get());
-        assertEquals((short) 20, sb.get());
-        assertEquals((short) 30, sb.get());
-        assertEquals((short) 40, sb.get());
-        assertEquals((short) 50, sb.get());
-        assertEquals((short) 60, sb.get());
-        assertEquals((short) 70, sb.get());
-        try {
-            sb.get();
-            fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-        sb.position(1);
-        sb.put((short) 11);
-        assertEquals((short) 11, sb.get(1));
-
-        short[] ss1 = {33, 44, 55, 66};
-        sb.position(3);
-        sb.put(ss1);
-        sb.position(0);
-        assertEquals((short) 0, sb.get());
-        assertEquals((short) 11, sb.get());
-        assertEquals((short) 20, sb.get());
-        assertEquals((short) 33, sb.get());
-        assertEquals((short) 44, sb.get());
-        assertEquals((short) 55, sb.get());
-        assertEquals((short) 66, sb.get());
-        assertEquals((short) 70, sb.get());
-
-        short[] ss2 = {10, 22, 30};
-        sb.position(2);
-        sb.put(ss2, 1, 1);
-        sb.position(0);
-        assertEquals((short) 0, sb.get());
-        assertEquals((short) 11, sb.get());
-        assertEquals((short) 22, sb.get());
-        assertEquals((short) 33, sb.get());
-        assertEquals((short) 44, sb.get());
-        assertEquals((short) 55, sb.get());
-        assertEquals((short) 66, sb.get());
-        assertEquals((short) 70, sb.get());
-    }
-
-    private void intBufferTest(IntBuffer ib) {
-        checkBuffer(ib);
-
-        try {
-            ib.put(-1, (int) 0);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        try {
-            ib.put(ib.limit(), (int) 0);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        // IndexOutOfBoundsException: offset < 0
-        try {
-            int[] data = new int[8];
-            ib.position(0);
-            ib.put(data, -1, 2);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        // IndexOutOfBoundsException: length > array.length - offset
-        try {
-            int[] data = new int[8];
-            ib.position(0);
-            ib.put(data, 1, 8);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        // BufferOverflowException: length > remaining()
-        try {
-            int[] data = new int[8];
-            ib.position(ib.limit() - 2);
-            ib.put(data, 0, 3);
-            fail("expected exception not thrown");
-        } catch (BufferOverflowException e) {
-            // expected
-        }
-
-        int[] data = {0, 10, 20, 30, 40, 50, 60, 70};
-        ib.position(0);
-        ib.put(data);
-
-        try {
-            ib.get();
-            fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-
-        ib.position(0);
-        assertEquals((int) 0, ib.get());
-        assertEquals((int) 10, ib.get());
-        assertEquals((int) 20, ib.get());
-        assertEquals((int) 30, ib.get());
-        assertEquals((int) 40, ib.get());
-        assertEquals((int) 50, ib.get());
-        assertEquals((int) 60, ib.get());
-        assertEquals((int) 70, ib.get());
-        try {
-            ib.get();
-            fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-        ib.position(1);
-        ib.put((int) 11);
-        assertEquals((int) 11, ib.get(1));
-
-        int[] ss1 = {33, 44, 55, 66};
-        ib.position(3);
-        ib.put(ss1);
-        ib.position(0);
-        assertEquals((int) 0, ib.get());
-        assertEquals((int) 11, ib.get());
-        assertEquals((int) 20, ib.get());
-        assertEquals((int) 33, ib.get());
-        assertEquals((int) 44, ib.get());
-        assertEquals((int) 55, ib.get());
-        assertEquals((int) 66, ib.get());
-        assertEquals((int) 70, ib.get());
-
-        int[] ss2 = {10, 22, 30};
-        ib.position(2);
-        ib.put(ss2, 1, 1);
-        ib.position(0);
-        assertEquals((int) 0, ib.get());
-        assertEquals((int) 11, ib.get());
-        assertEquals((int) 22, ib.get());
-        assertEquals((int) 33, ib.get());
-        assertEquals((int) 44, ib.get());
-        assertEquals((int) 55, ib.get());
-        assertEquals((int) 66, ib.get());
-        assertEquals((int) 70, ib.get());
-    }
-
-    void floatBufferTest(FloatBuffer fb) {
-        checkBuffer(fb);
-
-        try {
-            fb.put(-1, (float) 0);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        try {
-            fb.put(fb.limit(), (float) 0);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        // IndexOutOfBoundsException: offset < 0
-        try {
-            float[] data = new float[8];
-            fb.position(0);
-            fb.put(data, -1, 2);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        // IndexOutOfBoundsException: length > array.length - offset
-        try {
-            float[] data = new float[8];
-            fb.position(0);
-            fb.put(data, 1, 8);
-            fail("expected exception not thrown");
-        } catch (IndexOutOfBoundsException e) {
-            // expected
-        }
-
-        // BufferOverflowException: length > remaining()
-        try {
-            float[] data = new float[8];
-            fb.position(fb.limit() - 2);
-            fb.put(data, 0, 3);
-            fail("expected exception not thrown");
-        } catch (BufferOverflowException e) {
-            // expected
-        }
-
-        float[] data = {0, 10, 20, 30, 40, 50, 60, 70};
-        fb.position(0);
-        fb.put(data);
-
-        try {
-            fb.get();
-            fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-
-        fb.position(0);
-        assertEquals((float) 0, fb.get());
-        assertEquals((float) 10, fb.get());
-        assertEquals((float) 20, fb.get());
-        assertEquals((float) 30, fb.get());
-        assertEquals((float) 40, fb.get());
-        assertEquals((float) 50, fb.get());
-        assertEquals((float) 60, fb.get());
-        assertEquals((float) 70, fb.get());
-        try {
-            fb.get();
-            fail("expected exception not thrown");
-        } catch (BufferUnderflowException e) {
-            // expected
-        }
-        fb.position(1);
-        fb.put((float) 11);
-        assertEquals((float) 11, fb.get(1));
-
-        float[] ss1 = {33, 44, 55, 66};
-        fb.position(3);
-        fb.put(ss1);
-        fb.position(0);
-        assertEquals((float) 0, fb.get());
-        assertEquals((float) 11, fb.get());
-        assertEquals((float) 20, fb.get());
-        assertEquals((float) 33, fb.get());
-        assertEquals((float) 44, fb.get());
-        assertEquals((float) 55, fb.get());
-        assertEquals((float) 66, fb.get());
-        assertEquals((float) 70, fb.get());
-
-        float[] ss2 = {10, 22, 30};
-        fb.position(2);
-        fb.put(ss2, 1, 1);
-        fb.position(0);
-        assertEquals((float) 0, fb.get());
-        assertEquals((float) 11, fb.get());
-        assertEquals((float) 22, fb.get());
-        assertEquals((float) 33, fb.get());
-        assertEquals((float) 44, fb.get());
-        assertEquals((float) 55, fb.get());
-        assertEquals((float) 66, fb.get());
-        assertEquals((float) 70, fb.get());
-    }
-}
diff --git a/tests/CoreTests/android/core/OutputStreamWriterTest.java b/tests/CoreTests/android/core/OutputStreamWriterTest.java
deleted file mode 100644
index 1c0901e..0000000
--- a/tests/CoreTests/android/core/OutputStreamWriterTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStreamWriter;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Tests basic functionality of an OutputStreamWriter.
- */
-public class OutputStreamWriterTest extends TestCase {
-    
-    @SmallTest
-    public void testOutputStreamWriter() throws Exception {
-        String str = "AbCdEfGhIjKlMnOpQrStUvWxYz";
-        ByteArrayOutputStream aa = new ByteArrayOutputStream();
-        OutputStreamWriter a = new OutputStreamWriter(aa, "ISO8859_1");
-        try {
-            a.write(str, 0, 4);
-            a.write('A');
-            // We have to flush the OutputStreamWriter to guarantee
-            // that the results will appear in the underlying OutputStream
-            a.flush();
-            assertEquals("ISO8859_1", a.getEncoding());
-            assertEquals(5, aa.size());
-            assertEquals("AbCdA", aa.toString());
-        } finally {
-            a.close();
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/ParseIntTest.java b/tests/CoreTests/android/core/ParseIntTest.java
deleted file mode 100644
index 0e3b0c6..0000000
--- a/tests/CoreTests/android/core/ParseIntTest.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Tests for functionality of class Integer to parse integers.
- */
-public class ParseIntTest extends TestCase {
-    
-    @SmallTest
-    public void testParseInt() throws Exception {
-        assertEquals(0, Integer.parseInt("0", 10));
-        assertEquals(473, Integer.parseInt("473", 10));
-        assertEquals(0, Integer.parseInt("-0", 10));
-        assertEquals(-255, Integer.parseInt("-FF", 16));
-        assertEquals(102, Integer.parseInt("1100110", 2));
-        assertEquals(2147483647, Integer.parseInt("2147483647", 10));
-        assertEquals(-2147483648, Integer.parseInt("-2147483648", 10));
-
-        try {
-            Integer.parseInt("2147483648", 10);
-            fail();
-        } catch (NumberFormatException e) {
-            // ok
-        }
-
-        try {
-            Integer.parseInt("-2147483649", 10);
-            fail();
-        } catch (NumberFormatException e) {
-            // ok
-        }
-
-        // One digit too many
-        try {
-            Integer.parseInt("21474836470", 10);
-            fail();
-        } catch (NumberFormatException e) {
-            // ok
-        }
-
-        try {
-            Integer.parseInt("-21474836480", 10);
-            fail();
-        } catch (NumberFormatException e) {
-            // ok
-        }
-
-        try {
-            Integer.parseInt("21474836471", 10);
-            fail();
-        } catch (NumberFormatException e) {
-            // ok
-        }
-
-        try {
-            Integer.parseInt("-21474836481", 10);
-            fail();
-        } catch (NumberFormatException e) {
-            // ok
-        }
-
-        try {
-            Integer.parseInt("214748364710", 10);
-            fail();
-        } catch (NumberFormatException e) {
-            // ok
-        }
-
-        try {
-            Integer.parseInt("-214748364811", 10);
-            fail();
-        } catch (NumberFormatException e) {
-            // ok
-        }
-
-        try {
-            Integer.parseInt("99", 8);
-            fail();
-        } catch (NumberFormatException e) {
-            // ok
-        }
-
-        try {
-            Integer.parseInt("Kona", 10);
-            fail();
-        } catch (NumberFormatException e) {
-            // ok
-        }
-
-        assertEquals(411787, Integer.parseInt("Kona", 27));
-    }
-}
diff --git a/tests/CoreTests/android/core/PipedStreamTest.java b/tests/CoreTests/android/core/PipedStreamTest.java
deleted file mode 100644
index d98bc10..0000000
--- a/tests/CoreTests/android/core/PipedStreamTest.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.PipedInputStream;
-import java.io.PipedOutputStream;
-import android.test.suitebuilder.annotation.MediumTest;
-import android.test.suitebuilder.annotation.SmallTest;
-
-class Fibonacci {
-    int n1 = -1;
-    int n2;
-
-    public int next() {
-        if (n1 < 0) {
-            n1 = 0;
-            return 0;
-        } else if (n1 == 0) {
-            n2 = 0;
-            n1 = 1;
-            return 1;
-        } else {
-            int ret = n1 + n2;
-            n2 = n1;
-            n1 = ret;
-            return ret;
-        }
-    }
-}
-
-
-public class PipedStreamTest extends TestCase {
-
-    private abstract static class TestThread extends Thread {
-        public abstract void runTest() throws Exception;
-
-        public final void run() {
-            try {
-                runTest();
-            } catch (Throwable e) {
-                android.util.Log.e("PST", "Got exception " + e, e);
-                android.util.Log.e("PST", android.util.Log.getStackTraceString(e));
-                exception = e;
-            }
-        }
-
-        Throwable exception;
-        int countRead = 0;
-    }
-
-    @MediumTest
-    public void testA() throws Exception {
-
-        final PipedInputStream in = new PipedInputStream();
-        final PipedOutputStream out = new PipedOutputStream(in);
-
-        assertEquals(0, in.available());
-
-        TestThread reader, writer;
-
-        reader = new TestThread() {
-            Fibonacci fib = new Fibonacci();
-
-            @Override
-            public void runTest() throws Exception {
-                int readInt;
-                byte readByte;
-
-                for (; ;) {
-                    readInt = in.read();
-
-                    if (readInt == -1) {
-                        return;
-                    }
-
-                    readByte = (byte) readInt;
-                    assertEquals(readByte, (byte) fib.next());
-                    countRead++;
-                }
-            }
-        };
-
-        reader.start();
-
-        writer = new TestThread() {
-            Fibonacci fib = new Fibonacci();
-
-            @Override
-            public void runTest() throws Exception {
-                for (int i = 0; i < 2000; i++) {
-                    int toWrite = fib.next();
-                    out.write(toWrite);
-                }
-                out.close();
-            }
-        };
-
-        writer.start();
-
-
-        for (; ;) {
-            try {
-                reader.join(60 * 1000);
-                writer.join(1000);
-                break;
-            } catch (InterruptedException ex) {
-            }
-        }
-
-        assertEquals(2000, reader.countRead);
-
-        if (writer.exception != null) {
-            throw new Exception(writer.exception);
-        }
-        if (reader.exception != null) {
-            throw new Exception(reader.exception);
-        }
-    }
-
-    @MediumTest
-    public void testB() throws Exception {
-        final PipedInputStream in = new PipedInputStream();
-        final PipedOutputStream out = new PipedOutputStream(in);
-
-        assertEquals(0, in.available());
-
-        TestThread reader, writer;
-
-        reader = new TestThread() {
-            Fibonacci fib = new Fibonacci();
-
-            @Override
-            public void runTest() throws Exception {
-                byte readBytes[] = new byte[5];
-                int ret;
-
-                for (; ;) {
-                    int nread = 0;
-                    while (nread < 5) {
-                        ret = in.read(readBytes, nread, readBytes.length - nread);
-
-                        if (ret == -1) {
-                            return;
-                        }
-                        nread += ret;
-                    }
-
-                    assertEquals(5, nread);
-
-                    int readInt = (((int) readBytes[0] & 0xff) << 24)
-                            | (((int) readBytes[1] & 0xff) << 16)
-                            | (((int) readBytes[2] & 0xff) << 8)
-                            | (((int) readBytes[3] & 0xff));
-
-
-                    assertEquals("Error at " + countRead, fib.next(), readInt);
-                    assertEquals("Error at " + countRead, 0, readBytes[4]);
-                    countRead++;
-                }
-            }
-        };
-
-        reader.start();
-
-        writer = new TestThread() {
-            Fibonacci fib = new Fibonacci();
-
-            @Override
-            public void runTest() throws Exception {
-                byte writeBytes[] = new byte[5];
-                for (int i = 0; i < 2000; i++) {
-                    int toWrite = fib.next();
-                    writeBytes[0] = (byte) (toWrite >> 24);
-                    writeBytes[1] = (byte) (toWrite >> 16);
-                    writeBytes[2] = (byte) (toWrite >> 8);
-                    writeBytes[3] = (byte) (toWrite);
-                    writeBytes[4] = 0;
-                    out.write(writeBytes, 0, writeBytes.length);
-                }
-                out.close();
-            }
-        };
-
-        writer.start();
-
-
-        for (; ;) {
-            try {
-                reader.join(60 * 1000);
-                writer.join(1000);
-                break;
-            } catch (InterruptedException ex) {
-            }
-        }
-
-        if (reader.exception != null) {
-            throw new Exception(reader.exception);
-        }
-        if (writer.exception != null) {
-            throw new Exception(writer.exception);
-        }
-
-        assertEquals(2000, reader.countRead);
-    }
-
-    @SmallTest
-    public void testC() throws Exception {
-        final PipedInputStream in = new PipedInputStream();
-        final PipedOutputStream out = new PipedOutputStream(in);
-        final byte readBytes[] = new byte[1024 * 2];
-
-        assertEquals(0, in.available());
-
-        TestThread reader, writer;
-
-        reader = new TestThread() {
-            @Override
-            public void runTest() throws Exception {
-                int ret;
-
-                for (; ;) {
-                    int nread = 0;
-                    while (nread < readBytes.length) {
-                        ret = in.read(readBytes, nread, readBytes.length - nread);
-
-                        if (ret == -1) {
-                            return;
-                        }
-                        nread += ret;
-                    }
-                }
-            }
-        };
-
-        reader.start();
-
-        writer = new TestThread() {
-            Fibonacci fib = new Fibonacci();
-
-            @Override
-            public void runTest() throws Exception {
-                byte writeBytes[] = new byte[1024 * 2];
-                for (int i = 0; i < (writeBytes.length - 4); i += 4) {
-                    int toWrite = fib.next();
-                    writeBytes[i    ] = (byte) (toWrite >> 24);
-                    writeBytes[i + 1] = (byte) (toWrite >> 16);
-                    writeBytes[i + 2] = (byte) (toWrite >> 8);
-                    writeBytes[i + 3] = (byte) (toWrite);
-                }
-                out.write(writeBytes, 0, writeBytes.length);
-                out.close();
-            }
-        };
-
-        writer.start();
-
-
-        for (; ;) {
-            try {
-                reader.join(60 * 1000);
-                writer.join(1000);
-                break;
-            } catch (InterruptedException ex) {
-            }
-        }
-
-        if (reader.exception != null) {
-            throw new Exception(reader.exception);
-        }
-        if (writer.exception != null) {
-            throw new Exception(writer.exception);
-        }
-
-        Fibonacci fib = new Fibonacci();
-        for (int i = 0; i < (readBytes.length - 4); i += 4) {
-            int readInt = (((int) readBytes[i] & 0xff) << 24)
-                    | (((int) readBytes[i + 1] & 0xff) << 16)
-                    | (((int) readBytes[i + 2] & 0xff) << 8)
-                    | (((int) readBytes[i + 3] & 0xff));
-
-            assertEquals("Error at " + i, readInt, fib.next());
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/PrintWriterTest.java b/tests/CoreTests/android/core/PrintWriterTest.java
deleted file mode 100644
index 09ee389..0000000
--- a/tests/CoreTests/android/core/PrintWriterTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import android.test.suitebuilder.annotation.SmallTest;
-
-public class PrintWriterTest extends TestCase {
-
-    @SmallTest
-    public void testPrintWriter() throws Exception {
-        String str = "AbCdEfGhIjKlMnOpQrStUvWxYz";
-        StringWriter aa = new StringWriter();
-        PrintWriter a = new PrintWriter(aa);
-
-        try {
-            a.write(str, 0, 26);
-            a.write('X');
-
-            assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzX", aa.toString());
-
-            a.write("alphabravodelta", 5, 5);
-            a.append('X');
-            assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzXbravoX", aa.toString());
-            a.append("omega");
-            assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzXbravoXomega", aa.toString());
-            a.print("ZZZ");
-            assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzXbravoXomegaZZZ", aa.toString());
-        } finally {
-            a.close();
-        }
-
-        StringWriter ba = new StringWriter();
-        PrintWriter b = new PrintWriter(ba);
-        try {
-            b.print(true);
-            b.print((char) 'A');
-            b.print("BCD".toCharArray());
-            b.print((double) 1.2);
-            b.print((float) 3);
-            b.print((int) 4);
-            b.print((long) 5);
-            assertEquals("trueABCD1.23.045", ba.toString());
-            b.println();
-            b.println(true);
-            b.println((char) 'A');
-            b.println("BCD".toCharArray());
-            b.println((double) 1.2);
-            b.println((float) 3);
-            b.println((int) 4);
-            b.println((long) 5);
-            b.print("THE END");
-            assertEquals("trueABCD1.23.045\ntrue\nA\nBCD\n1.2\n3.0\n4\n5\nTHE END", ba.toString());
-        } finally {
-            b.close();
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/PushbackInputStreamTest.java b/tests/CoreTests/android/core/PushbackInputStreamTest.java
deleted file mode 100644
index 44cfd8a..0000000
--- a/tests/CoreTests/android/core/PushbackInputStreamTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.ByteArrayInputStream;
-import java.io.PushbackInputStream;
-import android.test.suitebuilder.annotation.SmallTest;
-
-public class PushbackInputStreamTest extends TestCase {
-
-    @SmallTest
-    public void testPushbackInputStream() throws Exception {
-        String str = "AbCdEfGhIjKlM\nOpQrStUvWxYz";
-        ByteArrayInputStream aa = new ByteArrayInputStream(str.getBytes());
-        ByteArrayInputStream ba = new ByteArrayInputStream(str.getBytes());
-        ByteArrayInputStream ca = new ByteArrayInputStream(str.getBytes());
-
-        PushbackInputStream a = new PushbackInputStream(aa, 7);
-        try {
-            a.unread("push".getBytes());
-            assertEquals("pushAbCdEfGhIjKlM\nOpQrStUvWxYz", IOUtil.read(a));
-        } finally {
-            a.close();
-        }
-
-        PushbackInputStream b = new PushbackInputStream(ba, 9);
-        try {
-            b.unread('X');
-            assertEquals("XAbCdEfGhI", IOUtil.read(b, 10));
-        } finally {
-            b.close();
-        }
-
-        PushbackInputStream c = new PushbackInputStream(ca);
-        try {
-            assertEquals("bdfhjl\nprtvxz", IOUtil.skipRead(c));
-        } finally {
-            c.close();
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/PushbackReaderTest.java b/tests/CoreTests/android/core/PushbackReaderTest.java
deleted file mode 100644
index ef62c28..0000000
--- a/tests/CoreTests/android/core/PushbackReaderTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.PushbackReader;
-import java.io.StringReader;
-import android.test.suitebuilder.annotation.SmallTest;
-
-public class PushbackReaderTest extends TestCase {
-
-    @SmallTest
-    public void testPushbackReader() throws Exception {
-        String str = "AbCdEfGhIjKlMnOpQrStUvWxYz";
-        StringReader aa = new StringReader(str);
-        StringReader ba = new StringReader(str);
-        StringReader ca = new StringReader(str);
-
-        PushbackReader a = new PushbackReader(aa, 5);
-        try {
-            a.unread("PUSH".toCharArray());
-            assertEquals("PUSHAbCdEfGhIjKlMnOpQrStUvWxYz", IOUtil.read(a));
-        } finally {
-            a.close();
-        }
-
-        PushbackReader b = new PushbackReader(ba, 15);
-        try {
-            b.unread('X');
-            assertEquals("XAbCdEfGhI", IOUtil.read(b, 10));
-        } finally {
-            b.close();
-        }
-
-        PushbackReader c = new PushbackReader(ca);
-        try {
-            assertEquals("bdfhjlnprtvxz", IOUtil.skipRead(c));
-        } finally {
-            c.close();
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/ReflectArrayTest.java b/tests/CoreTests/android/core/ReflectArrayTest.java
deleted file mode 100644
index 20ee8a4..0000000
--- a/tests/CoreTests/android/core/ReflectArrayTest.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.lang.reflect.Array;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Test java.lang.reflect.Array methods.
- */
-public class ReflectArrayTest extends TestCase {
-
-    @SmallTest
-    public void testSingleInt() throws Exception {
-        Object intArray = Array.newInstance(Integer.TYPE, 2);
-
-        int[] array = (int[]) intArray;
-        array[0] = 5;
-        Array.setInt(intArray, 1, 6);
-
-        assertEquals(5, Array.getInt(intArray, 0));
-        assertEquals(6, array[1]);
-
-        try {
-            array[2] = 27;
-            fail("store should have failed");
-        } catch (ArrayIndexOutOfBoundsException abe) {
-            // expected
-        }
-
-        assertEquals(2, array.length);
-        assertEquals(Array.getLength(intArray), array.length);
-
-        try {
-            int[][] wrongArray = (int[][]) intArray;
-            fail("cast should have failed");
-        } catch (ClassCastException cce) {
-            // expected
-        }
-
-        intArray = Array.newInstance(Integer.TYPE, 0);
-        assertEquals(0, Array.getLength(intArray));
-    }
-
-    @SmallTest
-    public void testSingle() throws Exception {
-        Object strArray = Array.newInstance(String.class, 2);
-
-        String[] array = (String[]) strArray;
-        array[0] = "entry zero";
-        Array.set(strArray, 1, "entry one");
-
-        //System.out.println("array: " + array);
-
-        assertEquals("entry zero", Array.get(strArray, 0));
-        assertEquals("entry one", array[1]);
-
-        assertEquals(2, array.length);
-        assertEquals(Array.getLength(strArray), array.length);
-    }
-
-    @SmallTest
-    public void testMultiInt() throws Exception {
-        int[] dimensions = {3, 2, 1};
-        Object intIntIntArray = Array.newInstance(Integer.TYPE, dimensions);
-        int[][][] array3 = (int[][][]) intIntIntArray;
-
-        array3[0][0][0] = 123;
-        array3[2][1][0] = 456;
-
-        try {
-            array3[2][1][1] = 768;
-            fail("store should have failed");
-        } catch (ArrayIndexOutOfBoundsException abe) {
-            // expected
-        }
-
-        //System.out.println("array3: " + array3);
-    }
-
-    @SmallTest
-    public void testMulti() throws Exception {
-        int[] dimensions = {1, 2, 3};
-        Object strStrStrArray = Array.newInstance(String.class, dimensions);
-        String[][][] array3 = (String[][][]) strStrStrArray;
-
-        array3[0][0][0] = "zero zero zero";
-        array3[0][1][2] = "zero one two";
-
-        try {
-            array3[1][0][0] = "bad store";
-            fail("store should have failed");
-        } catch (ArrayIndexOutOfBoundsException abe) {
-            // expected
-        }
-
-        try {
-            String[][] array2 = (String[][]) strStrStrArray;
-            fail("expecting bad cast");
-        } catch (ClassCastException cce) {
-            // expected
-        }
-        //System.out.println("array3: " + array3);
-
-
-        int[] dimensions2 = {1, 2};
-        strStrStrArray = Array.newInstance(String[].class, dimensions2);
-        array3 = (String[][][]) strStrStrArray;
-        array3[0][1] = new String[3];
-        array3[0][1][2] = "zero one two";
-        try {
-            array3[1][0][0] = "bad store";
-            fail("store should have failed");
-        } catch (ArrayIndexOutOfBoundsException abe) {
-            // expected
-        }
-        //System.out.println("array3: " + array3);
-    }
-}
-
diff --git a/tests/CoreTests/android/core/SerializationTest.java b/tests/CoreTests/android/core/SerializationTest.java
deleted file mode 100644
index 9644d03..0000000
--- a/tests/CoreTests/android/core/SerializationTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import android.test.suitebuilder.annotation.SmallTest;
-
-/**
- * Tests serialization of user-level classes.
- */
-public class SerializationTest extends TestCase {
-
-    static class MySerializable implements Serializable {}
-
-    @SmallTest
-    public void testSerialization() throws IOException, ClassNotFoundException {
-        ByteArrayOutputStream bout = new ByteArrayOutputStream();
-        ObjectOutputStream oout = new ObjectOutputStream(bout);
-        oout.writeObject(new MySerializable());
-        oout.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        Object o = new ObjectInputStream(bin).readObject();
-        assertTrue(o instanceof MySerializable);
-    }
-}
diff --git a/tests/CoreTests/android/core/StreamTokenizerTest.java b/tests/CoreTests/android/core/StreamTokenizerTest.java
deleted file mode 100644
index 5013860..0000000
--- a/tests/CoreTests/android/core/StreamTokenizerTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.ByteArrayInputStream;
-import java.io.StreamTokenizer;
-import java.io.StringReader;
-import android.test.suitebuilder.annotation.MediumTest;
-
-/**
- * Tests for the StreamTokenizer
- */
-public class StreamTokenizerTest extends TestCase {
-    
-    @MediumTest
-    public void testStreamTokenizer() throws Exception {
-        String str = "Testing 12345 \n alpha \r\n omega";
-        String strb = "-3.8 'BLIND mice' \r sEe /* how */ they run";
-        StringReader aa = new StringReader(str);
-        StringReader ba = new StringReader(strb);
-        StreamTokenizer a = new StreamTokenizer(aa);
-        StreamTokenizer b = new StreamTokenizer(ba);
-
-        assertEquals(1, a.lineno());
-        assertEquals(StreamTokenizer.TT_WORD, a.nextToken());
-        assertEquals("Token[Testing], line 1", a.toString());
-        assertEquals(StreamTokenizer.TT_NUMBER, a.nextToken());
-        assertEquals("Token[n=12345.0], line 1", a.toString());
-        assertEquals(StreamTokenizer.TT_WORD, a.nextToken());
-        assertEquals("Token[alpha], line 2", a.toString());
-        assertEquals(StreamTokenizer.TT_WORD, a.nextToken());
-        assertEquals("Token[omega], line 3", a.toString());
-        assertEquals(StreamTokenizer.TT_EOF, a.nextToken());
-        assertEquals("Token[EOF], line 3", a.toString());
-
-        b.commentChar('u');
-        b.eolIsSignificant(true);
-        b.lowerCaseMode(true);
-        b.ordinaryChar('y');
-        b.slashStarComments(true);
-
-        assertEquals(StreamTokenizer.TT_NUMBER, b.nextToken());
-        assertEquals(-3.8, b.nval);
-        assertEquals("Token[n=-3.8], line 1", b.toString());
-        assertEquals(39, b.nextToken()); // '
-        assertEquals("Token[BLIND mice], line 1", b.toString());
-        assertEquals(10, b.nextToken()); // \n
-        assertEquals("Token[EOL], line 2", b.toString());
-        assertEquals(StreamTokenizer.TT_WORD, b.nextToken());
-        assertEquals("Token[see], line 2", b.toString());
-        assertEquals(StreamTokenizer.TT_WORD, b.nextToken());
-        assertEquals("Token[the], line 2", b.toString());
-        assertEquals(121, b.nextToken()); // y
-        assertEquals("Token['y'], line 2", b.toString());
-        assertEquals(StreamTokenizer.TT_WORD, b.nextToken());
-        assertEquals("Token[r], line 2", b.toString());
-        assertEquals(StreamTokenizer.TT_EOF, b.nextToken());
-        assertEquals("Token[EOF], line 2", b.toString());
-
-        // A harmony regression test
-        byte[] data = new byte[]{(byte) '-'};
-        StreamTokenizer tokenizer = new StreamTokenizer(new ByteArrayInputStream(data));
-        tokenizer.nextToken();
-        String result = tokenizer.toString();
-        assertEquals("Token['-'], line 1", result);
-
-        // another harmony regression test
-        byte[] data2 = new byte[]{(byte) '"',
-                (byte) 'H',
-                (byte) 'e',
-                (byte) 'l',
-                (byte) 'l',
-                (byte) 'o',
-                (byte) '"'};
-        StreamTokenizer tokenizer2 = new StreamTokenizer(new ByteArrayInputStream(data2));
-        tokenizer2.nextToken();
-        result = tokenizer2.toString();
-        assertEquals("Token[Hello], line 1", result);
-    }
-}
diff --git a/tests/CoreTests/android/core/StrictMathTest.java b/tests/CoreTests/android/core/StrictMathTest.java
deleted file mode 100644
index 92e6cb6..0000000
--- a/tests/CoreTests/android/core/StrictMathTest.java
+++ /dev/null
@@ -1,855 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-import android.test.suitebuilder.annotation.MediumTest;
-
-public class StrictMathTest extends TestCase {
-
-    private final double HYP = StrictMath.sqrt(2.0);
-
-    private final double OPP = 1.0;
-
-    private final double ADJ = 1.0;
-
-    /* Required to make previous preprocessor flags work - do not remove */
-    int unused = 0;
-
-    /**
-     * @tests java.lang.StrictMath#abs(double)
-     */
-    @SmallTest
-    public void testAbsD() {
-        // Test for method double java.lang.StrictMath.abs(double)
-
-        assertTrue("Incorrect double abs value",
-                (StrictMath.abs(-1908.8976) == 1908.8976));
-        assertTrue("Incorrect double abs value",
-                (StrictMath.abs(1908.8976) == 1908.8976));
-    }
-
-    /**
-     * @tests java.lang.StrictMath#abs(float)
-     */
-    @SmallTest
-    public void testAbsF() {
-        // Test for method float java.lang.StrictMath.abs(float)
-        assertTrue("Incorrect float abs value",
-                (StrictMath.abs(-1908.8976f) == 1908.8976f));
-        assertTrue("Incorrect float abs value",
-                (StrictMath.abs(1908.8976f) == 1908.8976f));
-    }
-
-    /**
-     * @tests java.lang.StrictMath#abs(int)
-     */
-    @SmallTest
-    public void testAbsI() {
-        // Test for method int java.lang.StrictMath.abs(int)
-        assertTrue("Incorrect int abs value",
-                (StrictMath.abs(-1908897) == 1908897));
-        assertTrue("Incorrect int abs value",
-                (StrictMath.abs(1908897) == 1908897));
-    }
-
-    /**
-     * @tests java.lang.StrictMath#abs(long)
-     */
-    @SmallTest
-    public void testAbsJ() {
-        // Test for method long java.lang.StrictMath.abs(long)
-        assertTrue("Incorrect long abs value", (StrictMath
-                .abs(-19088976000089L) == 19088976000089L));
-        assertTrue("Incorrect long abs value",
-                (StrictMath.abs(19088976000089L) == 19088976000089L));
-    }
-
-    /**
-     * @tests java.lang.StrictMath#acos(double)
-     */
-    @SmallTest
-    public void testAcosD() {
-        // Test for method double java.lang.StrictMath.acos(double)
-        assertTrue("Returned incorrect arc cosine", StrictMath.cos(StrictMath
-                .acos(ADJ / HYP)) == ADJ / HYP);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#asin(double)
-     */
-    @SmallTest
-    public void testAsinD() {
-        // Test for method double java.lang.StrictMath.asin(double)
-        assertTrue("Returned incorrect arc sine", StrictMath.sin(StrictMath
-                .asin(OPP / HYP)) == OPP / HYP);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#atan(double)
-     */
-    @SmallTest
-    public void testAtanD() {
-        // Test for method double java.lang.StrictMath.atan(double)
-        double answer = StrictMath.tan(StrictMath.atan(1.0));
-        assertTrue("Returned incorrect arc tangent: " + answer, answer <= 1.0
-                && answer >= 9.9999999999999983E-1);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#atan2(double,double)
-     */
-    @SmallTest
-    public void testAtan2DD() {
-        // Test for method double java.lang.StrictMath.atan2(double, double)
-        double answer = StrictMath.atan(StrictMath.tan(1.0));
-        assertTrue("Returned incorrect arc tangent: " + answer, answer <= 1.0
-                && answer >= 9.9999999999999983E-1);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#cbrt(double)
-     */
-    @SuppressWarnings("boxing")
-    @SmallTest
-    public void testCbrtD() {
-        // Test for special situations
-        assertTrue("Should return Double.NaN", Double.isNaN(StrictMath
-                .cbrt(Double.NaN)));
-        assertEquals("Should return Double.POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath
-                .cbrt(Double.POSITIVE_INFINITY));
-        assertEquals("Should return Double.NEGATIVE_INFINITY",
-                Double.NEGATIVE_INFINITY, StrictMath
-                .cbrt(Double.NEGATIVE_INFINITY));
-        assertEquals(Double.doubleToLongBits(0.0), Double
-                .doubleToLongBits(StrictMath.cbrt(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(StrictMath.cbrt(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(StrictMath.cbrt(-0.0)));
-
-        assertEquals("Should return 3.0", 3.0, StrictMath.cbrt(27.0));
-        assertEquals("Should return 23.111993172558684", 23.111993172558684,
-                StrictMath.cbrt(12345.6));
-        assertEquals("Should return 5.643803094122362E102",
-                5.643803094122362E102, StrictMath.cbrt(Double.MAX_VALUE));
-        assertEquals("Should return 0.01", 0.01, StrictMath.cbrt(0.000001));
-
-        assertEquals("Should return -3.0", -3.0, StrictMath.cbrt(-27.0));
-        assertEquals("Should return -23.111993172558684", -23.111993172558684,
-                StrictMath.cbrt(-12345.6));
-        assertEquals("Should return 1.7031839360032603E-108",
-                1.7031839360032603E-108, StrictMath.cbrt(Double.MIN_VALUE));
-        assertEquals("Should return -0.01", -0.01, StrictMath.cbrt(-0.000001));
-
-        try {
-            StrictMath.cbrt((Double) null);
-            fail("Should throw NullPointerException");
-        } catch (NullPointerException e) {
-            //expected
-        }
-    }
-
-    /**
-     * @tests java.lang.StrictMath#ceil(double)
-     */
-    @SmallTest
-    public void testCeilD() {
-        // Test for method double java.lang.StrictMath.ceil(double)
-        assertEquals("Incorrect ceiling for double",
-                79, StrictMath.ceil(78.89), 0.0);
-        assertEquals("Incorrect ceiling for double",
-                -78, StrictMath.ceil(-78.89), 0.0);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#cos(double)
-     */
-    @SmallTest
-    public void testCosD() {
-        // Test for method double java.lang.StrictMath.cos(double)
-
-        assertTrue("Returned incorrect cosine", StrictMath.cos(StrictMath
-                .acos(ADJ / HYP)) == ADJ / HYP);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#cosh(double)
-     */
-    @SuppressWarnings("boxing")
-    @SmallTest
-    public void testCosh_D() {
-        // Test for special situations        
-        assertTrue("Should return NaN", Double.isNaN(StrictMath
-                .cosh(Double.NaN)));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath
-                .cosh(Double.POSITIVE_INFINITY));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath
-                .cosh(Double.NEGATIVE_INFINITY));
-        assertEquals("Should return 1.0", 1.0, StrictMath.cosh(+0.0));
-        assertEquals("Should return 1.0", 1.0, StrictMath.cosh(-0.0));
-
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath.cosh(1234.56));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath.cosh(-1234.56));
-        assertEquals("Should return 1.0000000000005", 1.0000000000005,
-                StrictMath.cosh(0.000001));
-        assertEquals("Should return 1.0000000000005", 1.0000000000005,
-                StrictMath.cosh(-0.000001));
-        assertEquals("Should return 5.212214351945598", 5.212214351945598,
-                StrictMath.cosh(2.33482));
-
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath.cosh(Double.MAX_VALUE));
-        assertEquals("Should return 1.0", 1.0, StrictMath
-                .cosh(Double.MIN_VALUE));
-    }
-
-    /**
-     * @tests java.lang.StrictMath#exp(double)
-     */
-    @SmallTest
-    public void testExpD() {
-        // Test for method double java.lang.StrictMath.exp(double)
-        assertTrue("Incorrect answer returned for simple power", StrictMath
-                .abs(StrictMath.exp(4D) - StrictMath.E * StrictMath.E
-                        * StrictMath.E * StrictMath.E) < 0.1D);
-        assertTrue("Incorrect answer returned for larger power", StrictMath
-                .log(StrictMath.abs(StrictMath.exp(5.5D)) - 5.5D) < 10.0D);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#expm1(double)
-     */
-    @SuppressWarnings("boxing")
-    @SmallTest
-    public void testExpm1D() {
-        //Test for special cases        
-        assertTrue("Should return NaN", Double.isNaN(StrictMath.expm1(Double.NaN)));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath.expm1(Double.POSITIVE_INFINITY));
-        assertEquals("Should return -1.0", -1.0, StrictMath
-                .expm1(Double.NEGATIVE_INFINITY));
-        assertEquals(Double.doubleToLongBits(0.0), Double
-                .doubleToLongBits(StrictMath.expm1(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(StrictMath.expm1(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(StrictMath.expm1(-0.0)));
-
-        assertEquals("Should return -9.999950000166666E-6",
-                -9.999950000166666E-6, StrictMath.expm1(-0.00001));
-        assertEquals("Should return 1.0145103074469635E60",
-                1.0145103074469635E60, StrictMath.expm1(138.16951162));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath
-                .expm1(123456789123456789123456789.4521584223));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath.expm1(Double.MAX_VALUE));
-        assertEquals("Should return MIN_VALUE", Double.MIN_VALUE, StrictMath
-                .expm1(Double.MIN_VALUE));
-
-    }
-
-    /**
-     * @tests java.lang.StrictMath#floor(double)
-     */
-    @SmallTest
-    public void testFloorD() {
-        // Test for method double java.lang.StrictMath.floor(double)
-        assertEquals("Incorrect floor for double",
-                78, StrictMath.floor(78.89), 0.0);
-        assertEquals("Incorrect floor for double",
-                -79, StrictMath.floor(-78.89), 0.0);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#hypot(double,double)
-     */
-    @SuppressWarnings("boxing")
-    @SmallTest
-    public void testHypotDD() {
-        // Test for special cases
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath.hypot(Double.POSITIVE_INFINITY,
-                1.0));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath.hypot(Double.NEGATIVE_INFINITY,
-                123.324));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath.hypot(-758.2587,
-                Double.POSITIVE_INFINITY));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath.hypot(5687.21,
-                Double.NEGATIVE_INFINITY));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath.hypot(Double.POSITIVE_INFINITY,
-                Double.NEGATIVE_INFINITY));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath.hypot(Double.NEGATIVE_INFINITY,
-                Double.POSITIVE_INFINITY));
-        assertTrue("Should return NaN", Double.isNaN(StrictMath.hypot(Double.NaN,
-                2342301.89843)));
-        assertTrue("Should return NaN", Double.isNaN(StrictMath.hypot(-345.2680,
-                Double.NaN)));
-
-        assertEquals("Should return 2396424.905416697", 2396424.905416697, StrictMath
-                .hypot(12322.12, -2396393.2258));
-        assertEquals("Should return 138.16958070558556", 138.16958070558556,
-                StrictMath.hypot(-138.16951162, 0.13817035864));
-        assertEquals("Should return 1.7976931348623157E308",
-                1.7976931348623157E308, StrictMath.hypot(Double.MAX_VALUE, 211370.35));
-        assertEquals("Should return 5413.7185", 5413.7185, StrictMath.hypot(
-                -5413.7185, Double.MIN_VALUE));
-
-    }
-
-    /**
-     * @tests java.lang.StrictMath#IEEEremainder(double,double)
-     */
-    @SmallTest
-    public void testIEEEremainderDD() {
-        // Test for method double java.lang.StrictMath.IEEEremainder(double,
-        // double)
-        assertEquals("Incorrect remainder returned", 0.0, StrictMath.IEEEremainder(
-                1.0, 1.0), 0.0);
-        assertTrue(
-                "Incorrect remainder returned",
-                StrictMath.IEEEremainder(1.32, 89.765) >= 1.4705063220631647E-2
-                        || StrictMath.IEEEremainder(1.32, 89.765) >= 1.4705063220631649E-2);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#log(double)
-     */
-    @SmallTest
-    public void testLogD() {
-        // Test for method double java.lang.StrictMath.log(double)
-        for (double d = 10; d >= -10; d -= 0.5) {
-            double answer = StrictMath.log(StrictMath.exp(d));
-            assertTrue("Answer does not equal expected answer for d = " + d
-                    + " answer = " + answer,
-                    StrictMath.abs(answer - d) <= StrictMath
-                            .abs(d * 0.00000001));
-        }
-    }
-
-    /**
-     * @tests java.lang.StrictMath#log10(double)
-     */
-    @SuppressWarnings("boxing")
-    @SmallTest
-    public void testLog10D() {
-        // Test for special cases        
-        assertTrue("Should return NaN", Double.isNaN(StrictMath
-                .log10(Double.NaN)));
-        assertTrue("Should return NaN", Double.isNaN(StrictMath
-                .log10(-2541.05745687234187532)));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath
-                .log10(Double.POSITIVE_INFINITY));
-        assertEquals("Should return NEGATIVE_INFINITY",
-                Double.NEGATIVE_INFINITY, StrictMath.log10(0.0));
-        assertEquals("Should return NEGATIVE_INFINITY",
-                Double.NEGATIVE_INFINITY, StrictMath.log10(+0.0));
-        assertEquals("Should return NEGATIVE_INFINITY",
-                Double.NEGATIVE_INFINITY, StrictMath.log10(-0.0));
-        assertEquals("Should return 14.0", 14.0, StrictMath.log10(StrictMath
-                .pow(10, 14)));
-
-        assertEquals("Should return 3.7389561269540406", 3.7389561269540406,
-                StrictMath.log10(5482.2158));
-        assertEquals("Should return 14.661551142893833", 14.661551142893833,
-                StrictMath.log10(458723662312872.125782332587));
-        assertEquals("Should return -0.9083828622192334", -0.9083828622192334,
-                StrictMath.log10(0.12348583358871));
-        assertEquals("Should return 308.25471555991675", 308.25471555991675,
-                StrictMath.log10(Double.MAX_VALUE));
-        assertEquals("Should return -323.3062153431158", -323.3062153431158,
-                StrictMath.log10(Double.MIN_VALUE));
-    }
-
-    /**
-     * @tests java.lang.StrictMath#log1p(double)
-     */
-    @SuppressWarnings("boxing")
-    @SmallTest
-    public void testLog1pD() {
-        // Test for special cases
-        assertTrue("Should return NaN", Double.isNaN(StrictMath
-                .log1p(Double.NaN)));
-        assertTrue("Should return NaN", Double.isNaN(StrictMath
-                .log1p(-32.0482175)));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath
-                .log1p(Double.POSITIVE_INFINITY));
-        assertEquals(Double.doubleToLongBits(0.0), Double
-                .doubleToLongBits(StrictMath.log1p(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(StrictMath.log1p(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(StrictMath.log1p(-0.0)));
-
-        assertEquals("Should return -0.2941782295312541", -0.2941782295312541,
-                StrictMath.log1p(-0.254856327));
-        assertEquals("Should return 7.368050685564151", 7.368050685564151,
-                StrictMath.log1p(1583.542));
-        assertEquals("Should return 0.4633708685409921", 0.4633708685409921,
-                StrictMath.log1p(0.5894227));
-        assertEquals("Should return 709.782712893384", 709.782712893384,
-                StrictMath.log1p(Double.MAX_VALUE));
-        assertEquals("Should return Double.MIN_VALUE", Double.MIN_VALUE,
-                StrictMath.log1p(Double.MIN_VALUE));
-    }
-
-    /**
-     * @tests java.lang.StrictMath#max(double,double)
-     */
-    @SmallTest
-    public void testMaxDD() {
-        // Test for method double java.lang.StrictMath.max(double, double)
-        assertEquals("Incorrect double max value", 1908897.6000089, StrictMath.max(
-                -1908897.6000089, 1908897.6000089), 0D);
-        assertEquals("Incorrect double max value", 1908897.6000089, StrictMath.max(2.0,
-                1908897.6000089), 0D);
-        assertEquals("Incorrect double max value", -2.0, StrictMath.max(-2.0,
-                -1908897.6000089), 0D);
-
-    }
-
-    /**
-     * @tests java.lang.StrictMath#max(float,float)
-     */
-    @SmallTest
-    public void testMaxFF() {
-        // Test for method float java.lang.StrictMath.max(float, float)
-        assertTrue("Incorrect float max value", StrictMath.max(-1908897.600f,
-                1908897.600f) == 1908897.600f);
-        assertTrue("Incorrect float max value", StrictMath.max(2.0f,
-                1908897.600f) == 1908897.600f);
-        assertTrue("Incorrect float max value", StrictMath.max(-2.0f,
-                -1908897.600f) == -2.0f);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#max(int,int)
-     */
-    @SmallTest
-    public void testMaxII() {
-        // Test for method int java.lang.StrictMath.max(int, int)
-        assertEquals("Incorrect int max value", 19088976, StrictMath.max(-19088976,
-                19088976));
-        assertEquals("Incorrect int max value",
-                19088976, StrictMath.max(20, 19088976));
-        assertEquals("Incorrect int max value",
-                -20, StrictMath.max(-20, -19088976));
-    }
-
-    /**
-     * @tests java.lang.StrictMath#max(long,long)
-     */
-    @SmallTest
-    public void testMaxJJ() {
-        // Test for method long java.lang.StrictMath.max(long, long)
-        assertEquals("Incorrect long max value", 19088976000089L, StrictMath.max(-19088976000089L,
-                19088976000089L));
-        assertEquals("Incorrect long max value", 19088976000089L, StrictMath.max(20,
-                19088976000089L));
-        assertEquals("Incorrect long max value", -20, StrictMath.max(-20,
-                -19088976000089L));
-    }
-
-    /**
-     * @tests java.lang.StrictMath#min(double,double)
-     */
-    @SmallTest
-    public void testMinDD() {
-        // Test for method double java.lang.StrictMath.min(double, double)
-        assertEquals("Incorrect double min value", -1908897.6000089, StrictMath.min(
-                -1908897.6000089, 1908897.6000089), 0D);
-        assertEquals("Incorrect double min value", 2.0, StrictMath.min(2.0,
-                1908897.6000089), 0D);
-        assertEquals("Incorrect double min value", -1908897.6000089, StrictMath.min(-2.0,
-                -1908897.6000089), 0D);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#min(float,float)
-     */
-    @SmallTest
-    public void testMinFF() {
-        // Test for method float java.lang.StrictMath.min(float, float)
-        assertTrue("Incorrect float min value", StrictMath.min(-1908897.600f,
-                1908897.600f) == -1908897.600f);
-        assertTrue("Incorrect float min value", StrictMath.min(2.0f,
-                1908897.600f) == 2.0f);
-        assertTrue("Incorrect float min value", StrictMath.min(-2.0f,
-                -1908897.600f) == -1908897.600f);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#min(int,int)
-     */
-    @SmallTest
-    public void testMinII() {
-        // Test for method int java.lang.StrictMath.min(int, int)
-        assertEquals("Incorrect int min value", -19088976, StrictMath.min(-19088976,
-                19088976));
-        assertEquals("Incorrect int min value",
-                20, StrictMath.min(20, 19088976));
-        assertEquals("Incorrect int min value",
-                -19088976, StrictMath.min(-20, -19088976));
-
-    }
-
-    /**
-     * @tests java.lang.StrictMath#min(long,long)
-     */
-    @SmallTest
-    public void testMinJJ() {
-        // Test for method long java.lang.StrictMath.min(long, long)
-        assertEquals("Incorrect long min value", -19088976000089L, StrictMath.min(-19088976000089L,
-                19088976000089L));
-        assertEquals("Incorrect long min value", 20, StrictMath.min(20,
-                19088976000089L));
-        assertEquals("Incorrect long min value", -19088976000089L, StrictMath.min(-20,
-                -19088976000089L));
-    }
-
-    /**
-     * @tests java.lang.StrictMath#pow(double,double)
-     */
-    @SmallTest
-    public void testPowDD() {
-        // Test for method double java.lang.StrictMath.pow(double, double)
-        assertTrue("pow returned incorrect value",
-                (long) StrictMath.pow(2, 8) == 256l);
-        assertTrue("pow returned incorrect value",
-                StrictMath.pow(2, -8) == 0.00390625d);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#rint(double)
-     */
-    @SmallTest
-    public void testRintD() {
-        // Test for method double java.lang.StrictMath.rint(double)
-        assertEquals("Failed to round properly - up to odd",
-                3.0, StrictMath.rint(2.9), 0D);
-        assertTrue("Failed to round properly - NaN", Double.isNaN(StrictMath
-                .rint(Double.NaN)));
-        assertEquals("Failed to round properly down  to even", 2.0, StrictMath
-                .rint(2.1), 0D);
-        assertTrue("Failed to round properly " + 2.5 + " to even", StrictMath
-                .rint(2.5) == 2.0);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#round(double)
-     */
-    @SmallTest
-    public void testRoundD() {
-        // Test for method long java.lang.StrictMath.round(double)
-        assertEquals("Incorrect rounding of a float",
-                -91, StrictMath.round(-90.89d));
-    }
-
-    /**
-     * @tests java.lang.StrictMath#round(float)
-     */
-    @SmallTest
-    public void testRoundF() {
-        // Test for method int java.lang.StrictMath.round(float)
-        assertEquals("Incorrect rounding of a float",
-                -91, StrictMath.round(-90.89f));
-    }
-
-    /**
-     * @tests java.lang.StrictMath#signum(double)
-     */
-    @SmallTest
-    public void testSignumD() {
-        assertTrue(Double.isNaN(StrictMath.signum(Double.NaN)));
-        assertEquals(Double.doubleToLongBits(0.0), Double
-                .doubleToLongBits(StrictMath.signum(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(StrictMath.signum(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(StrictMath.signum(-0.0)));
-
-        assertEquals(1.0, StrictMath.signum(253681.2187962), 0D);
-        assertEquals(-1.0, StrictMath.signum(-125874693.56), 0D);
-        assertEquals(1.0, StrictMath.signum(1.2587E-308), 0D);
-        assertEquals(-1.0, StrictMath.signum(-1.2587E-308), 0D);
-
-        assertEquals(1.0, StrictMath.signum(Double.MAX_VALUE), 0D);
-        assertEquals(1.0, StrictMath.signum(Double.MIN_VALUE), 0D);
-        assertEquals(-1.0, StrictMath.signum(-Double.MAX_VALUE), 0D);
-        assertEquals(-1.0, StrictMath.signum(-Double.MIN_VALUE), 0D);
-        assertEquals(1.0, StrictMath.signum(Double.POSITIVE_INFINITY), 0D);
-        assertEquals(-1.0, StrictMath.signum(Double.NEGATIVE_INFINITY), 0D);
-
-    }
-
-    /**
-     * @tests java.lang.StrictMath#signum(float)
-     */
-    @SmallTest
-    public void testSignumF() {
-        assertTrue(Float.isNaN(StrictMath.signum(Float.NaN)));
-        assertEquals(Float.floatToIntBits(0.0f), Float
-                .floatToIntBits(StrictMath.signum(0.0f)));
-        assertEquals(Float.floatToIntBits(+0.0f), Float
-                .floatToIntBits(StrictMath.signum(+0.0f)));
-        assertEquals(Float.floatToIntBits(-0.0f), Float
-                .floatToIntBits(StrictMath.signum(-0.0f)));
-
-        assertEquals(1.0f, StrictMath.signum(253681.2187962f), 0f);
-        assertEquals(-1.0f, StrictMath.signum(-125874693.56f), 0f);
-        assertEquals(1.0f, StrictMath.signum(1.2587E-11f), 0f);
-        assertEquals(-1.0f, StrictMath.signum(-1.2587E-11f), 0f);
-
-        assertEquals(1.0f, StrictMath.signum(Float.MAX_VALUE), 0f);
-        assertEquals(1.0f, StrictMath.signum(Float.MIN_VALUE), 0f);
-        assertEquals(-1.0f, StrictMath.signum(-Float.MAX_VALUE), 0f);
-        assertEquals(-1.0f, StrictMath.signum(-Float.MIN_VALUE), 0f);
-        assertEquals(1.0f, StrictMath.signum(Float.POSITIVE_INFINITY), 0f);
-        assertEquals(-1.0f, StrictMath.signum(Float.NEGATIVE_INFINITY), 0f);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#sin(double)
-     */
-    @SmallTest
-    public void testSinD() {
-        // Test for method double java.lang.StrictMath.sin(double)
-        assertTrue("Returned incorrect sine", StrictMath.sin(StrictMath
-                .asin(OPP / HYP)) == OPP / HYP);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#sinh(double)
-     */
-    @SmallTest
-    public void testSinhD() {
-        // Test for special situations
-        assertTrue(Double.isNaN(StrictMath.sinh(Double.NaN)));
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath
-                .sinh(Double.POSITIVE_INFINITY), 0D);
-        assertEquals("Should return NEGATIVE_INFINITY",
-                Double.NEGATIVE_INFINITY, StrictMath
-                .sinh(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals(Double.doubleToLongBits(0.0), Double
-                .doubleToLongBits(StrictMath.sinh(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(StrictMath.sinh(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(StrictMath.sinh(-0.0)));
-
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath.sinh(1234.56), 0D);
-        assertEquals("Should return NEGATIVE_INFINITY",
-                Double.NEGATIVE_INFINITY, StrictMath.sinh(-1234.56), 0D);
-        assertEquals("Should return 1.0000000000001666E-6",
-                1.0000000000001666E-6, StrictMath.sinh(0.000001), 0D);
-        assertEquals("Should return -1.0000000000001666E-6",
-                -1.0000000000001666E-6, StrictMath.sinh(-0.000001), 0D);
-        assertEquals("Should return 5.115386441963859", 5.115386441963859,
-                StrictMath.sinh(2.33482), 0D);
-        assertEquals("Should return POSITIVE_INFINITY",
-                Double.POSITIVE_INFINITY, StrictMath.sinh(Double.MAX_VALUE), 0D);
-        assertEquals("Should return 4.9E-324", 4.9E-324, StrictMath
-                .sinh(Double.MIN_VALUE), 0D);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#sqrt(double)
-     */
-    @SmallTest
-    public void testSqrtD() {
-        // Test for method double java.lang.StrictMath.sqrt(double)
-        assertEquals("Incorrect root returned1",
-                2, StrictMath.sqrt(StrictMath.pow(StrictMath.sqrt(2), 4)), 0.0);
-        assertEquals("Incorrect root returned2", 7, StrictMath.sqrt(49), 0.0);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#tan(double)
-     */
-    @SmallTest
-    public void testTanD() {
-        // Test for method double java.lang.StrictMath.tan(double)
-        assertTrue(
-                "Returned incorrect tangent: ",
-                StrictMath.tan(StrictMath.atan(1.0)) <= 1.0
-                        || StrictMath.tan(StrictMath.atan(1.0)) >= 9.9999999999999983E-1);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#tanh(double)
-     */
-    @SmallTest
-    public void testTanhD() {
-        // Test for special situations
-        assertTrue(Double.isNaN(StrictMath.tanh(Double.NaN)));
-        assertEquals("Should return +1.0", +1.0, StrictMath
-                .tanh(Double.POSITIVE_INFINITY), 0D);
-        assertEquals("Should return -1.0", -1.0, StrictMath
-                .tanh(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals(Double.doubleToLongBits(0.0), Double
-                .doubleToLongBits(StrictMath.tanh(0.0)));
-        assertEquals(Double.doubleToLongBits(+0.0), Double
-                .doubleToLongBits(StrictMath.tanh(+0.0)));
-        assertEquals(Double.doubleToLongBits(-0.0), Double
-                .doubleToLongBits(StrictMath.tanh(-0.0)));
-
-        assertEquals("Should return 1.0", 1.0, StrictMath.tanh(1234.56), 0D);
-        assertEquals("Should return -1.0", -1.0, StrictMath.tanh(-1234.56), 0D);
-        assertEquals("Should return 9.999999999996666E-7",
-                9.999999999996666E-7, StrictMath.tanh(0.000001), 0D);
-        assertEquals("Should return 0.981422884124941", 0.981422884124941,
-                StrictMath.tanh(2.33482), 0D);
-        assertEquals("Should return 1.0", 1.0, StrictMath
-                .tanh(Double.MAX_VALUE), 0D);
-        assertEquals("Should return 4.9E-324", 4.9E-324, StrictMath
-                .tanh(Double.MIN_VALUE), 0D);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#random()
-     */
-    @MediumTest
-    public void testRandom() {
-        // There isn't a place for these tests so just stick them here
-        assertEquals("Wrong value E",
-                4613303445314885481L, Double.doubleToLongBits(StrictMath.E));
-        assertEquals("Wrong value PI",
-                4614256656552045848L, Double.doubleToLongBits(StrictMath.PI));
-
-        for (int i = 500; i >= 0; i--) {
-            double d = StrictMath.random();
-            assertTrue("Generated number is out of range: " + d, d >= 0.0
-                    && d < 1.0);
-        }
-    }
-
-    /**
-     * @tests java.lang.StrictMath#toRadians(double)
-     */
-    @MediumTest
-    public void testToRadiansD() {
-        for (double d = 500; d >= 0; d -= 1.0) {
-            double converted = StrictMath.toDegrees(StrictMath.toRadians(d));
-            assertTrue("Converted number not equal to original. d = " + d,
-                    converted >= d * 0.99999999 && converted <= d * 1.00000001);
-        }
-    }
-
-    /**
-     * @tests java.lang.StrictMath#toDegrees(double)
-     */
-    @MediumTest
-    public void testToDegreesD() {
-        for (double d = 500; d >= 0; d -= 1.0) {
-            double converted = StrictMath.toRadians(StrictMath.toDegrees(d));
-            assertTrue("Converted number not equal to original. d = " + d,
-                    converted >= d * 0.99999999 && converted <= d * 1.00000001);
-        }
-    }
-
-    /**
-     * @tests java.lang.StrictMath#ulp(double)
-     */
-    @SuppressWarnings("boxing")
-    @SmallTest
-    public void testUlp_D() {
-        // Test for special cases
-        assertTrue("Should return NaN", Double
-                .isNaN(StrictMath.ulp(Double.NaN)));
-        assertEquals("Returned incorrect value", Double.POSITIVE_INFINITY,
-                StrictMath.ulp(Double.POSITIVE_INFINITY), 0D);
-        assertEquals("Returned incorrect value", Double.POSITIVE_INFINITY,
-                StrictMath.ulp(Double.NEGATIVE_INFINITY), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
-                .ulp(0.0), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
-                .ulp(+0.0), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
-                .ulp(-0.0), 0D);
-        assertEquals("Returned incorrect value", StrictMath.pow(2, 971),
-                StrictMath.ulp(Double.MAX_VALUE), 0D);
-        assertEquals("Returned incorrect value", StrictMath.pow(2, 971),
-                StrictMath.ulp(-Double.MAX_VALUE), 0D);
-
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
-                .ulp(Double.MIN_VALUE), 0D);
-        assertEquals("Returned incorrect value", Double.MIN_VALUE, StrictMath
-                .ulp(-Double.MIN_VALUE), 0D);
-
-        assertEquals("Returned incorrect value", 2.220446049250313E-16,
-                StrictMath.ulp(1.0), 0D);
-        assertEquals("Returned incorrect value", 2.220446049250313E-16,
-                StrictMath.ulp(-1.0), 0D);
-        assertEquals("Returned incorrect value", 2.2737367544323206E-13,
-                StrictMath.ulp(1153.0), 0D);
-    }
-
-    /**
-     * @tests java.lang.StrictMath#ulp(float)
-     */
-    @SuppressWarnings("boxing")
-    @SmallTest
-    public void testUlpF() {
-        // Test for special cases
-        assertTrue("Should return NaN", Float.isNaN(StrictMath.ulp(Float.NaN)));
-        assertEquals("Returned incorrect value", Float.POSITIVE_INFINITY,
-                StrictMath.ulp(Float.POSITIVE_INFINITY), 0f);
-        assertEquals("Returned incorrect value", Float.POSITIVE_INFINITY,
-                StrictMath.ulp(Float.NEGATIVE_INFINITY), 0f);
-        assertEquals("Returned incorrect value", Float.MIN_VALUE, StrictMath
-                .ulp(0.0f), 0f);
-        assertEquals("Returned incorrect value", Float.MIN_VALUE, StrictMath
-                .ulp(+0.0f), 0f);
-        assertEquals("Returned incorrect value", Float.MIN_VALUE, StrictMath
-                .ulp(-0.0f), 0f);
-        assertEquals("Returned incorrect value", 2.028241E31f, StrictMath
-                .ulp(Float.MAX_VALUE), 0f);
-        assertEquals("Returned incorrect value", 2.028241E31f, StrictMath
-                .ulp(-Float.MAX_VALUE), 0f);
-
-        assertEquals("Returned incorrect value", 1.4E-45f, StrictMath
-                .ulp(Float.MIN_VALUE), 0f);
-        assertEquals("Returned incorrect value", 1.4E-45f, StrictMath
-                .ulp(-Float.MIN_VALUE), 0f);
-
-        assertEquals("Returned incorrect value", 1.1920929E-7f, StrictMath
-                .ulp(1.0f), 0f);
-        assertEquals("Returned incorrect value", 1.1920929E-7f, StrictMath
-                .ulp(-1.0f), 0f);
-        assertEquals("Returned incorrect value", 1.2207031E-4f, StrictMath
-                .ulp(1153.0f), 0f);
-        assertEquals("Returned incorrect value", 5.6E-45f, Math
-                .ulp(9.403954E-38f), 0f);
-    }
-}
diff --git a/tests/CoreTests/android/core/StringReaderTest.java b/tests/CoreTests/android/core/StringReaderTest.java
deleted file mode 100644
index 66b3e81..0000000
--- a/tests/CoreTests/android/core/StringReaderTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.StringReader;
-import android.test.suitebuilder.annotation.SmallTest;
-
-public class StringReaderTest extends TestCase {
-
-    @SmallTest
-    public void testStringReader() throws Exception {
-        String str = "AbCdEfGhIjKlMnOpQrStUvWxYz";
-
-        StringReader a = new StringReader(str);
-        StringReader b = new StringReader(str);
-        StringReader c = new StringReader(str);
-        StringReader d = new StringReader(str);
-
-        assertEquals(str, IOUtil.read(a));
-        assertEquals("AbCdEfGhIj", IOUtil.read(b, 10));
-        assertEquals("bdfhjlnprtvxz", IOUtil.skipRead(c));
-        assertEquals("AbCdEfGdEfGhIjKlMnOpQrStUvWxYz", IOUtil.markRead(d, 3, 4));
-    }
-}
diff --git a/tests/CoreTests/android/core/StringWriterTest.java b/tests/CoreTests/android/core/StringWriterTest.java
deleted file mode 100644
index fed2221..0000000
--- a/tests/CoreTests/android/core/StringWriterTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.StringWriter;
-import android.test.suitebuilder.annotation.SmallTest;
-
-public class StringWriterTest extends TestCase {
-
-    @SmallTest
-    public void testStringWriter() throws Exception {
-        String str = "AbCdEfGhIjKlMnOpQrStUvWxYz";
-        StringWriter a = new StringWriter(10);
-
-        a.write(str, 0, 26);
-        a.write('X');
-
-        assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzX", a.toString());
-
-        a.write("alphabravodelta", 5, 5);
-        a.append('X');
-        assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzXbravoX", a.toString());
-        a.append("omega");
-        assertEquals("AbCdEfGhIjKlMnOpQrStUvWxYzXbravoXomega", a.toString());
-    }
-}
diff --git a/tests/CoreTests/android/core/TreeMapTest.java b/tests/CoreTests/android/core/TreeMapTest.java
deleted file mode 100644
index 229d86d..0000000
--- a/tests/CoreTests/android/core/TreeMapTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.util.HashMap;
-import java.util.Random;
-import java.util.TreeMap;
-import android.test.suitebuilder.annotation.LargeTest;
-
-/**
- * Tests for basic functinality of TreeMaps
- */
-public class TreeMapTest extends TestCase {
-
-    private Random mRandom = new Random(1);
-
-    private static final boolean SPEW = false;
-
-    @LargeTest
-    public void testTreeMap() {
-        for (int i = 0; i < 10; i++) {
-            if (SPEW) System.out.println("Running doTest cycle #" + (i + 1));
-            doTest();
-        }
-    }
-
-    private void doTest() {
-        TreeMap<Integer, String> tm = new TreeMap<Integer, String>();
-        HashMap<Integer, String> hm = new HashMap<Integer, String>();
-
-        int minVal = Integer.MAX_VALUE;
-        int maxVal = Integer.MIN_VALUE;
-
-        for (int i = 0; i < 100; i++) {
-            int val = mRandom.nextInt(1000);
-            if (SPEW) System.out.println("Adding val = " + val);
-            if (val < minVal) {
-                minVal = val;
-            }
-            if (val > maxVal) {
-                maxVal = val;
-            }
-            tm.put(new Integer(val), "V:" + val);
-            hm.put(new Integer(val), "V:" + val);
-
-            if (SPEW) System.out.println("tm = " + tm);
-
-            if (SPEW) System.out.println("tm.size() = " + tm.size());
-            if (SPEW) System.out.println("hm.size() = " + hm.size());
-            assertEquals(tm.size(), hm.size());
-
-            if (SPEW) System.out.println("tm.firstKey() = " + tm.firstKey());
-            if (SPEW) System.out.println("minVal = " + minVal);
-            if (SPEW) System.out.println("tm.lastKey() = " + tm.lastKey());
-            if (SPEW) System.out.println("maxVal = " + maxVal);
-            assertEquals(minVal, tm.firstKey().intValue());
-            assertEquals(maxVal, tm.lastKey().intValue());
-        }
-
-        // Check for equality
-        for (int val = 0; val < 1000; val++) {
-            Integer vv = new Integer(val);
-            String tms = tm.get(vv);
-            String hms = hm.get(vv);
-            assertEquals(tms, hms);
-        }
-
-        for (int i = 0; i < 1000; i++) {
-            int val = mRandom.nextInt(1000);
-            if (SPEW) System.out.println("Removing val = " + val);
-
-            String tms = tm.remove(new Integer(val));
-            String hms = hm.remove(new Integer(val));
-
-            if (SPEW) System.out.println("tm = " + tm);
-
-            assertEquals(tm.size(), hm.size());
-            assertEquals(tms, hms);
-        }
-
-        // Check for equality
-        for (int val = 0; val < 1000; val++) {
-            Integer vv = new Integer(val);
-            String tms = tm.get(vv);
-            String hms = hm.get(vv);
-            assertEquals(tms, hms);
-        }
-    }
-}
diff --git a/tests/CoreTests/android/core/URITest.java b/tests/CoreTests/android/core/URITest.java
deleted file mode 100644
index 3b821d8..0000000
--- a/tests/CoreTests/android/core/URITest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import android.test.suitebuilder.annotation.SmallTest;
-
-public class URITest extends TestCase {
-
-    @SmallTest
-    public void testConstruct() throws Exception {
-        construct("http://www.google.com/this/is-the/path?query#fragment",
-                "www.google.com", "/this/is-the/path", true);
-    }
-
-    private static void construct(String str, String host, String path, boolean absolute)
-            throws URISyntaxException {
-        URI uri = new URI(str);
-        assertEquals(host, uri.getHost());
-        assertEquals(path, uri.getPath());
-        assertEquals(absolute, uri.isAbsolute());
-    }
-
-    @SmallTest
-    public void testResolve() throws Exception {
-        resolve("http://www.google.com/your",
-                "mom",
-                "http://www.google.com/mom");
-    }
-
-    private static void resolve(String base, String uri, String expected) {
-        URI b = URI.create(base);
-        URI resolved = b.resolve(uri);
-//        System.out.println("base=" + base + " uri=" + uri
-//                + " resolved=" + resolved);
-        assertEquals(expected, resolved.toString());
-    }
-}
diff --git a/tests/CoreTests/android/core/ZipFileTest.java b/tests/CoreTests/android/core/ZipFileTest.java
deleted file mode 100644
index 04b476b..0000000
--- a/tests/CoreTests/android/core/ZipFileTest.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Enumeration;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import java.util.zip.ZipOutputStream;
-import android.test.suitebuilder.annotation.MediumTest;
-
-
-/**
- * Basic tests for ZipFile.
- */
-public class ZipFileTest extends TestCase {
-    private static final int SAMPLE_SIZE = 128 * 1024;
-
-    @MediumTest
-    public void testZipFile() throws Exception {
-
-        File file = File.createTempFile("ZipFileTest", ".zip");
-        try {
-            // create a test file; assume it's not going to collide w/anything
-            FileOutputStream outStream = new FileOutputStream(file);
-            createCompressedZip(outStream);
-//            System.out.println("CREATED " + file);
-
-            scanZip(file.getPath());
-            read2(file.getPath());
-        } finally {
-            file.delete();
-        }
-    }
-
-    /*
-     * stepStep == 0 --> >99% compression
-     * stepStep == 1 --> ~30% compression
-     * stepStep == 2 --> no compression
-     */
-    static byte[] makeSampleFile(int stepStep) throws IOException {
-        byte[] sample = new byte[SAMPLE_SIZE];
-        byte val, step;
-        int i, j, offset;
-
-        val = 0;
-        step = 1;
-        offset = 0;
-        for (i = 0; i < SAMPLE_SIZE / 256; i++) {
-            for (j = 0; j < 256; j++) {
-                sample[offset++] = val;
-                val += step;
-            }
-
-            step += stepStep;
-        }
-
-        return sample;
-    }
-
-    static void createCompressedZip(OutputStream bytesOut) throws IOException {
-        ZipOutputStream out = new ZipOutputStream(bytesOut);
-        try {
-            int i;
-
-            for (i = 0; i < 3; i++) {
-                byte[] input = makeSampleFile(i);
-                ZipEntry newEntry = new ZipEntry("file-" + i);
-
-                if (i != 1) {
-                    newEntry.setComment("this is file " + i);
-                }
-                out.putNextEntry(newEntry);
-                out.write(input, 0, input.length);
-                out.closeEntry();
-            }
-
-            out.setComment("This is a lovely compressed archive!");
-        } finally {
-            out.close();
-        }
-    }
-
-    static void scanZip(String fileName) throws IOException {
-        ZipFile zipFile = new ZipFile(fileName);
-        Enumeration fileList;
-        int idx = 0;
-
-//        System.out.println("Contents of " + zipFile + ":");
-        for (fileList = zipFile.entries(); fileList.hasMoreElements();) {
-            ZipEntry entry = (ZipEntry) fileList.nextElement();
-//            System.out.println("  " + entry.getName());
-            assertEquals(entry.getName(), "file-" + idx);
-            idx++;
-        }
-
-        zipFile.close();
-    }
-
-    /*
-     * Read compressed data from two different entries at the same time,
-     * to verify that the streams aren't getting confused.  If we do
-     * something wrong, the inflater will choke and throw a ZipException.
-     *
-     * This doesn't test synchronization in multi-threaded use.
-     */
-    static void read2(String fileName) throws IOException {
-        ZipFile zipFile;
-        ZipEntry entry1, entry2;
-        byte buf[] = new byte[16384];
-        InputStream stream1, stream2;
-        int len, totalLen1, totalLen2;
-
-        /* use file-1 and file-2 because the compressed data is large */
-        zipFile = new ZipFile(fileName);
-        entry1 = zipFile.getEntry("file-1");
-        entry2 = zipFile.getEntry("file-2");
-
-        /* make sure we got the right thing */
-        assertEquals("file-1", entry1.getName());
-        assertEquals("file-2", entry2.getName());
-
-        /* create streams */
-        stream1 = zipFile.getInputStream(entry1);
-        stream2 = zipFile.getInputStream(entry2);
-
-        /*
-         * Read a piece of file #1.
-         */
-        totalLen1 = stream1.read(buf);
-        assertTrue("initial read failed on #1", totalLen1 >= 0);
-
-        /*
-         * Read a piece of file #2.
-         */
-        totalLen2 = stream2.read(buf);
-        assertTrue("initial read failed on #2", totalLen2 >= 0);
-
-        /*
-         * Read the rest of file #1, and close the stream.
-         *
-         * If our streams are crossed up, we'll fail here.
-         */
-        while ((len = stream1.read(buf)) > 0) {
-            totalLen1 += len;
-        }
-        assertEquals(SAMPLE_SIZE, totalLen1);
-        stream1.close();
-
-        /*
-         * Read the rest of file #2, and close the stream.
-         */
-        while ((len = stream2.read(buf)) > 0) {
-            totalLen2 += len;
-        }
-        assertEquals(SAMPLE_SIZE, totalLen2);
-        stream2.close();
-
-        /*
-         * Open a new one.
-         */
-        stream1 = zipFile.getInputStream(zipFile.getEntry("file-0"));
-
-        /*
-         * Close the ZipFile. According to the RI, none if its InputStreams can
-         * be read after this point.
-         */
-        zipFile.close();
-        
-        Exception error = null;
-        try {
-            stream1.read(buf);
-        } catch (Exception ex) {
-            error = ex;
-        }
-        
-        assertNotNull("ZipFile shouldn't allow reading of closed files.", error);
-    }
-}
-
diff --git a/tests/CoreTests/android/core/ZipStreamTest.java b/tests/CoreTests/android/core/ZipStreamTest.java
deleted file mode 100644
index 74cfe82..0000000
--- a/tests/CoreTests/android/core/ZipStreamTest.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.core;
-
-import junit.framework.TestCase;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-import java.util.zip.ZipOutputStream;
-import android.test.suitebuilder.annotation.LargeTest;
-
-/**
- * Basic tests for ZipStream
- */
-public class ZipStreamTest extends TestCase {
-
-    @LargeTest
-    public void testZipStream() throws Exception {
-        ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
-        createCompressedZip(bytesOut);
-
-        byte[] zipData = bytesOut.toByteArray();
-
-        /*
-        FileOutputStream outFile = new FileOutputStream("/tmp/foo.zip");
-        outFile.write(zipData, 0, zipData.length);
-        outFile.close();
-        */
-
-        /*
-        FileInputStream inFile = new FileInputStream("/tmp/foo.zip");
-        int inputLength = inFile.available();
-        zipData = new byte[inputLength];
-        if (inFile.read(zipData) != inputLength)
-            throw new RuntimeException();
-        inFile.close();
-        */
-
-        ByteArrayInputStream bytesIn = new ByteArrayInputStream(zipData);
-        scanZip(bytesIn);
-
-        bytesOut = new ByteArrayOutputStream();
-        createUncompressedZip(bytesOut);
-
-        zipData = bytesOut.toByteArray();
-
-        bytesIn = new ByteArrayInputStream(zipData);
-        scanZip(bytesIn);
-    }
-
-    /*
-     * stepStep == 0 --> >99% compression
-     * stepStep == 1 --> ~30% compression
-     * stepStep == 2 --> no compression
-     */
-    private static byte[] makeSampleFile(int stepStep) throws IOException {
-        byte[] sample = new byte[128 * 1024];
-        byte val, step;
-        int i, j, offset;
-
-        val = 0;
-        step = 1;
-        offset = 0;
-        for (i = 0; i < (128 * 1024) / 256; i++) {
-            for (j = 0; j < 256; j++) {
-                sample[offset++] = val;
-                val += step;
-            }
-
-            step += stepStep;
-        }
-
-        return sample;
-    }
-
-    private static void createCompressedZip(ByteArrayOutputStream bytesOut) throws IOException {
-        ZipOutputStream out = new ZipOutputStream(bytesOut);
-        try {
-            int i;
-
-            for (i = 0; i < 3; i++) {
-                byte[] input = makeSampleFile(i);
-                ZipEntry newEntry = new ZipEntry("file-" + i);
-
-                if (i != 1)
-                    newEntry.setComment("this is file " + i);
-                out.putNextEntry(newEntry);
-                out.write(input, 0, input.length);
-                out.closeEntry();
-            }
-
-            out.setComment("This is a lovely compressed archive!");
-        } finally {
-            out.close();
-        }
-    }
-
-    private static void createUncompressedZip(ByteArrayOutputStream bytesOut) throws IOException {
-        ZipOutputStream out = new ZipOutputStream(bytesOut);
-        try {
-            long[] crcs = {0x205fbff3, 0x906fae57L, 0x2c235131};
-            int i;
-
-            for (i = 0; i < 3; i++) {
-                byte[] input = makeSampleFile(i);
-                ZipEntry newEntry = new ZipEntry("file-" + i);
-
-                if (i != 1)
-                    newEntry.setComment("this is file " + i);
-                newEntry.setMethod(ZipEntry.STORED);
-                newEntry.setSize(128 * 1024);
-                newEntry.setCrc(crcs[i]);
-                out.putNextEntry(newEntry);
-                out.write(input, 0, input.length);
-                out.closeEntry();
-            }
-
-            out.setComment("This is a lovely, but uncompressed, archive!");
-        } finally {
-            out.close();
-        }
-    }
-
-    private static void scanZip(ByteArrayInputStream bytesIn) throws IOException {
-        ZipInputStream in = new ZipInputStream(bytesIn);
-        try {
-            int i;
-
-            for (i = 0; i < 3; i++) {
-                ZipEntry entry = in.getNextEntry();
-                ByteArrayOutputStream contents = new ByteArrayOutputStream();
-                byte[] buf = new byte[4096];
-                int len, totalLen = 0;
-
-                while ((len = in.read(buf)) > 0) {
-                    contents.write(buf, 0, len);
-                    totalLen += len;
-                }
-
-                assertEquals(128 * 1024, totalLen);
-
-//                System.out.println("ZipStreamTest: name='" + entry.getName()
-//                        + "', zero=" + contents.toByteArray()[0]
-//                        + ", tfs=" + contents.toByteArray()[257]
-//                        + ", crc=" + Long.toHexString(entry.getCrc()));
-            }
-
-            assertNull("should only be three entries", in.getNextEntry());
-        } finally {
-            in.close();
-        }
-    }
-}
-
diff --git a/tests/HwAccelerationTest/.classpath b/tests/HwAccelerationTest/.classpath
new file mode 100644
index 0000000..609aa00
--- /dev/null
+++ b/tests/HwAccelerationTest/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="gen"/>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/HwAccelerationTest/.gitignore b/tests/HwAccelerationTest/.gitignore
new file mode 100644
index 0000000..f178f17
--- /dev/null
+++ b/tests/HwAccelerationTest/.gitignore
@@ -0,0 +1,3 @@
+bin
+gen
+local.properties
\ No newline at end of file
diff --git a/tests/HwAccelerationTest/.project b/tests/HwAccelerationTest/.project
new file mode 100644
index 0000000..7c04d3c
--- /dev/null
+++ b/tests/HwAccelerationTest/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>HwAccelerationTest</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/tests/HwAccelerationTest/AndroidManifest.xml b/tests/HwAccelerationTest/AndroidManifest.xml
index 7fa71a9..c60613c 100644
--- a/tests/HwAccelerationTest/AndroidManifest.xml
+++ b/tests/HwAccelerationTest/AndroidManifest.xml
@@ -17,7 +17,8 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.android.test.hwui">
 
-    <uses-permission android:name="android.permission.INTERNET" />    
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-sdk android:minSdkVersion="Froyo" />
     
     <application
         android:label="HwUi"
diff --git a/tests/HwAccelerationTest/default.properties b/tests/HwAccelerationTest/default.properties
new file mode 100644
index 0000000..5a8ea50
--- /dev/null
+++ b/tests/HwAccelerationTest/default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-Froyo
diff --git a/tests/HwAccelerationTest/res/layout/advanced_blend.xml b/tests/HwAccelerationTest/res/layout/advanced_blend.xml
new file mode 100644
index 0000000..6efdd73
--- /dev/null
+++ b/tests/HwAccelerationTest/res/layout/advanced_blend.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.android.test.hwui.AdvancedBlendActivity.ShadersView
+  xmlns:android="http://schemas.android.com/apk/res/android"
+  android:layout_width="fill_parent"
+  android:layout_height="fill_parent">
+</com.android.test.hwui.AdvancedBlendActivity.ShadersView>
diff --git a/tests/HwAccelerationTest/res/layout/advanced_gradient.xml b/tests/HwAccelerationTest/res/layout/advanced_gradient.xml
new file mode 100644
index 0000000..dd937f9
--- /dev/null
+++ b/tests/HwAccelerationTest/res/layout/advanced_gradient.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.android.test.hwui.AdvancedGradientsActivity.GradientsView
+  xmlns:android="http://schemas.android.com/apk/res/android"
+  android:layout_width="fill_parent"
+  android:layout_height="fill_parent">
+</com.android.test.hwui.AdvancedGradientsActivity.GradientsView>
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/AdvancedBlendActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/AdvancedBlendActivity.java
index 5baa20c..a83005b 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/AdvancedBlendActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/AdvancedBlendActivity.java
@@ -41,7 +41,7 @@
         setContentView(new ShadersView(this));
     }
 
-    static class ShadersView extends View {
+    public static class ShadersView extends View {
         private BitmapShader mScaledShader;
         private int mTexWidth;
         private int mTexHeight;
@@ -57,7 +57,7 @@
         private ComposeShader mCompose6Shader;
         private BitmapShader mScaled2Shader;
 
-        ShadersView(Context c) {
+        public ShadersView(Context c) {
             super(c);
 
             Bitmap texture = BitmapFactory.decodeResource(c.getResources(), R.drawable.sunset1);
@@ -71,7 +71,7 @@
             Matrix m2 = new Matrix();
             m2.setScale(0.5f, 0.5f);
             mScaledShader.setLocalMatrix(m2);
-            
+
             mScaled2Shader = new BitmapShader(texture, Shader.TileMode.MIRROR,
                     Shader.TileMode.MIRROR);
             Matrix m3 = new Matrix();
@@ -80,7 +80,7 @@
 
             mHorGradient = new LinearGradient(0.0f, 0.0f, mDrawWidth, 0.0f,
                     Color.BLACK, Color.WHITE, Shader.TileMode.CLAMP);
-            
+
             mComposeShader = new ComposeShader(mScaledShader, mHorGradient,
                     PorterDuff.Mode.DARKEN);
             mCompose2Shader = new ComposeShader(mScaledShader, mHorGradient,
@@ -107,7 +107,7 @@
 
             mPaint.setShader(mComposeShader);
             canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint);
-            
+
             canvas.translate(0.0f, 40.0f + mDrawHeight);
             mPaint.setShader(mCompose2Shader);
             canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint);
@@ -117,10 +117,10 @@
             canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint);
 
             canvas.restore();
-            
+
             canvas.save();
             canvas.translate(40.0f + mDrawWidth + 40.0f, 40.0f);
-            
+
             mPaint.setShader(mCompose4Shader);
             canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint);
 
@@ -131,7 +131,7 @@
             canvas.translate(0.0f, 40.0f + mDrawHeight);
             mPaint.setShader(mCompose6Shader);
             canvas.drawRect(0.0f, 0.0f, mDrawWidth, mDrawHeight, mPaint);
-            
+
             canvas.restore();
         }
     }
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/AdvancedGradientsActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/AdvancedGradientsActivity.java
index 27974e7..b0b54eb 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/AdvancedGradientsActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/AdvancedGradientsActivity.java
@@ -36,7 +36,7 @@
         setContentView(new GradientsView(this));
     }
 
-    static class GradientsView extends View {
+    public static class GradientsView extends View {
         private final Paint mPaint;
         private final SweepGradient mSweepGradient;
         private final RadialGradient mRadialGradient;
@@ -44,7 +44,7 @@
         private final Matrix mMatrix2;
         private final Matrix mMatrix3;
 
-        GradientsView(Context c) {
+        public GradientsView(Context c) {
             super(c);
 
             mSweepGradient = new SweepGradient(0.0f, 0.0f, 0xff000000, 0xffffffff);
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java
index 8fa626b..f8422f4 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java
@@ -51,15 +51,12 @@
         final SeekBar rotateView = new SeekBar(this);
         rotateView.setMax(360);
         rotateView.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
-            @Override
             public void onStopTrackingTouch(SeekBar seekBar) {
             }
 
-            @Override
             public void onStartTrackingTouch(SeekBar seekBar) {
             }
 
-            @Override
             public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                 gradientView.setRotationY((float) progress);
                 radialGradientView.setRotationX((float) progress);
@@ -67,7 +64,7 @@
                 bitmapView.setRotationX((float) progress);
             }
         });
-        
+
         layout.addView(shadersView);
         layout.addView(gradientView, new FrameLayout.LayoutParams(
                 200, 200, Gravity.CENTER));
@@ -90,7 +87,7 @@
 
         setContentView(layout);
     }
-    
+
     static class BitmapView extends View {
         private final Paint mPaint;
 
@@ -116,7 +113,7 @@
             canvas.drawRect(0.0f, 0.0f, getWidth(), getHeight(), mPaint);
         }
     }
-    
+
     static class GradientView extends View {
         private final Paint mPaint;
 
@@ -166,14 +163,14 @@
             canvas.drawRect(0.0f, 0.0f, getWidth(), getHeight(), mPaint);
         }
     }
-    
+
     static class SweepGradientView extends View {
         private final Paint mPaint;
 
         SweepGradientView(Context c) {
             super(c);
 
-            SweepGradient gradient = new SweepGradient(100.0f, 100.0f, 0xff000000, 0xffffffff);                
+            SweepGradient gradient = new SweepGradient(100.0f, 100.0f, 0xff000000, 0xffffffff);
             mPaint = new Paint();
             mPaint.setShader(gradient);
         }
@@ -190,7 +187,7 @@
             canvas.drawRect(0.0f, 0.0f, getWidth(), getHeight(), mPaint);
         }
     }
-        
+
     static class ShadersView extends View {
         private final Paint mPaint;
         private final float mDrawWidth;
@@ -232,12 +229,12 @@
 
             top += 40.0f + mDrawHeight;
             bottom += 40.0f + mDrawHeight;
-            
+
             mMatrix.setScale(1, mDrawHeight);
             mMatrix.postTranslate(left, top);
             mGradient.setLocalMatrix(mMatrix);
             canvas.drawRect(left, top, right, top + mDrawHeight, mPaint);
-            
+
             left += 40.0f + mDrawWidth;
             right += 40.0f + mDrawWidth;
             top -= 40.0f + mDrawHeight;
@@ -251,13 +248,13 @@
 
             top += 40.0f + mDrawHeight;
             bottom += 40.0f + mDrawHeight;
-            
+
             mMatrix.setScale(1, mDrawWidth);
             mMatrix.postRotate(-90);
             mMatrix.postTranslate(left, top);
             mGradient.setLocalMatrix(mMatrix);
             canvas.drawRect(left, top, left + mDrawWidth, bottom, mPaint);
-           
+
             canvas.restore();
         }
     }
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TextGammaActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/TextGammaActivity.java
index 773d390..f40b89d 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/TextGammaActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/TextGammaActivity.java
@@ -43,9 +43,8 @@
         ));
 
         setContentView(layout);
-        
+
         layout.post(new Runnable() {
-            @Override
             public void run() {
                 Bitmap b = Bitmap.createBitmap(gamma.getWidth(), gamma.getHeight(),
                         Bitmap.Config.ARGB_8888);
@@ -88,7 +87,7 @@
 
             final LinearLayout layout = new LinearLayout(this);
             layout.setOrientation(LinearLayout.VERTICAL);
-        
+
             final GammaTextView gamma = new GammaTextView(this);
             final LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
                     LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT
diff --git a/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java
index 042d557..bc4ccd2 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java
@@ -119,20 +119,23 @@
                             pos = 0.f;
                             break;
                         case REPEAT:
-                            // remove the integer part to stay in the [0,1] range
-                            // careful: this is a negative value, so use ceil instead of floor
-                            pos = pos - (float)Math.ceil(pos);
+                            // remove the integer part to stay in the [0,1] range.
+                            // we also need to invert the value from [-1,0] to [0, 1]
+                            pos = pos - (float)Math.floor(pos);
                             break;
                         case MIRROR:
+                            // this is the same as the positive side, just make the value positive
+                            // first.
+                            pos = Math.abs(pos);
+
                             // get the integer and the decimal part
-                            // careful: this is a negative value, so use ceil instead of floor
-                            int intPart = (int)Math.ceil(pos);
+                            int intPart = (int)Math.floor(pos);
                             pos = pos - intPart;
-                            // 0  -> -1 : mirrored order
-                            // -1 -> -2: normal order
+                            // 0 -> 1 : normal order
+                            // 1 -> 2: mirrored
                             // etc..
-                            // this means if the intpart is even we invert
-                            if ((intPart % 2) == 0) {
+                            // this means if the intpart is odd we invert
+                            if ((intPart % 2) == 1) {
                                 pos = 1.f - pos;
                             }
                             break;
diff --git a/tools/layoutlib/bridge/src/android/graphics/LinearGradient_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/LinearGradient_Delegate.java
index 7573dc1..862b4544 100644
--- a/tools/layoutlib/bridge/src/android/graphics/LinearGradient_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/LinearGradient_Delegate.java
@@ -16,11 +16,14 @@
 
 package android.graphics;
 
+import com.android.layoutlib.bridge.Bridge;
 import com.android.layoutlib.bridge.impl.DelegateManager;
 
 import android.graphics.Shader.TileMode;
 
 import java.awt.Paint;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
 
 /**
  * Delegate implementing the native methods of android.graphics.LinearGradient
@@ -115,7 +118,7 @@
      * {@link java.awt.GradientPaint} only supports 2 points and does not support Android's tile
      * modes.
      */
-    private static class LinearGradientPaint extends GradientPaint {
+    private class LinearGradientPaint extends GradientPaint {
 
         private final float mX0;
         private final float mY0;
@@ -126,11 +129,11 @@
         public LinearGradientPaint(float x0, float y0, float x1, float y1, int colors[],
                 float positions[], TileMode tile) {
             super(colors, positions, tile);
-                mX0 = x0;
-                mY0 = y0;
-                mDx = x1 - x0;
-                mDy = y1 - y0;
-                mDSize2 = mDx * mDx + mDy * mDy;
+            mX0 = x0;
+            mY0 = y0;
+            mDx = x1 - x0;
+            mDy = y1 - y0;
+            mDSize2 = mDx * mDx + mDy * mDy;
         }
 
         public java.awt.PaintContext createContext(
@@ -140,16 +143,37 @@
                 java.awt.geom.AffineTransform  xform,
                 java.awt.RenderingHints        hints) {
             precomputeGradientColors();
-            return new LinearGradientPaintContext(colorModel);
+
+            AffineTransform canvasMatrix;
+            try {
+                canvasMatrix = xform.createInverse();
+            } catch (NoninvertibleTransformException e) {
+                Bridge.getLog().error(null, "Unable to inverse matrix in LinearGradient", e);
+                canvasMatrix = new AffineTransform();
+            }
+
+            AffineTransform localMatrix = getLocalMatrix();
+            try {
+                localMatrix = localMatrix.createInverse();
+            } catch (NoninvertibleTransformException e) {
+                Bridge.getLog().error(null, "Unable to inverse matrix in LinearGradient", e);
+                localMatrix = new AffineTransform();
+            }
+
+            return new LinearGradientPaintContext(canvasMatrix, localMatrix, colorModel);
         }
 
         private class LinearGradientPaintContext implements java.awt.PaintContext {
 
+            private final AffineTransform mCanvasMatrix;
+            private final AffineTransform mLocalMatrix;
             private final java.awt.image.ColorModel mColorModel;
 
-            public LinearGradientPaintContext(java.awt.image.ColorModel colorModel) {
+            public LinearGradientPaintContext(AffineTransform canvasMatrix,
+                    AffineTransform localMatrix, java.awt.image.ColorModel colorModel) {
+                mCanvasMatrix = canvasMatrix;
+                mLocalMatrix = localMatrix;
                 mColorModel = colorModel;
-                // FIXME: so far all this is always the same rect gotten in getRaster with an identity matrix?
             }
 
             public void dispose() {
@@ -165,31 +189,22 @@
 
                 int[] data = new int[w*h];
 
-                if (mDx == 0) { // vertical gradient
-                    // compute first column and copy to all other columns
-                    int index = 0;
-                    for (int iy = 0 ; iy < h ; iy++) {
-                        int color = getColor(iy + y, mY0, mDy);
-                        for (int ix = 0 ; ix < w ; ix++) {
-                            data[index++] = color;
-                        }
-                    }
-                } else if (mDy == 0) { // horizontal
-                    // compute first line in a tmp array and copy to all lines
-                    int[] line = new int[w];
+                int index = 0;
+                float[] pt1 = new float[2];
+                float[] pt2 = new float[2];
+                for (int iy = 0 ; iy < h ; iy++) {
                     for (int ix = 0 ; ix < w ; ix++) {
-                        line[ix] = getColor(ix + x, mX0, mDx);
-                    }
+                        // handle the canvas transform
+                        pt1[0] = x + ix;
+                        pt1[1] = y + iy;
+                        mCanvasMatrix.transform(pt1, 0, pt2, 0, 1);
 
-                    for (int iy = 0 ; iy < h ; iy++) {
-                        System.arraycopy(line, 0, data, iy*w, line.length);
-                    }
-                } else {
-                    int index = 0;
-                    for (int iy = 0 ; iy < h ; iy++) {
-                        for (int ix = 0 ; ix < w ; ix++) {
-                            data[index++] = getColor(ix + x, iy + y);
-                        }
+                        // handle the local matrix.
+                        pt1[0] = pt2[0];
+                        pt1[1] = pt2[1];
+                        mLocalMatrix.transform(pt1, 0, pt2, 0, 1);
+
+                        data[index++] = getColor(pt2[0], pt2[1]);
                     }
                 }
 
@@ -199,13 +214,6 @@
             }
         }
 
-        /** Returns a color for the easy vertical/horizontal mode */
-        private int getColor(float absPos, float refPos, float refSize) {
-            float pos = (absPos - refPos) / refSize;
-
-            return getGradientColor(pos);
-        }
-
         /**
          * Returns a color for an arbitrary point.
          */
diff --git a/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
index bef8c8c..6b43544 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
@@ -471,7 +471,7 @@
             return false;
         }
 
-        d.preTransform(getRotate(degrees, px, py));
+        d.postTransform(getRotate(degrees, px, py));
         return true;
     }
 
diff --git a/tools/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
index c36ce53..eebf378 100644
--- a/tools/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/RadialGradient_Delegate.java
@@ -16,11 +16,14 @@
 
 package android.graphics;
 
+import com.android.layoutlib.bridge.Bridge;
 import com.android.layoutlib.bridge.impl.DelegateManager;
 
 import android.graphics.Shader.TileMode;
 
 import java.awt.Paint;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
 
 /**
  * Delegate implementing the native methods of android.graphics.RadialGradient
@@ -105,18 +108,17 @@
     private RadialGradient_Delegate(float x, float y, float radius, int colors[], float positions[],
             TileMode tile) {
         super(colors, positions);
-
         mJavaPaint = new RadialGradientPaint(x, y, radius, mColors, mPositions, tile);
     }
 
-    private static class RadialGradientPaint extends GradientPaint {
+    private class RadialGradientPaint extends GradientPaint {
 
         private final float mX;
         private final float mY;
         private final float mRadius;
 
-        public RadialGradientPaint(float x, float y, float radius, int[] colors, float[] positions,
-                TileMode mode) {
+        public RadialGradientPaint(float x, float y, float radius,
+                int[] colors, float[] positions, TileMode mode) {
             super(colors, positions, mode);
             mX = x;
             mY = y;
@@ -130,14 +132,36 @@
                 java.awt.geom.AffineTransform xform,
                 java.awt.RenderingHints       hints) {
             precomputeGradientColors();
-            return new RadialGradientPaintContext(colorModel);
+
+            AffineTransform canvasMatrix;
+            try {
+                canvasMatrix = xform.createInverse();
+            } catch (NoninvertibleTransformException e) {
+                Bridge.getLog().error(null, "Unable to inverse matrix in RadialGradient", e);
+                canvasMatrix = new AffineTransform();
+            }
+
+            AffineTransform localMatrix = getLocalMatrix();
+            try {
+                localMatrix = localMatrix.createInverse();
+            } catch (NoninvertibleTransformException e) {
+                Bridge.getLog().error(null, "Unable to inverse matrix in RadialGradient", e);
+                localMatrix = new AffineTransform();
+            }
+
+            return new RadialGradientPaintContext(canvasMatrix, localMatrix, colorModel);
         }
 
         private class RadialGradientPaintContext implements java.awt.PaintContext {
 
+            private final AffineTransform mCanvasMatrix;
+            private final AffineTransform mLocalMatrix;
             private final java.awt.image.ColorModel mColorModel;
 
-            public RadialGradientPaintContext(java.awt.image.ColorModel colorModel) {
+            public RadialGradientPaintContext(AffineTransform canvasMatrix,
+                    AffineTransform localMatrix, java.awt.image.ColorModel colorModel) {
+                mCanvasMatrix = canvasMatrix;
+                mLocalMatrix = localMatrix;
                 mColorModel = colorModel;
             }
 
@@ -157,10 +181,22 @@
                 // compute distance from each point to the center, and figure out the distance from
                 // it.
                 int index = 0;
+                float[] pt1 = new float[2];
+                float[] pt2 = new float[2];
                 for (int iy = 0 ; iy < h ; iy++) {
                     for (int ix = 0 ; ix < w ; ix++) {
-                        float _x = x + ix - mX;
-                        float _y = y + iy - mY;
+                        // handle the canvas transform
+                        pt1[0] = x + ix;
+                        pt1[1] = y + iy;
+                        mCanvasMatrix.transform(pt1, 0, pt2, 0, 1);
+
+                        // handle the local matrix
+                        pt1[0] = pt2[0] - mX;
+                        pt1[1] = pt2[1] - mY;
+                        mLocalMatrix.transform(pt1, 0, pt2, 0, 1);
+
+                        float _x = pt2[0];
+                        float _y = pt2[1];
                         float distance = (float) Math.sqrt(_x * _x + _y * _y);
 
                         data[index++] = getGradientColor(distance / mRadius);
diff --git a/tools/layoutlib/bridge/src/android/graphics/Shader_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Shader_Delegate.java
index 646ac80..7bf1443 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Shader_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Shader_Delegate.java
@@ -18,6 +18,8 @@
 
 import com.android.layoutlib.bridge.impl.DelegateManager;
 
+import java.awt.geom.AffineTransform;
+
 /**
  * Delegate implementing the native methods of android.graphics.Shader
  *
@@ -109,4 +111,19 @@
 
     // ---- Private delegate/helper methods ----
 
+    protected AffineTransform getLocalMatrix() {
+        Matrix_Delegate localMatrixDelegate = null;
+        if (mLocalMatrix > 0) {
+            localMatrixDelegate = Matrix_Delegate.getDelegate(mLocalMatrix);
+            if (localMatrixDelegate == null) {
+                assert false;
+                return new AffineTransform();
+            }
+
+            return localMatrixDelegate.getAffineTransform();
+        }
+
+        return new AffineTransform();
+    }
+
 }
diff --git a/tools/layoutlib/bridge/src/android/graphics/SweepGradient_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/SweepGradient_Delegate.java
index 358c3c7..97c3cfd 100644
--- a/tools/layoutlib/bridge/src/android/graphics/SweepGradient_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/SweepGradient_Delegate.java
@@ -16,9 +16,12 @@
 
 package android.graphics;
 
+import com.android.layoutlib.bridge.Bridge;
 import com.android.layoutlib.bridge.impl.DelegateManager;
 
 import java.awt.Paint;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
 
 /**
  * Delegate implementing the native methods of android.graphics.SweepGradient
@@ -90,16 +93,16 @@
     private SweepGradient_Delegate(float cx, float cy,
                          int colors[], float positions[]) {
         super(colors, positions);
-
         mJavaPaint = new SweepGradientPaint(cx, cy, mColors, mPositions);
     }
 
-    private static class SweepGradientPaint extends GradientPaint {
+    private class SweepGradientPaint extends GradientPaint {
 
         private final float mCx;
         private final float mCy;
 
-        public SweepGradientPaint(float cx, float cy, int[] colors, float[] positions) {
+        public SweepGradientPaint(float cx, float cy, int[] colors,
+                float[] positions) {
             super(colors, positions, null /*tileMode*/);
             mCx = cx;
             mCy = cy;
@@ -112,14 +115,36 @@
                 java.awt.geom.AffineTransform xform,
                 java.awt.RenderingHints       hints) {
             precomputeGradientColors();
-            return new SweepGradientPaintContext(colorModel);
+
+            AffineTransform canvasMatrix;
+            try {
+                canvasMatrix = xform.createInverse();
+            } catch (NoninvertibleTransformException e) {
+                Bridge.getLog().error(null, "Unable to inverse matrix in SweepGradient", e);
+                canvasMatrix = new AffineTransform();
+            }
+
+            AffineTransform localMatrix = getLocalMatrix();
+            try {
+                localMatrix = localMatrix.createInverse();
+            } catch (NoninvertibleTransformException e) {
+                Bridge.getLog().error(null, "Unable to inverse matrix in SweepGradient", e);
+                localMatrix = new AffineTransform();
+            }
+
+            return new SweepGradientPaintContext(canvasMatrix, localMatrix, colorModel);
         }
 
         private class SweepGradientPaintContext implements java.awt.PaintContext {
 
+            private final AffineTransform mCanvasMatrix;
+            private final AffineTransform mLocalMatrix;
             private final java.awt.image.ColorModel mColorModel;
 
-            public SweepGradientPaintContext(java.awt.image.ColorModel colorModel) {
+            public SweepGradientPaintContext(AffineTransform canvasMatrix,
+                    AffineTransform localMatrix, java.awt.image.ColorModel colorModel) {
+                mCanvasMatrix = canvasMatrix;
+                mLocalMatrix = localMatrix;
                 mColorModel = colorModel;
             }
 
@@ -139,10 +164,23 @@
                 // compute angle from each point to the center, and figure out the distance from
                 // it.
                 int index = 0;
+                float[] pt1 = new float[2];
+                float[] pt2 = new float[2];
                 for (int iy = 0 ; iy < h ; iy++) {
                     for (int ix = 0 ; ix < w ; ix++) {
-                        float dx = x + ix - mCx;
-                        float dy = y + iy - mCy;
+                        // handle the canvas transform
+                        pt1[0] = x + ix;
+                        pt1[1] = y + iy;
+                        mCanvasMatrix.transform(pt1, 0, pt2, 0, 1);
+
+                        // handle the local matrix
+                        pt1[0] = pt2[0] - mCx;
+                        pt1[1] = pt2[1] - mCy;
+                        mLocalMatrix.transform(pt1, 0, pt2, 0, 1);
+
+                        float dx = pt2[0];
+                        float dy = pt2[1];
+
                         float angle;
                         if (dx == 0) {
                             angle = (float) (dy < 0 ? 3 * Math.PI / 2 : Math.PI / 2);