Merge "Improve accelerometer-based orientation sensing."
diff --git a/api/current.xml b/api/current.xml
index 3af1426..e688ab4 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -6785,6 +6785,17 @@
  visibility="public"
 >
 </field>
+<field name="restoreAnyVersion"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843451"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="restoreNeedsApplication"
  type="int"
  transient="false"
@@ -14630,7 +14641,7 @@
 </parameter>
 <parameter name="features" type="java.lang.String[]">
 </parameter>
-<parameter name="activityForPrompting" type="android.app.Activity">
+<parameter name="activity" type="android.app.Activity">
 </parameter>
 <parameter name="addAccountOptions" type="android.os.Bundle">
 </parameter>
@@ -89967,6 +89978,356 @@
 </package>
 <package name="android.net.http"
 >
+<class name="AndroidHttpClient"
+ extends="java.lang.Object"
+ abstract="false"
+ static="false"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<implements name="org.apache.http.client.HttpClient">
+</implements>
+<method name="close"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="disableCurlLogging"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="enableCurlLogging"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="name" type="java.lang.String">
+</parameter>
+<parameter name="level" type="int">
+</parameter>
+</method>
+<method name="execute"
+ return="org.apache.http.HttpResponse"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="request" type="org.apache.http.client.methods.HttpUriRequest">
+</parameter>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
+<method name="execute"
+ return="org.apache.http.HttpResponse"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="request" type="org.apache.http.client.methods.HttpUriRequest">
+</parameter>
+<parameter name="context" type="org.apache.http.protocol.HttpContext">
+</parameter>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
+<method name="execute"
+ return="org.apache.http.HttpResponse"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="target" type="org.apache.http.HttpHost">
+</parameter>
+<parameter name="request" type="org.apache.http.HttpRequest">
+</parameter>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
+<method name="execute"
+ return="org.apache.http.HttpResponse"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="target" type="org.apache.http.HttpHost">
+</parameter>
+<parameter name="request" type="org.apache.http.HttpRequest">
+</parameter>
+<parameter name="context" type="org.apache.http.protocol.HttpContext">
+</parameter>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
+<method name="execute"
+ return="T"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="request" type="org.apache.http.client.methods.HttpUriRequest">
+</parameter>
+<parameter name="responseHandler" type="org.apache.http.client.ResponseHandler&lt;? extends T&gt;">
+</parameter>
+<exception name="ClientProtocolException" type="org.apache.http.client.ClientProtocolException">
+</exception>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
+<method name="execute"
+ return="T"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="request" type="org.apache.http.client.methods.HttpUriRequest">
+</parameter>
+<parameter name="responseHandler" type="org.apache.http.client.ResponseHandler&lt;? extends T&gt;">
+</parameter>
+<parameter name="context" type="org.apache.http.protocol.HttpContext">
+</parameter>
+<exception name="ClientProtocolException" type="org.apache.http.client.ClientProtocolException">
+</exception>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
+<method name="execute"
+ return="T"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="target" type="org.apache.http.HttpHost">
+</parameter>
+<parameter name="request" type="org.apache.http.HttpRequest">
+</parameter>
+<parameter name="responseHandler" type="org.apache.http.client.ResponseHandler&lt;? extends T&gt;">
+</parameter>
+<exception name="ClientProtocolException" type="org.apache.http.client.ClientProtocolException">
+</exception>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
+<method name="execute"
+ return="T"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="target" type="org.apache.http.HttpHost">
+</parameter>
+<parameter name="request" type="org.apache.http.HttpRequest">
+</parameter>
+<parameter name="responseHandler" type="org.apache.http.client.ResponseHandler&lt;? extends T&gt;">
+</parameter>
+<parameter name="context" type="org.apache.http.protocol.HttpContext">
+</parameter>
+<exception name="ClientProtocolException" type="org.apache.http.client.ClientProtocolException">
+</exception>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
+<method name="getCompressedEntity"
+ return="org.apache.http.entity.AbstractHttpEntity"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="data" type="byte[]">
+</parameter>
+<parameter name="resolver" type="android.content.ContentResolver">
+</parameter>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
+<method name="getConnectionManager"
+ return="org.apache.http.conn.ClientConnectionManager"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getMinGzipSize"
+ return="long"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="resolver" type="android.content.ContentResolver">
+</parameter>
+</method>
+<method name="getParams"
+ return="org.apache.http.params.HttpParams"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getUngzippedContent"
+ return="java.io.InputStream"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="entity" type="org.apache.http.HttpEntity">
+</parameter>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
+<method name="modifyRequestToAcceptGzipResponse"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="request" type="org.apache.http.HttpRequest">
+</parameter>
+</method>
+<method name="newInstance"
+ return="android.net.http.AndroidHttpClient"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="userAgent" type="java.lang.String">
+</parameter>
+<parameter name="context" type="android.content.Context">
+</parameter>
+</method>
+<method name="newInstance"
+ return="android.net.http.AndroidHttpClient"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="userAgent" type="java.lang.String">
+</parameter>
+</method>
+<field name="DEFAULT_SYNC_MIN_GZIP_BYTES"
+ type="long"
+ transient="false"
+ volatile="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</class>
+<class name="HttpDateTime"
+ extends="java.lang.Object"
+ abstract="false"
+ static="false"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<constructor name="HttpDateTime"
+ type="android.net.http.HttpDateTime"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</constructor>
+<method name="parse"
+ return="java.lang.Long"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="timeString" type="java.lang.String">
+</parameter>
+<exception name="IllegalArgumentException" type="java.lang.IllegalArgumentException">
+</exception>
+</method>
+</class>
 <class name="SslCertificate"
  extends="java.lang.Object"
  abstract="false"
@@ -137772,6 +138133,17 @@
  visibility="public"
 >
 </field>
+<field name="EXTRA_CALLING_PACKAGE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;calling_package&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="EXTRA_LANGUAGE"
  type="java.lang.String"
  transient="false"
@@ -163510,6 +163882,134 @@
 >
 </field>
 </class>
+<class name="Patterns"
+ extends="java.lang.Object"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="concatGroups"
+ return="java.lang.String"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="matcher" type="java.util.regex.Matcher">
+</parameter>
+</method>
+<method name="digitsAndPlusOnly"
+ return="java.lang.String"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="matcher" type="java.util.regex.Matcher">
+</parameter>
+</method>
+<field name="DOMAIN_NAME"
+ type="java.util.regex.Pattern"
+ transient="false"
+ volatile="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="EMAIL_ADDRESS"
+ type="java.util.regex.Pattern"
+ transient="false"
+ volatile="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="GOOD_IRI_CHAR"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;a-zA-Z0-9\u00a0-\ud7ff\uf900-\ufdcf\ufdf0-\uffef&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="IP_ADDRESS"
+ type="java.util.regex.Pattern"
+ transient="false"
+ volatile="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="PHONE"
+ type="java.util.regex.Pattern"
+ transient="false"
+ volatile="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="TOP_LEVEL_DOMAIN"
+ type="java.util.regex.Pattern"
+ transient="false"
+ volatile="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="TOP_LEVEL_DOMAIN_STR"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;((aero|arpa|asia|a[cdefgilmnoqrstuwxz])|(biz|b[abdefghijmnorstvwyz])|(cat|com|coop|c[acdfghiklmnoruvxyz])|d[ejkmoz]|(edu|e[cegrstu])|f[ijkmor]|(gov|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(info|int|i[delmnoqrst])|(jobs|j[emop])|k[eghimnprwyz]|l[abcikrstuvy]|(mil|mobi|museum|m[acdeghklmnopqrstuvwxyz])|(name|net|n[acefgilopruz])|(org|om)|(pro|p[aefghklmnrstwy])|qa|r[eosuw]|s[abcdeghijklmnortuvyz]|(tel|travel|t[cdfghjklmnoprtvwz])|u[agksyz]|v[aceginu]|w[fs]|(xn\\-\\-0zwm56d|xn\\-\\-11b5bs3a9aj6g|xn\\-\\-80akhbyknj4f|xn\\-\\-9t4b11yi5a|xn\\-\\-deba0ad|xn\\-\\-g6w251d|xn\\-\\-hgbk6aj7f53bba|xn\\-\\-hlcj6aya9esc7a|xn\\-\\-jxalpdlp|xn\\-\\-kgbechtv|xn\\-\\-zckzah)|y[etu]|z[amw])&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="TOP_LEVEL_DOMAIN_STR_FOR_WEB_URL"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;(?:(?:aero|arpa|asia|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|com|coop|c[acdfghiklmnoruvxyz])|d[ejkmoz]|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnprwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdeghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om)|(?:pro|p[aefghklmnrstwy])|qa|r[eosuw]|s[abcdeghijklmnortuvyz]|(?:tel|travel|t[cdfghjklmnoprtvwz])|u[agksyz]|v[aceginu]|w[fs]|(?:xn\\-\\-0zwm56d|xn\\-\\-11b5bs3a9aj6g|xn\\-\\-80akhbyknj4f|xn\\-\\-9t4b11yi5a|xn\\-\\-deba0ad|xn\\-\\-g6w251d|xn\\-\\-hgbk6aj7f53bba|xn\\-\\-hlcj6aya9esc7a|xn\\-\\-jxalpdlp|xn\\-\\-kgbechtv|xn\\-\\-zckzah)|y[etu]|z[amw]))&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="WEB_URL"
+ type="java.util.regex.Pattern"
+ transient="false"
+ volatile="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</class>
 <class name="PrintStreamPrinter"
  extends="java.lang.Object"
  abstract="false"
diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h
index 66f3676..8e4adb1 100644
--- a/cmds/installd/installd.h
+++ b/cmds/installd/installd.h
@@ -68,7 +68,7 @@
 /* other handy constants */
 
 #define PROTECTED_DIR_PREFIX  "/data/app-private/"
-#define SDCARD_DIR_PREFIX  "/mnt/asec/"
+#define SDCARD_DIR_PREFIX  getenv("ASEC_MOUNTPOINT")
 
 #define DALVIK_CACHE_PREFIX   "/data/dalvik-cache/"
 #define DALVIK_CACHE_POSTFIX  "/classes.dex"
diff --git a/common/java/com/android/common/OperationScheduler.java b/common/java/com/android/common/OperationScheduler.java
index 0c7ca83..0a48fe7 100644
--- a/common/java/com/android/common/OperationScheduler.java
+++ b/common/java/com/android/common/OperationScheduler.java
@@ -17,6 +17,7 @@
 package com.android.common;
 
 import android.content.SharedPreferences;
+import android.net.http.HttpDateTime;
 import android.text.format.Time;
 
 import java.util.Map;
diff --git a/common/java/com/android/common/speech/Recognition.java b/common/java/com/android/common/speech/Recognition.java
index 6f164a9..a79a19b 100644
--- a/common/java/com/android/common/speech/Recognition.java
+++ b/common/java/com/android/common/speech/Recognition.java
@@ -19,18 +19,42 @@
 /**
  * Utilities for voice recognition implementations.
  *
- * @see android.app.RecognitionService
+ * @see android.speech.RecognitionService
+ * @see android.speech.RecognizerIntent
  */
 public class Recognition {
-
+    
     /**
-     * The extra key used in an intent to the speech recognizer for voice search. Not
-     * generally to be used by developers. The system search dialog uses this, for example,
-     * to set a calling package for identification by a voice search API. If this extra
-     * is set by anyone but the system process, it should be overridden by the voice search
-     * implementation.
+     * The key to the extra in the Bundle returned by
+     * android.speech.RecognizerIntent#ACTION_GET_LANGUAGE_DETAILS
+     * which is an ArrayList of CharSequences which are hints that can be shown to
+     * the user for voice actions currently supported by voice search for the user's current
+     * language preference for voice search (i.e., the one defined in the extra
+     * android.speech.RecognizerIntent#EXTRA_LANGUAGE_PREFERENCE).
+     *
+     * If this is paired with EXTRA_HINT_CONTEXT, should return a set of hints that are
+     * appropriate for the provided context.
+     *
+     * The CharSequences are SpannedStrings and will contain segments wrapped in
+     * <annotation action="true"></annotation>. This is to indicate the section of the text
+     * which represents the voice action, to be highlighted in the UI if so desired.
      */
-    public final static String EXTRA_CALLING_PACKAGE = "calling_package";
+    public static final String EXTRA_HINT_STRINGS = "android.speech.extra.HINT_STRINGS";
+    
+    /**
+     * The key to an extra to be included in the request intent for
+     * android.speech.RecognizerIntent#ACTION_GET_LANGUAGE_DETAILS.
+     * Should be an int of one of the values defined below. If an
+     * unknown int value is provided, it should be ignored.
+     */
+    public static final String EXTRA_HINT_CONTEXT = "android.speech.extra.HINT_CONTEXT";
+    
+    /**
+     * A set of values for EXTRA_HINT_CONTEXT.
+     */
+    public static final int HINT_CONTEXT_UNKNOWN = 0;
+    public static final int HINT_CONTEXT_VOICE_SEARCH_HELP = 1;
+    public static final int HINT_CONTEXT_CAR_HOME = 2;
 
     private Recognition() { }   // don't instantiate
 }
diff --git a/core/java/android/accounts/AccountManager.java b/core/java/android/accounts/AccountManager.java
index 3161826..e2263fc 100644
--- a/core/java/android/accounts/AccountManager.java
+++ b/core/java/android/accounts/AccountManager.java
@@ -516,7 +516,8 @@
      * <p>It is safe to call this method from the main thread.
      *
      * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#MANAGE_ACCOUNTS}.
+     * {@link android.Manifest.permission#MANAGE_ACCOUNTS} or
+     * {@link android.Manifest.permission#USE_CREDENTIALS}
      *
      * @param accountType The account type of the auth token to invalidate
      * @param authToken The auth token to invalidate
diff --git a/core/java/android/accounts/AccountManagerService.java b/core/java/android/accounts/AccountManagerService.java
index d4f4d13..2aaf5b0 100644
--- a/core/java/android/accounts/AccountManagerService.java
+++ b/core/java/android/accounts/AccountManagerService.java
@@ -565,7 +565,7 @@
     }
 
     public void invalidateAuthToken(String accountType, String authToken) {
-        checkManageAccountsPermission();
+        checkManageAccountsOrUseCredentialsPermissions();
         long identityToken = clearCallingIdentity();
         try {
             SQLiteDatabase db = mOpenHelper.getWritableDatabase();
@@ -1747,17 +1747,22 @@
         }
     }
 
-    private void checkBinderPermission(String permission) {
+    /** Succeeds if any of the specified permissions are granted. */
+    private void checkBinderPermission(String... permissions) {
         final int uid = Binder.getCallingUid();
-        if (mContext.checkCallingOrSelfPermission(permission) !=
-                PackageManager.PERMISSION_GRANTED) {
-            String msg = "caller uid " + uid + " lacks " + permission;
-            Log.w(TAG, msg);
-            throw new SecurityException(msg);
+
+        for (String perm : permissions) {
+            if (mContext.checkCallingOrSelfPermission(perm) == PackageManager.PERMISSION_GRANTED) {
+                if (Log.isLoggable(TAG, Log.VERBOSE)) {
+                    Log.v(TAG, "caller uid " + uid + " has " + perm);
+                }
+                return;
+            }
         }
-        if (Log.isLoggable(TAG, Log.VERBOSE)) {
-            Log.v(TAG, "caller uid " + uid + " has " + permission);
-        }
+
+        String msg = "caller uid " + uid + " lacks any of " + TextUtils.join(",", permissions);
+        Log.w(TAG, msg);
+        throw new SecurityException(msg);
     }
 
     private boolean inSystemImage(int callerUid) {
@@ -1848,6 +1853,11 @@
         checkBinderPermission(Manifest.permission.MANAGE_ACCOUNTS);
     }
 
+    private void checkManageAccountsOrUseCredentialsPermissions() {
+        checkBinderPermission(Manifest.permission.MANAGE_ACCOUNTS,
+                Manifest.permission.USE_CREDENTIALS);
+    }
+
     /**
      * Allow callers with the given uid permission to get credentials for account/authTokenType.
      * <p>
diff --git a/core/java/android/app/AliasActivity.java b/core/java/android/app/AliasActivity.java
index 7527a5b..3756529 100644
--- a/core/java/android/app/AliasActivity.java
+++ b/core/java/android/app/AliasActivity.java
@@ -26,7 +26,8 @@
 import android.os.Bundle;
 import android.util.AttributeSet;
 import android.util.Xml;
-import com.android.common.XmlUtils;
+
+import com.android.internal.util.XmlUtils;
 
 import java.io.IOException;
 
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 50dcdf9..0e21936 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -17,7 +17,7 @@
 package android.app;
 
 import com.android.internal.policy.PolicyManager;
-import com.android.common.XmlUtils;
+import com.android.internal.util.XmlUtils;
 import com.google.android.collect.Maps;
 
 import org.xmlpull.v1.XmlPullParserException;
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java
index 6a02a58..af68689 100644
--- a/core/java/android/app/SearchDialog.java
+++ b/core/java/android/app/SearchDialog.java
@@ -16,8 +16,6 @@
 
 package android.app;
 
-import com.android.common.Patterns;
-import com.android.common.speech.Recognition;
 
 import static android.app.SuggestionsAdapter.getColumnString;
 
@@ -48,6 +46,7 @@
 import android.util.AndroidRuntimeException;
 import android.util.AttributeSet;
 import android.util.Log;
+import android.util.Patterns;
 import android.view.ContextThemeWrapper;
 import android.view.Gravity;
 import android.view.KeyEvent;
@@ -313,7 +312,6 @@
         mLaunchComponent = null;
         mAppSearchData = null;
         mSearchable = null;
-        mActivityContext = null;
         mUserQuery = null;
     }
 
@@ -411,7 +409,7 @@
             updateSearchAppIcon();
             updateSearchBadge();
             updateQueryHint();
-            updateVoiceButton();
+            updateVoiceButton(TextUtils.isEmpty(mUserQuery));
             
             // In order to properly configure the input method (if one is being used), we
             // need to let it know if we'll be providing suggestions.  Although it would be
@@ -560,10 +558,13 @@
     /**
      * Update the visibility of the voice button.  There are actually two voice search modes, 
      * either of which will activate the button.
+     * @param empty whether the search query text field is empty. If it is, then the other
+     * criteria apply to make the voice button visible. Otherwise the voice button will not
+     * be visible - i.e., if the user has typed a query, remove the voice button.
      */
-    private void updateVoiceButton() {
+    private void updateVoiceButton(boolean empty) {
         int visibility = View.GONE;
-        if (mSearchable.getVoiceSearchEnabled()) {
+        if (mSearchable.getVoiceSearchEnabled() && empty) {
             Intent testIntent = null;
             if (mSearchable.getVoiceSearchLaunchWebSearch()) {
                 testIntent = mVoiceWebSearchIntent;
@@ -666,6 +667,7 @@
                 // The user changed the query, remember it.
                 mUserQuery = s == null ? "" : s.toString();
             }
+            updateVoiceButton(TextUtils.isEmpty(s));
         }
 
         public void afterTextChanged(Editable s) {
@@ -746,9 +748,6 @@
                 return;
             }
             SearchableInfo searchable = mSearchable;
-            // First stop the existing search before starting voice search, or else we'll end
-            // up showing the search dialog again once we return to the app.
-            cancel();
             try {
                 if (searchable.getVoiceSearchLaunchWebSearch()) {
                     getContext().startActivity(mVoiceWebSearchIntent);
@@ -762,6 +761,7 @@
                 // voice search before showing the button. But just in case...
                 Log.w(LOG_TAG, "Could not find voice search activity");
             }
+            dismiss();
          }
     };
     
@@ -819,7 +819,7 @@
         voiceIntent.putExtra(RecognizerIntent.EXTRA_PROMPT, prompt);
         voiceIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, language);
         voiceIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, maxResults);
-        voiceIntent.putExtra(Recognition.EXTRA_CALLING_PACKAGE,
+        voiceIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,
                 searchActivity == null ? null : searchActivity.toShortString());
         
         // Add the values that configure forwarding the results
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 607605d..fb3f646 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -34,7 +34,8 @@
 import android.os.Parcelable;
 import android.util.AttributeSet;
 import android.util.Log;
-import com.android.common.XmlUtils;
+
+import com.android.internal.util.XmlUtils;
 
 import java.io.IOException;
 import java.io.Serializable;
diff --git a/core/java/android/content/IntentFilter.java b/core/java/android/content/IntentFilter.java
index 023c024..452fd8a 100644
--- a/core/java/android/content/IntentFilter.java
+++ b/core/java/android/content/IntentFilter.java
@@ -34,7 +34,8 @@
 import android.util.Config;
 import android.util.Log;
 import android.util.Printer;
-import com.android.common.XmlUtils;
+
+import com.android.internal.util.XmlUtils;
 
 /**
  * Structured description of Intent values to be matched.  An IntentFilter can
diff --git a/core/java/android/content/SyncStorageEngine.java b/core/java/android/content/SyncStorageEngine.java
index fcb910d..5aad3af 100644
--- a/core/java/android/content/SyncStorageEngine.java
+++ b/core/java/android/content/SyncStorageEngine.java
@@ -18,7 +18,7 @@
 
 import com.android.internal.os.AtomicFile;
 import com.android.internal.util.ArrayUtils;
-import com.android.common.FastXmlSerializer;
+import com.android.internal.util.FastXmlSerializer;
 
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 2e405c1..8773f59 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -248,6 +248,19 @@
     public static final int FLAG_NATIVE_DEBUGGABLE = 1<<21;
 
     /**
+     * Value for {@link #flags}: Set to true if the application's backup
+     * agent claims to be able to handle restore data even "from the future,"
+     * i.e. from versions of the application with a versionCode greater than
+     * the one currently installed on the device.
+     *
+     * <p>If android:allowBackup is set to false or no android:backupAgent
+     * is specified, this flag will be ignored.
+     *
+     * {@hide}
+     */
+    public static final int FLAG_RESTORE_ANY_VERSION = 1<<22;
+
+    /**
      * Flags associated with the application.  Any combination of
      * {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE},
      * {@link #FLAG_PERSISTENT}, {@link #FLAG_FACTORY_TEST}, and
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 5823560..6599ae5 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -35,7 +35,8 @@
 import android.util.DisplayMetrics;
 import android.util.Log;
 import android.util.TypedValue;
-import com.android.common.XmlUtils;
+
+import com.android.internal.util.XmlUtils;
 
 import java.io.File;
 import java.io.IOException;
@@ -1369,8 +1370,8 @@
         if (allowBackup) {
             ai.flags |= ApplicationInfo.FLAG_ALLOW_BACKUP;
 
-            // backupAgent, killAfterRestore, and restoreNeedsApplication are only relevant
-            // if backup is possible for the given application.
+            // backupAgent, killAfterRestore, restoreNeedsApplication, and restoreAnyVersion
+            // are only relevant if backup is possible for the given application.
             String backupAgent = sa.getNonResourceString(
                     com.android.internal.R.styleable.AndroidManifestApplication_backupAgent);
             if (backupAgent != null) {
@@ -1390,6 +1391,11 @@
                         false)) {
                     ai.flags |= ApplicationInfo.FLAG_RESTORE_NEEDS_APPLICATION;
                 }
+                if (sa.getBoolean(
+                        com.android.internal.R.styleable.AndroidManifestApplication_restoreAnyVersion,
+                        false)) {
+                    ai.flags |= ApplicationInfo.FLAG_RESTORE_ANY_VERSION;
+                }
             }
         }
         
diff --git a/core/java/android/content/pm/RegisteredServicesCache.java b/core/java/android/content/pm/RegisteredServicesCache.java
index a885820..b74c073 100644
--- a/core/java/android/content/pm/RegisteredServicesCache.java
+++ b/core/java/android/content/pm/RegisteredServicesCache.java
@@ -43,7 +43,7 @@
 import java.io.FileInputStream;
 
 import com.android.internal.os.AtomicFile;
-import com.android.common.FastXmlSerializer;
+import com.android.internal.util.FastXmlSerializer;
 
 import com.google.android.collect.Maps;
 import com.google.android.collect.Lists;
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index a5e39d4..0608cc0 100644
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -17,7 +17,7 @@
 package android.content.res;
 
 
-import com.android.common.XmlUtils;
+import com.android.internal.util.XmlUtils;
 
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
diff --git a/core/java/android/content/res/StringBlock.java b/core/java/android/content/res/StringBlock.java
index 2411177..5e90b91 100644
--- a/core/java/android/content/res/StringBlock.java
+++ b/core/java/android/content/res/StringBlock.java
@@ -24,7 +24,8 @@
 import android.graphics.Paint;
 import android.graphics.Rect;
 import android.graphics.Typeface;
-import com.android.common.XmlUtils;
+
+import com.android.internal.util.XmlUtils;
 
 /**
  * Conveniences for retrieving data out of a compiled string resource.
diff --git a/core/java/android/content/res/TypedArray.java b/core/java/android/content/res/TypedArray.java
index 8f0003b..a7fb31d 100644
--- a/core/java/android/content/res/TypedArray.java
+++ b/core/java/android/content/res/TypedArray.java
@@ -5,7 +5,8 @@
 import android.util.DisplayMetrics;
 import android.util.Log;
 import android.util.TypedValue;
-import com.android.common.XmlUtils;
+
+import com.android.internal.util.XmlUtils;
 
 import java.util.Arrays;
 
diff --git a/core/java/android/content/res/XmlBlock.java b/core/java/android/content/res/XmlBlock.java
index 3c2c30a..ad1bfb2 100644
--- a/core/java/android/content/res/XmlBlock.java
+++ b/core/java/android/content/res/XmlBlock.java
@@ -17,7 +17,8 @@
 package android.content.res;
 
 import android.util.TypedValue;
-import com.android.common.XmlUtils;
+
+import com.android.internal.util.XmlUtils;
 
 import org.xmlpull.v1.XmlPullParserException;
 
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index badb767..c76aca1 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -332,10 +332,10 @@
 
     /**
      * Sets the value of the setting for background data usage.
-     * 
+     *
      * @param allowBackgroundData Whether an application should use data while
      *            it is in the background.
-     *            
+     *
      * @attr ref android.Manifest.permission#CHANGE_BACKGROUND_DATA_SETTING
      * @see #getBackgroundDataSetting()
      * @hide
@@ -346,7 +346,35 @@
         } catch (RemoteException e) {
         }
     }
-    
+
+    /**
+     * Gets the value of the setting for enabling Mobile data.
+     *
+     * @return Whether mobile data is enabled.
+     * @hide
+     */
+    public boolean getMobileDataEnabled() {
+        try {
+            return mService.getMobileDataEnabled();
+        } catch (RemoteException e) {
+            return true;
+        }
+    }
+
+    /**
+     * Sets the persisted value for enabling/disabling Mobile data.
+     *
+     * @param allowMobileData Whether the mobile data connection should be
+     *            used or not.
+     * @hide
+     */
+    public void setMobileDataEnabled(boolean enabled) {
+        try {
+            mService.setMobileDataEnabled(enabled);
+        } catch (RemoteException e) {
+        }
+    }
+
     /**
      * Don't allow use of default constructor.
      */
diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl
index 508e9c3a..2514693 100644
--- a/core/java/android/net/IConnectivityManager.aidl
+++ b/core/java/android/net/IConnectivityManager.aidl
@@ -51,6 +51,10 @@
 
     void setBackgroundDataSetting(boolean allowBackgroundData);
 
+    boolean getMobileDataEnabled();
+
+    void setMobileDataEnabled(boolean enabled);
+
     boolean tether(String iface);
 
     boolean untether(String iface);
diff --git a/core/java/android/net/SSLCertificateSocketFactory.java b/core/java/android/net/SSLCertificateSocketFactory.java
index f959fee..6941e57 100644
--- a/core/java/android/net/SSLCertificateSocketFactory.java
+++ b/core/java/android/net/SSLCertificateSocketFactory.java
@@ -16,11 +16,12 @@
 
 package android.net;
 
+import com.android.internal.net.DomainNameValidator;
+
 import android.os.SystemProperties;
 import android.util.Config;
 import android.util.Log;
 
-import com.android.common.DomainNameValidator;
 
 import java.io.IOException;
 import java.net.InetAddress;
diff --git a/core/java/android/net/WebAddress.java b/core/java/android/net/WebAddress.java
index fa13894..a572f60 100644
--- a/core/java/android/net/WebAddress.java
+++ b/core/java/android/net/WebAddress.java
@@ -16,7 +16,7 @@
 
 package android.net;
 
-import static com.android.common.Patterns.GOOD_IRI_CHAR;
+import static android.util.Patterns.GOOD_IRI_CHAR;
 
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
diff --git a/common/java/com/android/common/AndroidHttpClient.java b/core/java/android/net/http/AndroidHttpClient.java
similarity index 98%
rename from common/java/com/android/common/AndroidHttpClient.java
rename to core/java/android/net/http/AndroidHttpClient.java
index 4c65eb0..3517737 100644
--- a/common/java/com/android/common/AndroidHttpClient.java
+++ b/core/java/android/net/http/AndroidHttpClient.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.common;
+package android.net.http;
 
 import org.apache.http.Header;
 import org.apache.http.HttpEntity;
@@ -36,7 +36,6 @@
 import org.apache.http.conn.scheme.PlainSocketFactory;
 import org.apache.http.conn.scheme.Scheme;
 import org.apache.http.conn.scheme.SchemeRegistry;
-import org.apache.http.conn.ssl.SSLSocketFactory;
 import org.apache.http.impl.client.DefaultHttpClient;
 import org.apache.http.impl.client.RequestWrapper;
 import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
@@ -55,7 +54,6 @@
 import java.util.zip.GZIPInputStream;
 import java.util.zip.GZIPOutputStream;
 import java.net.URI;
-import java.security.KeyManagementException;
 
 import android.content.Context;
 import android.content.ContentResolver;
diff --git a/core/java/android/net/http/CertificateChainValidator.java b/core/java/android/net/http/CertificateChainValidator.java
index e1327dd..c527fe4 100644
--- a/core/java/android/net/http/CertificateChainValidator.java
+++ b/core/java/android/net/http/CertificateChainValidator.java
@@ -16,7 +16,8 @@
 
 package android.net.http;
 
-import com.android.common.DomainNameValidator;
+
+import com.android.internal.net.DomainNameValidator;
 
 import org.apache.harmony.xnet.provider.jsse.SSLParameters;
 
diff --git a/common/java/com/android/common/HttpDateTime.java b/core/java/android/net/http/HttpDateTime.java
similarity index 98%
rename from common/java/com/android/common/HttpDateTime.java
rename to core/java/android/net/http/HttpDateTime.java
index f4052cc..c7a31ee 100644
--- a/common/java/com/android/common/HttpDateTime.java
+++ b/core/java/android/net/http/HttpDateTime.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.common;
+package android.net.http;
 
 import android.text.format.Time;
 
@@ -22,8 +22,9 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-
-/** {@hide} */
+/**
+ * Helper for parsing an HTTP date.
+ */
 public final class HttpDateTime {
 
     /*
diff --git a/core/java/android/os/storage/IMountService.aidl b/core/java/android/os/storage/IMountService.aidl
index 79a6cfe..2b2dcf4 100644
--- a/core/java/android/os/storage/IMountService.aidl
+++ b/core/java/android/os/storage/IMountService.aidl
@@ -61,9 +61,12 @@
 
     /**
      * Safely unmount external storage at given mount point.
-     * Returns an int consistent with MountServiceResultCode
+     * The unmount is an asynchronous operation. Applications
+     * should register StorageEventListener for storage related
+     * status changes.
+     * 
      */
-    int unmountVolume(String mountPoint, boolean force);
+    void unmountVolume(String mountPoint, boolean force);
 
     /**
      * Format external storage given a mount point.
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index acb8473..1163106 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -3176,6 +3176,56 @@
     }
 
     /**
+     * Additional columns returned by the {@link Contacts#CONTENT_FILTER_URI} providing the
+     * explanation of why the filter matched the contact.  Specifically, they contain the
+     * data type and element that was used for matching.
+     * <p>
+     * This is temporary API, it will need to change when we move to FTS.
+     *
+     * @hide
+     */
+    public static class SearchSnippetColumns {
+
+        /**
+         * The ID of the data row that was matched by the filter.
+         *
+         * @hide
+         */
+        public static final String SNIPPET_DATA_ID = "snippet_data_id";
+
+        /**
+         * The type of data that was matched by the filter.
+         *
+         * @hide
+         */
+        public static final String SNIPPET_MIMETYPE = "snippet_mimetype";
+
+        /**
+         * The {@link CommonDataKinds.CommonColumns#DATA} field of the data row
+         * that was matched by the filter.
+         *
+         * @hide
+         */
+        public static final String SNIPPET_DATA = "snippet_data";
+
+        /**
+         * The {@link CommonDataKinds.CommonColumns#TYPE} field of the data row
+         * that was matched by the filter.
+         *
+         * @hide
+         */
+        public static final String SNIPPET_TYPE = "snippet_type";
+
+        /**
+         * The {@link CommonDataKinds.CommonColumns#LABEL} field of the data row
+         * that was matched by the filter.
+         *
+         * @hide
+         */
+        public static final String SNIPPET_LABEL = "snippet_label";
+    }
+
+    /**
      * Container for definitions of common data types stored in the {@link ContactsContract.Data}
      * table.
      */
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index a020da4..b75a8cc 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -2466,6 +2466,13 @@
         public static final String BACKGROUND_DATA = "background_data";
 
         /**
+         * Whether mobile data connections are allowed by the user.  See
+         * ConnectivityManager for more info.
+         * @hide
+         */
+        public static final String MOBILE_DATA = "mobile_data";
+
+        /**
          * The CDMA roaming mode 0 = Home Networks, CDMA default
          *                       1 = Roaming on Affiliated networks
          *                       2 = Roaming on any networks
diff --git a/core/java/android/provider/Telephony.java b/core/java/android/provider/Telephony.java
index adeef54..d96596295 100644
--- a/core/java/android/provider/Telephony.java
+++ b/core/java/android/provider/Telephony.java
@@ -29,8 +29,8 @@
 import android.text.TextUtils;
 import android.util.Config;
 import android.util.Log;
+import android.util.Patterns;
 
-import com.android.common.Patterns;
 
 import java.util.HashSet;
 import java.util.Set;
diff --git a/core/java/android/speech/RecognizerIntent.java b/core/java/android/speech/RecognizerIntent.java
index 7c15cec..bf411e1 100644
--- a/core/java/android/speech/RecognizerIntent.java
+++ b/core/java/android/speech/RecognizerIntent.java
@@ -32,6 +32,15 @@
  * Constants for supporting speech recognition through starting an {@link Intent}
  */
 public class RecognizerIntent {
+    /**
+     * The extra key used in an intent to the speech recognizer for voice search. Not
+     * generally to be used by developers. The system search dialog uses this, for example,
+     * to set a calling package for identification by a voice search API. If this extra
+     * is set by anyone but the system process, it should be overridden by the voice search
+     * implementation.
+     */
+    public final static String EXTRA_CALLING_PACKAGE = "calling_package";
+
     private RecognizerIntent() {
         // Not for instantiating.
     }
diff --git a/core/java/android/text/AndroidBidi.java b/core/java/android/text/AndroidBidi.java
new file mode 100644
index 0000000..e4f934e
--- /dev/null
+++ b/core/java/android/text/AndroidBidi.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 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.text;
+
+/**
+ * Access the ICU bidi implementation.
+ * @hide
+ */
+/* package */ class AndroidBidi {
+
+    public static int bidi(int dir, char[] chs, byte[] chInfo, int n, boolean haveInfo) {
+        if (chs == null || chInfo == null) {
+            throw new NullPointerException();
+        }
+
+        if (n < 0 || chs.length < n || chInfo.length < n) {
+            throw new IndexOutOfBoundsException();
+        }
+
+        switch(dir) {
+            case Layout.DIR_REQUEST_LTR: dir = 0; break;
+            case Layout.DIR_REQUEST_RTL: dir = 1; break;
+            case Layout.DIR_REQUEST_DEFAULT_LTR: dir = -2; break;
+            case Layout.DIR_REQUEST_DEFAULT_RTL: dir = -1; break;
+            default: dir = 0; break;
+        }
+
+        int result = runBidi(dir, chs, chInfo, n, haveInfo);
+        result = (result & 0x1) == 0 ? Layout.DIR_LEFT_TO_RIGHT : Layout.DIR_RIGHT_TO_LEFT;
+        return result;
+    }
+
+    private native static int runBidi(int dir, char[] chs, byte[] chInfo, int n, boolean haveInfo);
+}
\ No newline at end of file
diff --git a/core/java/android/text/AutoText.java b/core/java/android/text/AutoText.java
index 862305b..04730ec 100644
--- a/core/java/android/text/AutoText.java
+++ b/core/java/android/text/AutoText.java
@@ -18,7 +18,9 @@
 
 import android.content.res.Resources;
 import android.content.res.XmlResourceParser;
-import com.android.common.XmlUtils;
+
+import com.android.internal.util.XmlUtils;
+
 import android.view.View;
 
 import org.xmlpull.v1.XmlPullParser;
diff --git a/core/java/android/text/Html.java b/core/java/android/text/Html.java
index 33ecc01..07e71f9 100644
--- a/core/java/android/text/Html.java
+++ b/core/java/android/text/Html.java
@@ -46,7 +46,8 @@
 import android.text.style.URLSpan;
 import android.text.style.UnderlineSpan;
 import android.util.Log;
-import com.android.common.XmlUtils;
+
+import com.android.internal.util.XmlUtils;
 
 import java.io.IOException;
 import java.io.StringReader;
diff --git a/core/java/android/text/util/Linkify.java b/core/java/android/text/util/Linkify.java
index 7f87365..98605888c 100644
--- a/core/java/android/text/util/Linkify.java
+++ b/core/java/android/text/util/Linkify.java
@@ -22,10 +22,10 @@
 import android.text.Spannable;
 import android.text.SpannableString;
 import android.text.Spanned;
+import android.util.Patterns;
 import android.webkit.WebView;
 import android.widget.TextView;
 
-import com.android.common.Patterns;
 
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
diff --git a/common/java/com/android/common/Patterns.java b/core/java/android/util/Patterns.java
similarity index 99%
rename from common/java/com/android/common/Patterns.java
rename to core/java/android/util/Patterns.java
index 3b3b038..2ee6e8a 100644
--- a/common/java/com/android/common/Patterns.java
+++ b/core/java/android/util/Patterns.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.common;
+package android.util;
 
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
diff --git a/core/java/android/util/TimeUtils.java b/core/java/android/util/TimeUtils.java
index 4f496d7..0fc70d5 100644
--- a/core/java/android/util/TimeUtils.java
+++ b/core/java/android/util/TimeUtils.java
@@ -27,7 +27,7 @@
 import java.util.TimeZone;
 import java.util.Date;
 
-import com.android.common.XmlUtils;
+import com.android.internal.util.XmlUtils;
 
 /**
  * A class containing utility methods related to time zones.
diff --git a/core/java/android/util/XmlPullAttributes.java b/core/java/android/util/XmlPullAttributes.java
index 8f855cd..ecedbe1 100644
--- a/core/java/android/util/XmlPullAttributes.java
+++ b/core/java/android/util/XmlPullAttributes.java
@@ -19,7 +19,8 @@
 import org.xmlpull.v1.XmlPullParser;
 
 import android.util.AttributeSet;
-import com.android.common.XmlUtils;
+
+import com.android.internal.util.XmlUtils;
 
 /**
  * Provides an implementation of AttributeSet on top of an XmlPullParser.
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 2eb633f..679206d 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -3650,14 +3650,27 @@
     }
 
     /**
-     * This is called when a container is going to temporarily detach a child
-     * that currently has focus, with
+     * @hide
+     */
+    public void dispatchStartTemporaryDetach() {
+        onStartTemporaryDetach();
+    }
+
+    /**
+     * This is called when a container is going to temporarily detach a child, with
      * {@link ViewGroup#detachViewFromParent(View) ViewGroup.detachViewFromParent}.
      * It will either be followed by {@link #onFinishTemporaryDetach()} or
-     * {@link #onDetachedFromWindow()} when the container is done.  Generally
-     * this is currently only done ListView for a view with focus.
+     * {@link #onDetachedFromWindow()} when the container is done.
      */
     public void onStartTemporaryDetach() {
+        removeUnsetPressCallback();
+    }
+
+    /**
+     * @hide
+     */
+    public void dispatchFinishTemporaryDetach() {
+        onFinishTemporaryDetach();
     }
 
     /**
@@ -4362,6 +4375,16 @@
     }
     
     /**
+     * Remove the prepress detection timer.
+     */
+    private void removeUnsetPressCallback() {
+        if ((mPrivateFlags & PRESSED) != 0 && mUnsetPressedState != null) {
+            setPressed(false);
+            removeCallbacks(mUnsetPressedState);
+        }
+    }
+
+    /**
      * Remove the tap detection timer.
      */
     private void removeTapCallback() {
@@ -5886,6 +5909,7 @@
      * @see #onAttachedToWindow()
      */
     protected void onDetachedFromWindow() {
+        removeUnsetPressCallback();
         removeLongPressCallback();
         destroyDrawingCache();
     }
@@ -7312,6 +7336,7 @@
      * Sets the background color for this view.
      * @param color the color of the background
      */
+    @RemotableViewMethod
     public void setBackgroundColor(int color) {
         setBackgroundDrawable(new ColorDrawable(color));
     }
@@ -7322,6 +7347,7 @@
      * @param resid The identifier of the resource.
      * @attr ref android.R.styleable#View_background
      */
+    @RemotableViewMethod
     public void setBackgroundResource(int resid) {
         if (resid != 0 && resid == mBackgroundResource) {
             return;
@@ -8731,7 +8757,7 @@
             boolean clampedX, boolean clampedY) {
         // Intentionally empty.
     }
-    
+
     /**
      * A MeasureSpec encapsulates the layout requirements passed from parent to child.
      * Each MeasureSpec represents a requirement for either the width or the height.
@@ -9182,12 +9208,6 @@
         boolean mRecomputeGlobalAttributes;
 
         /**
-         * Set to true when attributes (like mKeepScreenOn) need to be
-         * recomputed.
-         */
-        boolean mAttributesChanged;
-
-        /**
          * Set during a traveral if any views want to keep the screen on.
          */
         boolean mKeepScreenOn;
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 0663215..d05416d 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -1065,6 +1065,36 @@
         }
         return false;
     }
+    
+    /**
+     * {@inheritDoc}
+     * 
+     * @hide
+     */
+    @Override
+    public void dispatchStartTemporaryDetach() {
+        super.dispatchStartTemporaryDetach();
+        final int count = mChildrenCount;
+        final View[] children = mChildren;
+        for (int i = 0; i < count; i++) {
+            children[i].dispatchStartTemporaryDetach();
+        }
+    }
+    
+    /**
+     * {@inheritDoc}
+     * 
+     * @hide
+     */
+    @Override
+    public void dispatchFinishTemporaryDetach() {
+        super.dispatchFinishTemporaryDetach();
+        final int count = mChildrenCount;
+        final View[] children = mChildren;
+        for (int i = 0; i < count; i++) {
+            children[i].dispatchFinishTemporaryDetach();
+        }
+    }
 
     /**
      * {@inheritDoc}
diff --git a/core/java/android/webkit/CacheManager.java b/core/java/android/webkit/CacheManager.java
index 87cab3c..647556b 100644
--- a/core/java/android/webkit/CacheManager.java
+++ b/core/java/android/webkit/CacheManager.java
@@ -18,6 +18,7 @@
 
 import android.content.Context;
 import android.net.http.Headers;
+import android.net.http.HttpDateTime;
 import android.os.FileUtils;
 import android.util.Log;
 import java.io.File;
@@ -30,7 +31,6 @@
 import java.util.ArrayList;
 import java.util.Map;
 
-import com.android.common.HttpDateTime;
 
 import org.bouncycastle.crypto.Digest;
 import org.bouncycastle.crypto.digests.SHA1Digest;
diff --git a/core/java/android/webkit/CookieManager.java b/core/java/android/webkit/CookieManager.java
index 94bedde..1d28731 100644
--- a/core/java/android/webkit/CookieManager.java
+++ b/core/java/android/webkit/CookieManager.java
@@ -18,9 +18,9 @@
 
 import android.net.ParseException;
 import android.net.WebAddress;
+import android.net.http.HttpDateTime;
 import android.util.Log;
 
-import com.android.common.HttpDateTime;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -150,8 +150,13 @@
         }
 
         boolean exactMatch(Cookie in) {
+            // An exact match means that domain, path, and name are equal. If
+            // both values are null, the cookies match. If both values are
+            // non-null, the cookies match. If one value is null and the other
+            // is non-null, the cookies do not match (i.e. "foo=;" and "foo;")
+            boolean valuesMatch = !((value == null) ^ (in.value == null));
             return domain.equals(in.domain) && path.equals(in.path) &&
-                    name.equals(in.name);
+                    name.equals(in.name) && valuesMatch;
         }
 
         boolean domainMatch(String urlHost) {
@@ -206,17 +211,29 @@
             // As Set is not modified if the two objects are same, we do want to
             // assign different value for each cookie.
             int diff = cookie2.path.length() - cookie1.path.length();
-            if (diff == 0) {
-                diff = cookie2.domain.length() - cookie1.domain.length();
-                if (diff == 0) {
-                    diff = cookie2.name.hashCode() - cookie1.name.hashCode();
-                    if (diff == 0) {
-                        Log.w(LOGTAG, "Found two cookies with the same value." +
-                                "cookie1=" + cookie1 + " , cookie2=" + cookie2);
-                    }
-                }
+            if (diff != 0) return diff;
+
+            diff = cookie2.domain.length() - cookie1.domain.length();
+            if (diff != 0) return diff;
+
+            diff = cookie2.name.hashCode() - cookie1.name.hashCode();
+            if (diff != 0) return diff;
+
+            // If cookie2 has a null value, it should come later in
+            // the list.
+            if (cookie2.value == null) {
+                return -1;
+            } else if (cookie1.value == null) {
+                // Now we know that cookie2 does not have a null value, if
+                // cookie1 has a null value, place it later in the list.
+                return 1;
             }
-            return diff;
+
+            // cookie1 and cookie2 both have non-null values so we emit a
+            // warning and treat them as the same.
+            Log.w(LOGTAG, "Found two cookies with the same value."
+                    + "cookie1=" + cookie1 + " , cookie2=" + cookie2);
+            return 0;
         }
     }
 
@@ -459,8 +476,10 @@
             }
 
             ret.append(cookie.name);
-            ret.append(EQUAL);
-            ret.append(cookie.value);
+            if (cookie.value != null) {
+                ret.append(EQUAL);
+                ret.append(cookie.value);
+            }
         }
 
         if (ret.length() > 0) {
@@ -634,7 +653,10 @@
                         byteCount += cookie.domain.length()
                                 + cookie.path.length()
                                 + cookie.name.length()
-                                + cookie.value.length() + 14;
+                                + (cookie.value != null
+                                        ? cookie.value.length()
+                                        : 0)
+                                + 14;
                         count++;
                     }
                 } else {
@@ -779,38 +801,45 @@
              */
             int semicolonIndex = cookieString.indexOf(SEMICOLON, index);
             int equalIndex = cookieString.indexOf(EQUAL, index);
-            if (equalIndex == -1) {
-                // bad format, force return
-                break;
-            }
-            if (semicolonIndex > -1 && semicolonIndex < equalIndex) {
-                // empty cookie, like "; path=/", return
-                break;
-            }
             cookie = new Cookie(host, path);
-            cookie.name = cookieString.substring(index, equalIndex);
-            if (cookieString.charAt(equalIndex + 1) == QUOTATION) {
-                index = cookieString.indexOf(QUOTATION, equalIndex + 2);
-                if (index == -1) {
-                    // bad format, force return
-                    break;
+
+            // Cookies like "testcookie; path=/;" are valid and used
+            // (lovefilm.se). Check for equal as in the string "testcookie"
+            // Check for equalIndex == -1 as in the string "testcookie;"
+            if (semicolonIndex <= equalIndex || equalIndex == -1) {
+                // Fix up the index in case we have a string like "testcookie"
+                if (semicolonIndex == -1) {
+                    semicolonIndex = length;
                 }
-            }
-            semicolonIndex = cookieString.indexOf(SEMICOLON, index);
-            if (semicolonIndex == -1) {
-                semicolonIndex = length;
-            }
-            if (semicolonIndex - equalIndex > MAX_COOKIE_LENGTH) {
-                // cookie is too big, trim it
-                cookie.value = cookieString.substring(equalIndex + 1,
-                        equalIndex + MAX_COOKIE_LENGTH);
-            } else if (equalIndex + 1 == semicolonIndex
-                    || semicolonIndex < equalIndex) {
-                // these are unusual case like foo=; and foo; path=/
-                cookie.value = "";
+                cookie.name = cookieString.substring(index, semicolonIndex);
+                cookie.value = null;
             } else {
-                cookie.value = cookieString.substring(equalIndex + 1,
-                        semicolonIndex);
+                cookie.name = cookieString.substring(index, equalIndex);
+                if (cookieString.charAt(equalIndex + 1) == QUOTATION) {
+                    index = cookieString.indexOf(QUOTATION, equalIndex + 2);
+                    if (index == -1) {
+                        // bad format, force return
+                        break;
+                    }
+                }
+                // Get the semicolon index again in case it was contained within
+                // the quotations.
+                semicolonIndex = cookieString.indexOf(SEMICOLON, index);
+                if (semicolonIndex == -1) {
+                    semicolonIndex = length;
+                }
+                if (semicolonIndex - equalIndex > MAX_COOKIE_LENGTH) {
+                    // cookie is too big, trim it
+                    cookie.value = cookieString.substring(equalIndex + 1,
+                            equalIndex + 1 + MAX_COOKIE_LENGTH);
+                } else if (equalIndex + 1 == semicolonIndex
+                        || semicolonIndex < equalIndex) {
+                    // this is an unusual case like foo=;
+                    cookie.value = "";
+                } else {
+                    cookie.value = cookieString.substring(equalIndex + 1,
+                            semicolonIndex);
+                }
             }
             // get attributes
             index = semicolonIndex;
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 67543aa..d29d6f3 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -213,7 +213,6 @@
     static private final boolean AUTO_REDRAW_HACK = false;
     // true means redraw the screen all-the-time. Only with AUTO_REDRAW_HACK
     private boolean mAutoRedraw;
-    private int mRootLayer; // C++ pointer to the root layer
 
     static final String LOGTAG = "webview";
 
@@ -618,6 +617,12 @@
     private static final int SNAP_Y = 4; // may be combined with SNAP_LOCK
     private boolean mSnapPositive;
 
+    // keep these in sync with their counterparts in WebView.cpp
+    private static final int DRAW_EXTRAS_NONE = 0;
+    private static final int DRAW_EXTRAS_FIND = 1;
+    private static final int DRAW_EXTRAS_SELECTION = 2;
+    private static final int DRAW_EXTRAS_CURSOR_RING = 3;
+
     // Used to match key downs and key ups
     private boolean mGotKeyDown;
 
@@ -1306,6 +1311,7 @@
                 // onSizeChanged() is called, the rest will be set
                 // correctly
                 mActualScale = scale;
+                mInvActualScale = 1 / scale;
                 mTextWrapScale = b.getFloat("textwrapScale", scale);
                 mInZoomOverview = b.getBoolean("overview");
                 invalidate();
@@ -3116,7 +3122,7 @@
         int mScrollY;
         int mWidth;
         int mHeight;
-        float mScale;
+        float mInvScale;
     }
 
     private Metrics getViewMetrics() {
@@ -3125,23 +3131,22 @@
         metrics.mScrollY = computeVerticalScrollOffset();
         metrics.mWidth = getWidth();
         metrics.mHeight = getHeight() - getVisibleTitleHeight();
-        metrics.mScale = mActualScale;
+        metrics.mInvScale = mInvActualScale;
         return metrics;
     }
 
-    private void drawLayers(Canvas canvas) {
-        if (mRootLayer != 0) {
-            // Currently for each draw we compute the animation values;
-            // We may in the future decide to do that independently.
-            if (nativeEvaluateLayersAnimations(mRootLayer)) {
-                // If we have unfinished (or unstarted) animations,
-                // we ask for a repaint.
-                invalidate();
-            }
-
-            // We can now draw the layers.
-            nativeDrawLayers(mRootLayer, canvas);
+    private void drawExtras(Canvas canvas, int extras) {
+        // If mNativeClass is 0, we should not reach here, so we do not
+        // need to check it again.
+        // Currently for each draw we compute the animation values;
+        // We may in the future decide to do that independently.
+        if (nativeEvaluateLayersAnimations()) {
+            // If we have unfinished (or unstarted) animations,
+            // we ask for a repaint.
+            invalidate();
         }
+
+        nativeDrawExtras(canvas, extras);
     }
 
     private void drawCoreAndCursorRing(Canvas canvas, int color,
@@ -3149,7 +3154,6 @@
         if (mDrawHistory) {
             canvas.scale(mActualScale, mActualScale);
             canvas.drawPicture(mHistoryPicture);
-            drawLayers(canvas);
             return;
         }
 
@@ -3228,27 +3232,29 @@
 
         mWebViewCore.drawContentPicture(canvas, color,
                 (animateZoom || mPreviewZoomOnly), animateScroll);
-        boolean cursorIsInLayer = nativeCursorIsInLayer();
-        if (drawCursorRing && !cursorIsInLayer) {
-            nativeDrawCursorRing(canvas);
-        }
-        // When the FindDialog is up, only draw the matches if we are not in
-        // the process of scrolling them into view.
-        if (mFindIsUp && !animateScroll) {
-            nativeDrawMatches(canvas);
-        }
-        drawLayers(canvas);
-
         if (mNativeClass == 0) return;
-        if (mShiftIsPressed && !(animateZoom || mPreviewZoomOnly)) {
-            if (mTouchSelection || mExtendSelection) {
-                nativeDrawSelectionRegion(canvas);
+        // decide which adornments to draw
+        int extras = DRAW_EXTRAS_NONE;
+        if (mFindIsUp) {
+            // When the FindDialog is up, only draw the matches if we are not in
+            // the process of scrolling them into view.
+            if (!animateScroll) {
+                extras = DRAW_EXTRAS_FIND;
             }
-            if (!mTouchSelection) {
-                nativeDrawSelectionPointer(canvas, mInvActualScale, mSelectX,
-                        mSelectY - getTitleHeight(), mExtendSelection);
+        } else if (mShiftIsPressed) {
+            if (!animateZoom && !mPreviewZoomOnly) {
+                extras = DRAW_EXTRAS_SELECTION;
+                nativeSetSelectionRegion(mTouchSelection || mExtendSelection);
+                nativeSetSelectionPointer(!mTouchSelection, mInvActualScale,
+                        mSelectX, mSelectY - getTitleHeight(),
+                        mExtendSelection);
             }
         } else if (drawCursorRing) {
+            extras = DRAW_EXTRAS_CURSOR_RING;
+        }
+        drawExtras(canvas, extras);
+
+        if (extras == DRAW_EXTRAS_CURSOR_RING) {
             if (mTouchMode == TOUCH_SHORTPRESS_START_MODE) {
                 mTouchMode = TOUCH_SHORTPRESS_MODE;
                 HitTestResult hitTest = getHitTestResult();
@@ -3259,7 +3265,6 @@
                             LONG_PRESS_TIMEOUT);
                 }
             }
-            if (cursorIsInLayer) nativeDrawCursorRing(canvas);
         }
         if (mFocusSizeChanged) {
             mFocusSizeChanged = false;
@@ -3364,6 +3369,7 @@
         if (isTextView) {
             rebuildWebTextView();
             if (inEditingMode()) {
+                mWebTextView.setDefaultSelection();
                 imm.showSoftInput(mWebTextView, 0);
                 if (zoom) {
                     didUpdateTextViewBounds(true);
@@ -3681,6 +3687,7 @@
             // might be.  Check it, and if so, hand over to the WebTextView.
             rebuildWebTextView();
             if (inEditingMode()) {
+                mWebTextView.setDefaultSelection();
                 return mWebTextView.dispatchKeyEvent(event);
             }
         }
@@ -6001,12 +6008,7 @@
                     break;
                 }
                 case SET_ROOT_LAYER_MSG_ID: {
-                    int oldLayer = mRootLayer;
-                    mRootLayer = msg.arg1;
-                    nativeSetRootLayer(mRootLayer);
-                    if (oldLayer > 0) {
-                        nativeDestroyLayer(oldLayer);
-                    }
+                    nativeSetRootLayer(msg.arg1);
                     invalidate();
                     break;
                 }
@@ -6766,7 +6768,6 @@
     /* package */ native boolean nativeCursorMatchesFocus();
     private native boolean  nativeCursorIntersects(Rect visibleRect);
     private native boolean  nativeCursorIsAnchor();
-    private native boolean  nativeCursorIsInLayer();
     private native boolean  nativeCursorIsTextInput();
     private native Point    nativeCursorPosition();
     private native String   nativeCursorText();
@@ -6777,14 +6778,8 @@
     private native boolean  nativeCursorWantsKeyEvents();
     private native void     nativeDebugDump();
     private native void     nativeDestroy();
-    private native void     nativeDrawCursorRing(Canvas content);
-    private native void     nativeDestroyLayer(int layer);
-    private native boolean  nativeEvaluateLayersAnimations(int layer);
-    private native void     nativeDrawLayers(int layer, Canvas canvas);
-    private native void     nativeDrawMatches(Canvas canvas);
-    private native void     nativeDrawSelectionPointer(Canvas content,
-            float scale, int x, int y, boolean extendSelection);
-    private native void     nativeDrawSelectionRegion(Canvas content);
+    private native boolean  nativeEvaluateLayersAnimations();
+    private native void     nativeDrawExtras(Canvas canvas, int extra);
     private native void     nativeDumpDisplayTree(String urlOrNull);
     private native int      nativeFindAll(String findLower, String findUpper);
     private native void     nativeFindNext(boolean forward);
@@ -6831,6 +6826,9 @@
     private native void     nativeSetFollowedLink(boolean followed);
     private native void     nativeSetHeightCanMeasure(boolean measure);
     private native void     nativeSetRootLayer(int layer);
+    private native void     nativeSetSelectionPointer(boolean set,
+            float scale, int x, int y, boolean extendSelection);
+    private native void     nativeSetSelectionRegion(boolean set);
     private native int      nativeTextGeneration();
     // Never call this version except by updateCachedTextfield(String) -
     // we always want to pass in our generation number.
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 17d5bb7..9ddfeff 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -1314,7 +1314,8 @@
                             position, -1);
                 }
             } else {
-                isScrap[0] = true;                
+                isScrap[0] = true;
+                child.dispatchFinishTemporaryDetach();
             }
         } else {
             child = mAdapter.getView(position, null, this);
@@ -4145,8 +4146,10 @@
             }
 
             if (mViewTypeCount == 1) {
+                scrap.dispatchStartTemporaryDetach();
                 mCurrentScrap.add(scrap);
             } else {
+                scrap.dispatchStartTemporaryDetach();
                 mScrapViews[viewType].add(scrap);
             }
 
@@ -4165,7 +4168,7 @@
 
             ArrayList<View> scrapViews = mCurrentScrap;
             final int count = activeViews.length;
-            for (int i = 0; i < count; ++i) {
+            for (int i = count - 1; i >= 0; i--) {
                 final View victim = activeViews[i];
                 if (victim != null) {
                     int whichScrap = ((AbsListView.LayoutParams) victim.getLayoutParams()).viewType;
@@ -4181,6 +4184,7 @@
                     if (multipleScraps) {
                         scrapViews = mScrapViews[whichScrap];
                     }
+                    victim.dispatchStartTemporaryDetach();
                     scrapViews.add(victim);
 
                     if (hasListener) {
diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java
index 9fcb829..bd07e1f 100644
--- a/core/java/android/widget/LinearLayout.java
+++ b/core/java/android/widget/LinearLayout.java
@@ -632,6 +632,8 @@
 
         final boolean baselineAligned = mBaselineAligned;
         final boolean useLargestChild = mUseLargestChild;
+        
+        final boolean isExactly = widthMode == MeasureSpec.EXACTLY;
 
         int largestChildWidth = Integer.MIN_VALUE;
 
@@ -658,14 +660,19 @@
                 // Optimization: don't bother measuring children who are going to use
                 // leftover space. These views will get measured again down below if
                 // there is any leftover space.
-                final int totalLength = mTotalLength;
-                mTotalLength = Math.max(totalLength, totalLength + lp.leftMargin + lp.rightMargin);
+                if (isExactly) {
+                    mTotalLength += lp.leftMargin + lp.rightMargin;
+                } else {
+                    final int totalLength = mTotalLength;
+                    mTotalLength = Math.max(totalLength, totalLength +
+                            lp.leftMargin + lp.rightMargin);
+                }
 
                 // Baseline alignment requires to measure widgets to obtain the
-                // baseline offset (in particular for TextViews).
-                // The following defeats the optimization mentioned above.
-                // Allow the child to use as much space as it wants because we
-                // can shrink things later (and re-measure).
+                // baseline offset (in particular for TextViews). The following
+                // defeats the optimization mentioned above. Allow the child to
+                // use as much space as it wants because we can shrink things
+                // later (and re-measure).
                 if (baselineAligned) {
                     final int freeSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
                     child.measure(freeSpec, freeSpec);
@@ -695,9 +702,14 @@
                 }
 
                 final int childWidth = child.getMeasuredWidth();
-                final int totalLength = mTotalLength;
-                mTotalLength = Math.max(totalLength, totalLength + childWidth + lp.leftMargin +
-                        lp.rightMargin + getNextLocationOffset(child));
+                if (isExactly) {
+                    mTotalLength += childWidth + lp.leftMargin + lp.rightMargin +
+                            getNextLocationOffset(child);
+                } else {
+                    final int totalLength = mTotalLength;
+                    mTotalLength = Math.max(totalLength, totalLength + childWidth + lp.leftMargin +
+                           lp.rightMargin + getNextLocationOffset(child));
+                }
 
                 if (useLargestChild) {
                     largestChildWidth = Math.max(childWidth, largestChildWidth);
@@ -782,9 +794,14 @@
 
                 final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams)
                         child.getLayoutParams();
-                final int totalLength = mTotalLength;
-                mTotalLength = Math.max(totalLength, totalLength + largestChildWidth +
-                        lp.leftMargin + lp.rightMargin + getNextLocationOffset(child));
+                if (isExactly) {
+                    mTotalLength += largestChildWidth + lp.leftMargin + lp.rightMargin +
+                            getNextLocationOffset(child);
+                } else {
+                    final int totalLength = mTotalLength;
+                    mTotalLength = Math.max(totalLength, totalLength + largestChildWidth +
+                            lp.leftMargin + lp.rightMargin + getNextLocationOffset(child));
+                }
             }
         }
 
@@ -854,9 +871,14 @@
                     }
                 }
 
-                final int totalLength = mTotalLength;
-                mTotalLength = Math.max(totalLength, totalLength + child.getMeasuredWidth() +
-                        lp.leftMargin + lp.rightMargin + getNextLocationOffset(child));
+                if (isExactly) {
+                    mTotalLength += child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin +
+                            getNextLocationOffset(child);
+                } else {
+                    final int totalLength = mTotalLength;
+                    mTotalLength = Math.max(totalLength, totalLength + child.getMeasuredWidth() +
+                            lp.leftMargin + lp.rightMargin + getNextLocationOffset(child));
+                }
 
                 boolean matchHeightLocally = heightMode != MeasureSpec.EXACTLY &&
                         lp.height == LayoutParams.MATCH_PARENT;
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index 2feed03..8d688a5 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -1485,7 +1485,6 @@
             }
 
             // Clear out old views
-            //removeAllViewsInLayout();
             detachAllViewsFromParent();
 
             switch (mLayoutMode) {
diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java
index 52ed11d..fd24058 100644
--- a/core/java/android/widget/ScrollView.java
+++ b/core/java/android/widget/ScrollView.java
@@ -22,6 +22,7 @@
 import android.content.res.TypedArray;
 import android.graphics.Rect;
 import android.util.AttributeSet;
+import android.util.Log;
 import android.view.FocusFinder;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
@@ -51,6 +52,8 @@
  * <p>ScrollView only supports vertical scrolling.
  */
 public class ScrollView extends FrameLayout {
+    private static final String TAG = "ScrollView";
+
     static final int ANIMATED_SCROLL_GAP = 250;
 
     static final float MAX_SCROLL_FACTOR = 0.5f;
@@ -112,6 +115,18 @@
     private int mTouchSlop;
     private int mMinimumVelocity;
     private int mMaximumVelocity;
+    
+    /**
+     * ID of the active pointer. This is used to retain consistency during
+     * drags/flings if multiple pointers are used.
+     */
+    private int mActivePointerId = INVALID_POINTER;
+    
+    /**
+     * Sentinel value for no current active pointer.
+     * Used by {@link #mActivePointerId}.
+     */
+    private static final int INVALID_POINTER = -1;
 
     public ScrollView(Context context) {
         this(context, null);
@@ -360,6 +375,17 @@
         return handled;
     }
 
+    private boolean inChild(int x, int y) {
+        if (getChildCount() > 0) {
+            final View child = getChildAt(0);
+            return !(y < child.getTop()
+                    || y >= child.getBottom()
+                    || x < child.getLeft()
+                    || x >= child.getRight());
+        }
+        return false;
+    }
+
     @Override
     public boolean onInterceptTouchEvent(MotionEvent ev) {
         /*
@@ -378,10 +404,8 @@
             return true;
         }
 
-        final float y = ev.getY();
-
-        switch (action) {
-            case MotionEvent.ACTION_MOVE:
+        switch (action & MotionEvent.ACTION_MASK) {
+            case MotionEvent.ACTION_MOVE: {
                 /*
                  * mIsBeingDragged == false, otherwise the shortcut would have caught it. Check
                  * whether the user has moved far enough from his original down touch.
@@ -391,16 +415,29 @@
                 * Locally do absolute value. mLastMotionY is set to the y value
                 * of the down event.
                 */
+                final int pointerIndex = ev.findPointerIndex(mActivePointerId);
+                final float y = ev.getY(pointerIndex);
                 final int yDiff = (int) Math.abs(y - mLastMotionY);
                 if (yDiff > mTouchSlop) {
                     mIsBeingDragged = true;
                     mLastMotionY = y;
                 }
                 break;
+            }
 
-            case MotionEvent.ACTION_DOWN:
-                /* Remember location of down touch */
+            case MotionEvent.ACTION_DOWN: {
+                final float y = ev.getY();
+                if (!inChild((int)ev.getX(), (int)y)) {
+                    mIsBeingDragged = false;
+                    break;
+                }
+
+                /*
+                 * Remember location of down touch.
+                 * ACTION_DOWN always refers to pointer index 0.
+                 */
                 mLastMotionY = y;
+                mActivePointerId = ev.getPointerId(0);
 
                 /*
                 * If being flinged and user touches the screen, initiate drag;
@@ -409,11 +446,16 @@
                 */
                 mIsBeingDragged = !mScroller.isFinished();
                 break;
+            }
 
             case MotionEvent.ACTION_CANCEL:
             case MotionEvent.ACTION_UP:
                 /* Release the drag */
                 mIsBeingDragged = false;
+                mActivePointerId = INVALID_POINTER;
+                break;
+            case MotionEvent.ACTION_POINTER_UP:
+                onSecondaryPointerUp(ev);
                 break;
         }
 
@@ -439,10 +481,9 @@
         mVelocityTracker.addMovement(ev);
 
         final int action = ev.getAction();
-        final float y = ev.getY();
 
-        switch (action) {
-            case MotionEvent.ACTION_DOWN:
+        switch (action & MotionEvent.ACTION_MASK) {
+            case MotionEvent.ACTION_DOWN: {
                 /*
                 * If being flinged and user touches, stop the fling. isFinished
                 * will be false if being flinged.
@@ -451,41 +492,78 @@
                     mScroller.abortAnimation();
                 }
 
+                final float y = ev.getY();
+                if (!(mIsBeingDragged = inChild((int)ev.getX(), (int)y))) {
+                    return false;
+                }
+                
                 // Remember where the motion event started
                 mLastMotionY = y;
+                mActivePointerId = ev.getPointerId(0);
                 break;
+            }
             case MotionEvent.ACTION_MOVE:
-                // Scroll to follow the motion event
-                final int deltaY = (int) (mLastMotionY - y);
-                mLastMotionY = y;
+                if (mIsBeingDragged) {
+                    // Scroll to follow the motion event
+                    final int activePointerIndex = ev.findPointerIndex(mActivePointerId);
+                    final float y = ev.getY(activePointerIndex);
+                    final int deltaY = (int) (mLastMotionY - y);
+                    mLastMotionY = y;
 
-                overscrollBy(0, deltaY, 0, mScrollY, 0, getScrollRange(),
-                        0, getOverscrollMax());
+                    overscrollBy(0, deltaY, 0, mScrollY, 0, getScrollRange(),
+                            0, getOverscrollMax());
+                }
                 break;
-            case MotionEvent.ACTION_UP:
-                final VelocityTracker velocityTracker = mVelocityTracker;
-                velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
-                int initialVelocity = (int) velocityTracker.getYVelocity();
+            case MotionEvent.ACTION_UP: 
+                if (mIsBeingDragged) {
+                    final VelocityTracker velocityTracker = mVelocityTracker;
+                    velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
+                    int initialVelocity = (int) velocityTracker.getYVelocity(mActivePointerId);
 
-                if (getChildCount() > 0) {
-                    if ((Math.abs(initialVelocity) > mMinimumVelocity)) {
-                        fling(-initialVelocity);
-                    } else {
-                        final int bottom = getScrollRange();
-                        if (mScroller.springback(mScrollX, mScrollY, 0, 0, 0, bottom)) {
-                            invalidate();
+                    if (getChildCount() > 0) {
+                        if ((Math.abs(initialVelocity) > mMinimumVelocity)) {
+                            fling(-initialVelocity);
+                        } else {
+                            final int bottom = getScrollRange();
+                            if (mScroller.springback(mScrollX, mScrollY, 0, 0, 0, bottom)) {
+                                invalidate();
+                            }
                         }
                     }
-                }
 
-                if (mVelocityTracker != null) {
-                    mVelocityTracker.recycle();
-                    mVelocityTracker = null;
+                    mActivePointerId = INVALID_POINTER;
+                    mIsBeingDragged = false;
+
+                    if (mVelocityTracker != null) {
+                        mVelocityTracker.recycle();
+                        mVelocityTracker = null;
+                    }
                 }
+                break;
+            case MotionEvent.ACTION_POINTER_UP:
+                onSecondaryPointerUp(ev);
+                break;
         }
         return true;
     }
     
+    private void onSecondaryPointerUp(MotionEvent ev) {
+        final int pointerIndex = (ev.getAction() & MotionEvent.ACTION_POINTER_INDEX_MASK) >>
+                MotionEvent.ACTION_POINTER_INDEX_SHIFT;
+        final int pointerId = ev.getPointerId(pointerIndex);
+        if (pointerId == mActivePointerId) {
+            // This was our active pointer going up. Choose a new
+            // active pointer and adjust accordingly.
+            // TODO: Make this decision more intelligent.
+            final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
+            mLastMotionY = ev.getY(newPointerIndex);
+            mActivePointerId = ev.getPointerId(newPointerIndex);
+            if (mVelocityTracker != null) {
+                mVelocityTracker.clear();
+            }
+        }
+    }
+    
     @Override
     protected void onOverscrolled(int scrollX, int scrollY,
             boolean clampedX, boolean clampedY) {
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index cea6d3b..951563a 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -198,6 +198,7 @@
     private boolean mFreezesText;
     private boolean mFrozenWithFocus;
     private boolean mTemporaryDetach;
+    private boolean mDispatchTemporaryDetach;
 
     private boolean mEatTouchRelease = false;
     private boolean mScrolled = false;
@@ -6371,14 +6372,30 @@
         mBlink.postAtTime(mBlink, mShowCursor + BLINK);
     }
 
+    /**
+     * @hide
+     */
+    @Override
+    public void dispatchFinishTemporaryDetach() {
+        mDispatchTemporaryDetach = true;
+        super.dispatchFinishTemporaryDetach();
+        mDispatchTemporaryDetach = false;
+    }
+
     @Override
     public void onStartTemporaryDetach() {
-        mTemporaryDetach = true;
+        super.onStartTemporaryDetach();
+        // Only track when onStartTemporaryDetach() is called directly,
+        // usually because this instance is an editable field in a list
+        if (!mDispatchTemporaryDetach) mTemporaryDetach = true;
     }
     
     @Override
     public void onFinishTemporaryDetach() {
-        mTemporaryDetach = false;
+        super.onFinishTemporaryDetach();
+        // Only track when onStartTemporaryDetach() is called directly,
+        // usually because this instance is an editable field in a list
+        if (!mDispatchTemporaryDetach) mTemporaryDetach = false;
     }
     
     @Override
diff --git a/core/java/com/android/internal/app/TetherActivity.java b/core/java/com/android/internal/app/TetherActivity.java
index a48ccf9..5d71231 100644
--- a/core/java/com/android/internal/app/TetherActivity.java
+++ b/core/java/com/android/internal/app/TetherActivity.java
@@ -141,7 +141,7 @@
                 }
             } else {
                 for (String t : tethered) {
-                    if (!cm.untether("ppp0")) {
+                    if (!cm.untether(t)) {
                         error = true;
                     }
                 }
diff --git a/core/java/com/android/internal/content/SyncStateContentProviderHelper.java b/core/java/com/android/internal/content/SyncStateContentProviderHelper.java
index cd6a9a1..274082c 100644
--- a/core/java/com/android/internal/content/SyncStateContentProviderHelper.java
+++ b/core/java/com/android/internal/content/SyncStateContentProviderHelper.java
@@ -50,6 +50,11 @@
 
     public static final String PATH = "syncstate";
 
+    private static final String QUERY_COUNT_SYNC_STATE_ROWS =
+            "SELECT count(*)"
+                    + " FROM " + SYNC_STATE_TABLE
+                    + " WHERE " + SyncStateContract.Columns._ID + "=?";
+
     public void createDatabase(SQLiteDatabase db) {
         db.execSQL("DROP TABLE IF EXISTS " + SYNC_STATE_TABLE);
         db.execSQL("CREATE TABLE " + SYNC_STATE_TABLE + " ("
@@ -96,11 +101,17 @@
         return db.update(SYNC_STATE_TABLE, values, selection, selectionArgs);
     }
 
-    public void update(SQLiteDatabase db, long rowId, Object data) {
+    public int update(SQLiteDatabase db, long rowId, Object data) {
+        if (DatabaseUtils.longForQuery(db, QUERY_COUNT_SYNC_STATE_ROWS,
+                new String[]{Long.toString(rowId)}) < 1) {
+            return 0;
+        }
         db.execSQL("UPDATE " + SYNC_STATE_TABLE
                 + " SET " + SyncStateContract.Columns.DATA + "=?"
                 + " WHERE " + SyncStateContract.Columns._ID + "=" + rowId,
                 new Object[]{data});
+        // assume a row was modified since we know it exists
+        return 1;
     }
 
     public void onAccountsChanged(SQLiteDatabase db, Account[] accounts) {
diff --git a/common/java/com/android/common/DNParser.java b/core/java/com/android/internal/net/DNParser.java
similarity index 99%
rename from common/java/com/android/common/DNParser.java
rename to core/java/com/android/internal/net/DNParser.java
index 32d57c0..5254207 100644
--- a/common/java/com/android/common/DNParser.java
+++ b/core/java/com/android/internal/net/DNParser.java
@@ -15,7 +15,8 @@
  *  limitations under the License.
  */
 
-package com.android.common;
+package com.android.internal.net;
+
 
 import android.util.Log;
 
@@ -34,6 +35,8 @@
  *
  * <p>This class is used by {@link DomainNameValidator} only.  However, in order to make this
  * class visible from unit tests, it's made public.
+ * 
+ * @hide
  */
 public final class DNParser {
     private static final String TAG = "DNParser";
diff --git a/common/java/com/android/common/DomainNameValidator.java b/core/java/com/android/internal/net/DomainNameValidator.java
similarity index 99%
rename from common/java/com/android/common/DomainNameValidator.java
rename to core/java/com/android/internal/net/DomainNameValidator.java
index 25dc007..dbd5019 100644
--- a/common/java/com/android/common/DomainNameValidator.java
+++ b/core/java/com/android/internal/net/DomainNameValidator.java
@@ -13,7 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.common;
+package com.android.internal.net;
+
 
 import android.util.Config;
 import android.util.Log;
@@ -30,6 +31,7 @@
 
 import javax.security.auth.x500.X500Principal;
 
+/** @hide */
 public class DomainNameValidator {
     private final static String TAG = "DomainNameValidator";
 
diff --git a/core/java/com/android/internal/os/PowerProfile.java b/core/java/com/android/internal/os/PowerProfile.java
index 9e5bdff..2369d25 100644
--- a/core/java/com/android/internal/os/PowerProfile.java
+++ b/core/java/com/android/internal/os/PowerProfile.java
@@ -20,7 +20,7 @@
 import android.content.Context;
 import android.content.res.XmlResourceParser;
 
-import com.android.common.XmlUtils;
+import com.android.internal.util.XmlUtils;
 
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
diff --git a/common/java/com/android/common/FastXmlSerializer.java b/core/java/com/android/internal/util/FastXmlSerializer.java
similarity index 99%
rename from common/java/com/android/common/FastXmlSerializer.java
rename to core/java/com/android/internal/util/FastXmlSerializer.java
index 0d33941..592a8fa 100644
--- a/common/java/com/android/common/FastXmlSerializer.java
+++ b/core/java/com/android/internal/util/FastXmlSerializer.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.common;
+package com.android.internal.util;
 
 import org.xmlpull.v1.XmlSerializer;
 
diff --git a/common/java/com/android/common/XmlUtils.java b/core/java/com/android/internal/util/XmlUtils.java
similarity index 99%
rename from common/java/com/android/common/XmlUtils.java
rename to core/java/com/android/internal/util/XmlUtils.java
index dd57e49..8d8df16 100644
--- a/common/java/com/android/common/XmlUtils.java
+++ b/core/java/com/android/internal/util/XmlUtils.java
@@ -14,7 +14,8 @@
  * limitations under the License.
  */
 
-package com.android.common;
+package com.android.internal.util;
+
 
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index e8749ed..85d1a6f 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -45,6 +45,7 @@
 	android_view_Surface.cpp \
 	android_view_ViewRoot.cpp \
 	android_text_AndroidCharacter.cpp \
+	android_text_AndroidBidi.cpp \
 	android_text_KeyCharacterMap.cpp \
 	android_os_Debug.cpp \
 	android_os_FileUtils.cpp \
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 7c8df03..8586aca 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -142,6 +142,7 @@
 extern int register_android_net_wifi_WifiManager(JNIEnv* env);
 extern int register_android_security_Md5MessageDigest(JNIEnv *env);
 extern int register_android_text_AndroidCharacter(JNIEnv *env);
+extern int register_android_text_AndroidBidi(JNIEnv *env);
 extern int register_android_text_KeyCharacterMap(JNIEnv *env);
 extern int register_android_opengl_classes(JNIEnv *env);
 extern int register_android_bluetooth_HeadsetBase(JNIEnv* env);
@@ -1184,6 +1185,7 @@
     REG_JNI(register_android_emoji_EmojiFactory),
     REG_JNI(register_android_security_Md5MessageDigest),
     REG_JNI(register_android_text_AndroidCharacter),
+    REG_JNI(register_android_text_AndroidBidi),
     REG_JNI(register_android_text_KeyCharacterMap),
     REG_JNI(register_android_os_Process),
     REG_JNI(register_android_os_Binder),
diff --git a/core/jni/android_text_AndroidBidi.cpp b/core/jni/android_text_AndroidBidi.cpp
new file mode 100644
index 0000000..7696bb3
--- /dev/null
+++ b/core/jni/android_text_AndroidBidi.cpp
@@ -0,0 +1,81 @@
+/* //device/libs/android_runtime/android_text_AndroidBidi.cpp
+**
+** Copyright 2010, 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.
+*/
+
+#define LOG_TAG "AndroidUnicode"
+
+#include <jni.h>
+#include <android_runtime/AndroidRuntime.h>
+#include "utils/misc.h"
+#include "utils/Log.h"
+#include "unicode/ubidi.h"
+
+namespace android {
+    
+static void jniThrowException(JNIEnv* env, const char* exc, const char* msg = NULL)
+{
+    jclass excClazz = env->FindClass(exc);
+    LOG_ASSERT(excClazz, "Unable to find class %s", exc);
+
+    env->ThrowNew(excClazz, msg);
+}
+
+static jint runBidi(JNIEnv* env, jobject obj, jint dir, jcharArray chsArray, 
+                    jbyteArray infoArray, int n, jboolean haveInfo)
+{
+    // Parameters are checked on java side
+    // Failures from GetXXXArrayElements indicate a serious out-of-memory condition
+    // that we don't bother to report, we're probably dead anyway.
+    jint result = 0;
+    jchar* chs = env->GetCharArrayElements(chsArray, NULL);
+    if (chs != NULL) {
+        jbyte* info = env->GetByteArrayElements(infoArray, NULL);
+        if (info != NULL) {
+            UErrorCode status = U_ZERO_ERROR;
+            UBiDi* bidi = ubidi_openSized(n, 0, &status);
+            ubidi_setPara(bidi, chs, n, dir, NULL, &status);
+            if (U_SUCCESS(status)) {
+                for (int i = 0; i < n; ++i) {
+                  info[i] = ubidi_getLevelAt(bidi, i);
+                }
+                result = ubidi_getParaLevel(bidi);
+            } else {
+                jniThrowException(env, "java/lang/RuntimeException", NULL);
+            }
+            ubidi_close(bidi);
+
+            env->ReleaseByteArrayElements(infoArray, info, 0);
+        }
+        env->ReleaseCharArrayElements(chsArray, chs, JNI_ABORT);
+    }
+    return result;
+}
+
+static JNINativeMethod gMethods[] = {
+        { "runBidi", "(I[C[BIZ)I",
+        (void*) runBidi }
+};
+
+int register_android_text_AndroidBidi(JNIEnv* env)
+{
+    jclass clazz = env->FindClass("android/text/AndroidBidi");
+    LOG_ASSERT(clazz, "Cannot find android/text/AndroidBidi");
+    
+    return AndroidRuntime::registerNativeMethods(env, "android/text/AndroidBidi",
+            gMethods, NELEM(gMethods));
+}
+
+}
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index b3adf49..d66f513 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -593,12 +593,15 @@
     <attr name="backupAgent" format="string" />
 
     <!-- Whether to allow the application to participate in backup
-         infrastructure.
-         STOPSHIP: more explanation -->
+         infrastructure.  If this attribute is set to <code>false</code>, no backup
+         of the application will ever be performed, even by a full-system backup that
+         would otherwise cause all application data to be saved via adb.  The
+         default value of this attribute is <code>true</code>. -->
     <attr name="allowBackup" format="boolean" />
 
     <!-- Whether the application in question should be terminated after its
-         settings have been restored.  The default is to do so. -->
+         settings have been restored.  The default is <code>true</code>,
+         which means to do so. -->
     <attr name="killAfterRestore" format="boolean" />
 
     <!-- Whether the application needs to have its own Application subclass
@@ -606,6 +609,16 @@
          Application class to avoid interference with application logic. -->
     <attr name="restoreNeedsApplication" format="boolean" />
 
+    <!-- Indicate that the application is prepared to attempt a restore of any
+         backed-up dataset, even if the backup is apparently from a newer version
+         of the application than is currently installed on the device.  Setting
+         this attribute to <code>true</code> will permit the Backup Manager to
+         attempt restore even when a version mismatch suggests that the data are
+         incompatible.  <em>Use with caution!</em>
+
+         <p>The default value of this attribute is <code>false</code>. -->
+    <attr name="restoreAnyVersion" format="boolean" />
+
     <!-- The default install location defined by an application. -->
     <attr name="installLocation">
         <!-- Let the system decide ideal install location -->
@@ -700,6 +713,7 @@
         <attr name="allowBackup" />
         <attr name="killAfterRestore" />
         <attr name="restoreNeedsApplication" />
+        <attr name="restoreAnyVersion" />
         <attr name="neverEncrypt" />
     </declare-styleable>
     
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 5d561b8..1e11a99 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -138,6 +138,9 @@
          closed.  The default is 0. -->
     <integer name="config_lidNavigationAccessibility">0</integer>
 
+    <!-- Indicate whether the SD card is accessible without removing the battery. -->
+    <bool name="config_batterySdCardAccessibility">false</bool>
+
     <!-- Vibrator pattern for feedback about a long screen/key press -->
     <integer-array name="config_longPressVibePattern">
         <item>0</item>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index b334337..5da8e85 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1231,6 +1231,7 @@
   <public type="attr" name="safeMode" id="0x010102b8" />
   <public type="attr" name="webTextViewStyle" id="0x010102b9" />
   <public type="attr" name="overscrollMode" id="0x010102ba" />
+  <public type="attr" name="restoreAnyVersion" id="0x010102bb" />
 
   <public type="anim" name="cycle_interpolator" id="0x010a000c" />
     
diff --git a/core/tests/coretests/Android.mk b/core/tests/coretests/Android.mk
index 1fb9852..b0e2843 100644
--- a/core/tests/coretests/Android.mk
+++ b/core/tests/coretests/Android.mk
@@ -9,6 +9,8 @@
 	$(call all-java-files-under, src) \
 	src/android/os/IAidlTest.aidl
 
+LOCAL_STATIC_JAVA_LIBRARIES += android-common
+
 LOCAL_JAVA_LIBRARIES := android.test.runner
 LOCAL_PACKAGE_NAME := FrameworksCoreTests
 
diff --git a/core/tests/coretests/src/android/text/StaticLayoutBidiTest.java b/core/tests/coretests/src/android/text/StaticLayoutBidiTest.java
index ccd0dae..da6036a 100644
--- a/core/tests/coretests/src/android/text/StaticLayoutBidiTest.java
+++ b/core/tests/coretests/src/android/text/StaticLayoutBidiTest.java
@@ -88,7 +88,38 @@
         int resultDir = StaticLayout.bidi(dir, chs, chInfo, n, false);
         
         {
-            StringBuilder sb = new StringBuilder("xdirs:");
+            StringBuilder sb = new StringBuilder("info:");
+            for (int i = 0; i < n; ++i) {
+                sb.append(" ").append(String.valueOf(chInfo[i]));
+            }
+            Log.i("BIDI", sb.toString());
+        }
+        
+        char[] resultLevelChars = new char[n];
+        for (int i = 0; i < n; ++i) {
+            resultLevelChars[i] = (char)('0' + chInfo[i]);
+        }
+        String resultLevels = new String(resultLevelChars);
+        assertEquals("direction", expectedDir, resultDir);
+        assertEquals("levels", expectedLevels, resultLevels);
+    }
+    
+    @SmallTest
+    public void testNativeBidi() {
+        // native bidi returns levels, not simply directions
+        expectNativeBidi(REQ_DL,  ALEF + BET + GIMEL + " abc", "1111222", R);
+    }
+    
+    private void expectNativeBidi(int dir, String text, 
+            String expectedLevels, int expectedDir) {
+        char[] chs = text.toCharArray();
+        int n = chs.length;
+        byte[] chInfo = new byte[n];
+        
+        int resultDir = AndroidBidi.bidi(dir, chs, chInfo, n, false);
+        
+        {
+            StringBuilder sb = new StringBuilder("info:");
             for (int i = 0; i < n; ++i) {
                 sb.append(" ").append(String.valueOf(chInfo[i]));
             }
diff --git a/docs/html/guide/practices/design/performance.jd b/docs/html/guide/practices/design/performance.jd
index ab3b3d3..baed020 100644
--- a/docs/html/guide/practices/design/performance.jd
+++ b/docs/html/guide/practices/design/performance.jd
@@ -356,25 +356,19 @@
 
 <p>There are several alternatives for iterating through an array:</p>
 
-<pre>public class Foo {
-    int mSplat;
-}
-public class ArrayBenchmark {
-    Foo[] mArray = new Foo[27];
-    {
-        for (int i = 0; i &lt; mArray.length; ++i) {
-            mArray[i] = new Foo();
-        }
+<pre>    static class Foo {
+        int mSplat;
     }
+    Foo[] mArray = ...
 
-    public static void zero() {
+    public void zero() {
         int sum = 0;
         for (int i = 0; i &lt; mArray.length; ++i) {
             sum += mArray[i].mSplat;
         }
     }
 
-    public static void one() {
+    public void one() {
         int sum = 0;
         Foo[] localArray = mArray;
         int len = localArray.length;
@@ -384,13 +378,13 @@
         }
     }
 
-    public static void two() {
+    public void two() {
         int sum = 0;
         for (Foo a : mArray) {
             sum += a.mSplat;
         }
     }
-}</pre>
+</pre>
 
 <p><strong>zero()</strong> is slowest, because the JIT can't yet optimize away
 the cost of getting the array length once for every iteration through the
diff --git a/libs/audioflinger/AudioPolicyManagerBase.cpp b/libs/audioflinger/AudioPolicyManagerBase.cpp
index 42b6508..7b866c7 100644
--- a/libs/audioflinger/AudioPolicyManagerBase.cpp
+++ b/libs/audioflinger/AudioPolicyManagerBase.cpp
@@ -82,8 +82,8 @@
                     // keep track of SCO device address
                     mScoDeviceAddress = String8(device_address, MAX_DEVICE_ADDRESS_LEN);
 #ifdef WITH_A2DP
-                    if ((mA2dpDeviceAddress == mScoDeviceAddress) &&
-                        (mPhoneState != AudioSystem::MODE_NORMAL)) {
+                    if (mA2dpOutput != 0 &&
+                        mPhoneState != AudioSystem::MODE_NORMAL) {
                         mpClientInterface->suspendOutput(mA2dpOutput);
                     }
 #endif
@@ -116,8 +116,8 @@
                 if (AudioSystem::isBluetoothScoDevice(device)) {
                     mScoDeviceAddress = "";
 #ifdef WITH_A2DP
-                    if ((mA2dpDeviceAddress == mScoDeviceAddress) &&
-                        (mPhoneState != AudioSystem::MODE_NORMAL)) {
+                    if (mA2dpOutput != 0 &&
+                        mPhoneState != AudioSystem::MODE_NORMAL) {
                         mpClientInterface->restoreOutput(mA2dpOutput);
                     }
 #endif
@@ -275,10 +275,8 @@
     newDevice = getNewDevice(mHardwareOutput, false);
 #ifdef WITH_A2DP
     checkOutputForAllStrategies(newDevice);
-    // suspend A2DP output if SCO device address is the same as A2DP device address.
-    // no need to check that a SCO device is actually connected as mScoDeviceAddress == ""
-    // if none is connected and the test below will fail.
-    if (mA2dpDeviceAddress == mScoDeviceAddress) {
+    // suspend A2DP output if a SCO device is present.
+    if (mA2dpOutput != 0 && mScoDeviceAddress != "") {
         if (oldState == AudioSystem::MODE_NORMAL) {
             mpClientInterface->suspendOutput(mA2dpOutput);
         } else if (state == AudioSystem::MODE_NORMAL) {
@@ -1191,7 +1189,7 @@
     }
     AudioOutputDescriptor *hwOutputDesc = mOutputs.valueFor(mHardwareOutput);
 
-    if (mA2dpDeviceAddress == mScoDeviceAddress) {
+    if (mScoDeviceAddress != "") {
         // It is normal to suspend twice if we are both in call,
         // and have the hardware audio output routed to BT SCO
         if (mPhoneState != AudioSystem::MODE_NORMAL) {
@@ -1556,9 +1554,9 @@
         usleep(outputDesc->mLatency*2*1000);
     }
 #ifdef WITH_A2DP
-    // suspend A2D output if SCO device is selected
+    // suspend A2DP output if SCO device is selected
     if (AudioSystem::isBluetoothScoDevice((AudioSystem::audio_devices)device)) {
-         if (mA2dpOutput && mScoDeviceAddress == mA2dpDeviceAddress) {
+         if (mA2dpOutput != 0) {
              mpClientInterface->suspendOutput(mA2dpOutput);
          }
     }
@@ -1573,7 +1571,7 @@
 #ifdef WITH_A2DP
     // if disconnecting SCO device, restore A2DP output
     if (AudioSystem::isBluetoothScoDevice((AudioSystem::audio_devices)prevDevice)) {
-         if (mA2dpOutput && mScoDeviceAddress == mA2dpDeviceAddress) {
+         if (mA2dpOutput != 0) {
              LOGV("restore A2DP output");
              mpClientInterface->restoreOutput(mA2dpOutput);
          }
diff --git a/location/java/com/android/internal/location/GpsXtraDownloader.java b/location/java/com/android/internal/location/GpsXtraDownloader.java
index 02a9f48..978bda2 100644
--- a/location/java/com/android/internal/location/GpsXtraDownloader.java
+++ b/location/java/com/android/internal/location/GpsXtraDownloader.java
@@ -32,10 +32,10 @@
 
 import android.content.Context;
 import android.net.Proxy;
+import android.net.http.AndroidHttpClient;
 import android.util.Config;
 import android.util.Log;
 
-import com.android.common.AndroidHttpClient;
 
 
 /**
diff --git a/mms-common/Android.mk b/mms-common/Android.mk
index de994c0..57f1ccc 100644
--- a/mms-common/Android.mk
+++ b/mms-common/Android.mk
@@ -20,6 +20,7 @@
 include $(CLEAR_VARS)
 LOCAL_MODULE := mms-common
 LOCAL_SRC_FILES := $(call all-java-files-under, java)
+LOCAL_STATIC_JAVA_LIBRARIES += android-common
 include $(BUILD_STATIC_JAVA_LIBRARY)
 
 # Include this library in the build server's output directory
diff --git a/mms-common/java/com/android/mmscommon/telephony/TelephonyProvider.java b/mms-common/java/com/android/mmscommon/telephony/TelephonyProvider.java
index 0237bc2..87e4758 100644
--- a/mms-common/java/com/android/mmscommon/telephony/TelephonyProvider.java
+++ b/mms-common/java/com/android/mmscommon/telephony/TelephonyProvider.java
@@ -32,8 +32,8 @@
 import android.text.TextUtils;
 import android.util.Config;
 import android.util.Log;
+import android.util.Patterns;
 
-import com.android.common.Patterns;
 import android.database.sqlite.SqliteWrapper;
 
 /**
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index 8036e52..18e247e 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -44,8 +44,8 @@
 import android.util.Config;
 import android.util.Log;
 import android.util.Xml;
-import com.android.common.XmlUtils;
 import com.android.internal.telephony.RILConstants;
+import com.android.internal.util.XmlUtils;
 
 import com.android.internal.widget.LockPatternUtils;
 import com.android.internal.widget.LockPatternView;
diff --git a/packages/TtsService/jni/android_tts_SynthProxy.cpp b/packages/TtsService/jni/android_tts_SynthProxy.cpp
index 35b5675..2f5cfa3 100644
--- a/packages/TtsService/jni/android_tts_SynthProxy.cpp
+++ b/packages/TtsService/jni/android_tts_SynthProxy.cpp
@@ -45,6 +45,9 @@
 #define USAGEMODE_PLAY_IMMEDIATELY 0
 #define USAGEMODE_WRITE_TO_FILE    1
 
+#define SYNTHPLAYSTATE_IS_STOPPED 0
+#define SYNTHPLAYSTATE_IS_PLAYING 1
+
 using namespace android;
 
 // ----------------------------------------------------------------------------
@@ -154,6 +157,8 @@
         TtsEngine*                mNativeSynthInterface;
         void*                     mEngineLibHandle;
         AudioTrack*               mAudioOut;
+        int8_t                    mPlayState;
+        Mutex                     mPlayLock;
         AudioSystem::stream_type  mStreamType;
         uint32_t                  mSampleRate;
         uint32_t                  mAudFormat;
@@ -166,6 +171,7 @@
             mNativeSynthInterface = NULL;
             mEngineLibHandle = NULL;
             mAudioOut = NULL;
+            mPlayState =  SYNTHPLAYSTATE_IS_STOPPED;
             mStreamType = DEFAULT_TTS_STREAM_TYPE;
             mSampleRate = DEFAULT_TTS_RATE;
             mAudFormat  = DEFAULT_TTS_FORMAT;
@@ -223,6 +229,7 @@
             if (minBufCount < 2) minBufCount = 2;
             int minFrameCount = (afFrameCount * rate * minBufCount)/afSampleRate;
 
+            mPlayLock.lock();
             mAudioOut = new AudioTrack(mStreamType, rate, format,
                     (channel == 2) ? AudioSystem::CHANNEL_OUT_STEREO : AudioSystem::CHANNEL_OUT_MONO,
                     minFrameCount > 4096 ? minFrameCount : 4096,
@@ -237,6 +244,7 @@
               mAudioOut->setVolume(1.0f, 1.0f);
               LOGV("AudioTrack ready");
             }
+            mPlayLock.unlock();
         }
 };
 
@@ -288,6 +296,12 @@
         if (bufferSize > 0) {
             prepAudioTrack(pJniData, pForAfter->streamType, rate, (AudioSystem::audio_format)format, channel);
             if (pJniData->mAudioOut) {
+                pJniData->mPlayLock.lock();
+                if(pJniData->mAudioOut->stopped()
+                        && (pJniData->mPlayState == SYNTHPLAYSTATE_IS_PLAYING)) {
+                    pJniData->mAudioOut->start();
+                }
+                pJniData->mPlayLock.unlock();
                 if (bUseFilter) {
                     applyFilter((int16_t*)wav, bufferSize/2);
                 }
@@ -711,9 +725,9 @@
 
     SynthProxyJniStorage* pSynthData = (SynthProxyJniStorage*)jniData;
 
-    if (pSynthData->mAudioOut) {
-        pSynthData->mAudioOut->start();
-    }
+    pSynthData->mPlayLock.lock();
+    pSynthData->mPlayState = SYNTHPLAYSTATE_IS_PLAYING;
+    pSynthData->mPlayLock.unlock();
 
     afterSynthData_t* pForAfter = new (afterSynthData_t);
     pForAfter->jniStorage = jniData;
@@ -744,9 +758,13 @@
 
     SynthProxyJniStorage* pSynthData = (SynthProxyJniStorage*)jniData;
 
+    pSynthData->mPlayLock.lock();
+    pSynthData->mPlayState = SYNTHPLAYSTATE_IS_STOPPED;
     if (pSynthData->mAudioOut) {
         pSynthData->mAudioOut->stop();
     }
+    pSynthData->mPlayLock.unlock();
+
     if (pSynthData->mNativeSynthInterface) {
         result = pSynthData->mNativeSynthInterface->stop();
     }
diff --git a/preloaded-classes b/preloaded-classes
index 092b539c..9fc000f 100644
--- a/preloaded-classes
+++ b/preloaded-classes
@@ -1,850 +1,1039 @@
 # Classes which are preloaded by com.android.internal.os.ZygoteInit.
+# Automatically generated by frameworks/base/tools/preload/WritePreloadedClassFile.java.
+# MIN_LOAD_TIME_MICROS=1250
 android.R$styleable
+android.accounts.AccountManager
+android.accounts.AccountManager$4
+android.accounts.AccountManager$6
+android.accounts.AccountManager$AmsTask
+android.accounts.AccountManager$BaseFutureTask
+android.accounts.AccountManager$Future2Task
+android.accounts.AuthenticatorDescription
+android.accounts.IAccountAuthenticatorResponse$Stub
+android.accounts.IAccountManager$Stub
+android.accounts.IAccountManagerResponse$Stub
 android.app.Activity
 android.app.ActivityGroup
-android.app.ActivityManager$MemoryInfo$1
+android.app.ActivityManager$RunningAppProcessInfo
+android.app.ActivityManager$RunningServiceInfo
 android.app.ActivityManagerNative
 android.app.ActivityManagerProxy
 android.app.ActivityThread
-android.app.ActivityThread$ActivityRecord
-android.app.ActivityThread$AppBindData
 android.app.ActivityThread$ApplicationThread
-android.app.ActivityThread$ContextCleanupInfo
-android.app.ActivityThread$GcIdler
 android.app.ActivityThread$H
-android.app.ActivityThread$Idler
-android.app.ActivityThread$PackageInfo
-android.app.ActivityThread$PackageInfo$ReceiverDispatcher
-android.app.ActivityThread$PackageInfo$ReceiverDispatcher$InnerReceiver
-android.app.ActivityThread$PackageInfo$ServiceDispatcher
-android.app.ActivityThread$PackageInfo$ServiceDispatcher$InnerConnection
-android.app.ActivityThread$ProviderRecord
-android.app.ActivityThread$ProviderRefCount
 android.app.AlertDialog
-android.app.Application
-android.app.ApplicationLoaders
 android.app.ApplicationThreadNative
 android.app.ContextImpl
-android.app.ContextImpl$ApplicationContentResolver
 android.app.ContextImpl$ApplicationPackageManager
-android.app.ContextImpl$ApplicationPackageManager$PackageRemovedReceiver
-android.app.ContextImpl$ApplicationPackageManager$ResourceName
-android.app.ContextImpl$SharedPreferencesImpl
+android.app.DatePickerDialog
 android.app.Dialog
 android.app.ExpandableListActivity
 android.app.IActivityManager
-android.app.IActivityManager$ContentProviderHolder$1
+android.app.IActivityManager$ContentProviderHolder
 android.app.IAlarmManager$Stub
-android.app.IAlarmManager$Stub$Proxy
-android.app.IApplicationThread
-android.app.INotificationManager$Stub
-android.app.INotificationManager$Stub$Proxy
-android.app.ISearchManager
-android.app.ISearchManager$Stub
-android.app.ISearchManager$Stub$Proxy
+android.app.IDevicePolicyManager$Stub
+android.app.IStatusBar$Stub
+android.app.ITransientNotification$Stub
 android.app.Instrumentation
-android.app.IntentReceiverLeaked
+android.app.IntentService
 android.app.ListActivity
-android.app.ListActivity$1
-android.app.ListActivity$2
 android.app.LocalActivityManager
 android.app.Notification
-android.app.NotificationManager
 android.app.PendingIntent
-android.app.PendingIntent$1
 android.app.ProgressDialog
-android.app.ReceiverRestrictedContext
 android.app.ResultInfo
-android.app.ResultInfo$1
 android.app.SearchDialog
 android.app.SearchDialog$SearchAutoComplete
+android.app.SearchDialog$SearchBar
+android.app.SearchableInfo
 android.app.Service
-android.app.ServiceConnectionLeaked
+android.app.SuggestionsAdapter
+android.app.SuperNotCalledException
 android.app.TabActivity
-android.content.BroadcastReceiver
-android.content.ComponentCallbacks
+android.app.TimePickerDialog
+android.appwidget.AppWidgetHost
+android.appwidget.AppWidgetHostView
+android.appwidget.AppWidgetHostView$ParcelableSparseArray
+android.appwidget.AppWidgetManager
+android.appwidget.AppWidgetProvider
+android.appwidget.AppWidgetProviderInfo
+android.backup.BackupDataInput
+android.backup.BackupDataInput$EntityHeader
+android.backup.BackupDataOutput
+android.backup.BackupHelperAgent
+android.backup.BackupHelperDispatcher
+android.backup.BackupHelperDispatcher$Header
+android.backup.FileBackupHelperBase
+android.backup.IBackupManager$Stub
+android.backup.RestoreSet
+android.bluetooth.BluetoothAdapter
+android.bluetooth.BluetoothAudioGateway
+android.bluetooth.BluetoothSocket
+android.bluetooth.BluetoothUuid
+android.bluetooth.HeadsetBase
+android.bluetooth.IBluetooth
+android.bluetooth.IBluetooth$Stub
+android.bluetooth.IBluetoothA2dp
+android.bluetooth.IBluetoothA2dp$Stub
+android.bluetooth.IBluetoothHeadset$Stub
+android.bluetooth.ScoSocket
 android.content.ComponentName
-android.content.ComponentName$1
 android.content.ContentProvider$Transport
-android.content.ContentProviderProxy
-android.content.ContentQueryMap
-android.content.ContentQueryMap$1
+android.content.ContentProviderOperation
+android.content.ContentProviderResult
 android.content.ContentResolver
-android.content.ContentResolver$CursorWrapperInner
 android.content.ContentValues
 android.content.Context
 android.content.ContextWrapper
-android.content.DialogInterface
-android.content.DialogInterface$OnCancelListener
-android.content.DialogInterface$OnDismissListener
-android.content.IContentProvider
-android.content.IContentService
 android.content.IContentService$Stub
+android.content.ISyncContext$Stub
 android.content.Intent
-android.content.Intent$1
 android.content.IntentFilter
+android.content.IntentSender
 android.content.SearchRecentSuggestionsProvider
 android.content.SyncResult
 android.content.SyncStats
 android.content.UriMatcher
 android.content.pm.ActivityInfo
-android.content.pm.ActivityInfo$1
 android.content.pm.ApplicationInfo
-android.content.pm.ApplicationInfo$1
-android.content.pm.ComponentInfo
-android.content.pm.IPackageManager
+android.content.pm.ConfigurationInfo
+android.content.pm.IPackageDataObserver$Stub
 android.content.pm.IPackageManager$Stub
 android.content.pm.IPackageManager$Stub$Proxy
+android.content.pm.IPackageStatsObserver$Stub
 android.content.pm.InstrumentationInfo
-android.content.pm.InstrumentationInfo$1
-android.content.pm.PackageItemInfo
+android.content.pm.PackageInfo
 android.content.pm.PackageManager
 android.content.pm.PackageManager$NameNotFoundException
+android.content.pm.PackageStats
 android.content.pm.PermissionInfo
 android.content.pm.ProviderInfo
-android.content.pm.ProviderInfo$1
-android.content.pm.ResolveInfo$1
-android.content.pm.ServiceInfo$1
+android.content.pm.ResolveInfo
+android.content.pm.ResolveInfo$DisplayNameComparator
+android.content.pm.Signature
+android.content.res.AssetFileDescriptor
+android.content.res.AssetFileDescriptor$1
 android.content.res.AssetManager
 android.content.res.AssetManager$AssetInputStream
 android.content.res.ColorStateList
 android.content.res.ColorStateList$1
+android.content.res.CompatibilityInfo
+android.content.res.CompatibilityInfo$1
 android.content.res.Configuration
+android.content.res.Configuration$1
 android.content.res.Resources
-android.content.res.Resources$Theme
+android.content.res.Resources$1
 android.content.res.StringBlock
 android.content.res.TypedArray
 android.content.res.XmlBlock
 android.content.res.XmlBlock$Parser
+android.content.res.XmlResourceParser
 android.database.AbstractCursor
-android.database.AbstractCursor$SelfContentObserver
 android.database.AbstractWindowedCursor
-android.database.BulkCursorNative
-android.database.BulkCursorProxy
 android.database.BulkCursorToCursorAdaptor
-android.database.ContentObservable
-android.database.ContentObserver$Transport
-android.database.Cursor
+android.database.CharArrayBuffer
 android.database.CursorToBulkCursorAdaptor
-android.database.CursorToBulkCursorAdaptor$ContentObserverProxy
 android.database.CursorWindow
+android.database.CursorWindow$1
 android.database.CursorWrapper
-android.database.DataSetObservable
-android.database.IContentObserver$Stub$Proxy
-android.database.MergeCursor
+android.database.MatrixCursor
+android.database.sqlite.SQLiteClosable
+android.database.sqlite.SQLiteCompiledSql
+android.database.sqlite.SQLiteContentHelper
 android.database.sqlite.SQLiteCursor
 android.database.sqlite.SQLiteDatabase
-android.database.sqlite.SQLiteDatabase$CursorFactory
-android.database.sqlite.SQLiteDirectCursorDriver
+android.database.sqlite.SQLiteDebug
+android.database.sqlite.SQLiteDebug$PagerStats
+android.database.sqlite.SQLiteProgram
 android.database.sqlite.SQLiteQuery
+android.database.sqlite.SQLiteQueryBuilder
 android.database.sqlite.SQLiteStatement
-android.ddm.DdmHandleAppName
+android.database.sqlite.SqliteWrapper
 android.ddm.DdmHandleExit
 android.ddm.DdmHandleHeap
 android.ddm.DdmHandleHello
 android.ddm.DdmHandleNativeHeap
+android.ddm.DdmHandleProfiling
 android.ddm.DdmHandleThread
 android.ddm.DdmRegister
+android.debug.JNITest
+android.emoji.EmojiFactory
+android.graphics.AvoidXfermode
 android.graphics.Bitmap
+android.graphics.Bitmap$1
+android.graphics.Bitmap$CompressFormat
+android.graphics.Bitmap$Config
+android.graphics.BitmapFactory
+android.graphics.BitmapFactory$Options
 android.graphics.BitmapShader
+android.graphics.BlurMaskFilter
+android.graphics.Camera
 android.graphics.Canvas
-android.graphics.Canvas$EdgeType
+android.graphics.Canvas$VertexMode
 android.graphics.Color
+android.graphics.ColorFilter
+android.graphics.ColorMatrixColorFilter
+android.graphics.ComposePathEffect
+android.graphics.ComposeShader
+android.graphics.CornerPathEffect
+android.graphics.DashPathEffect
+android.graphics.DiscretePathEffect
+android.graphics.DrawFilter
+android.graphics.EmbossMaskFilter
 android.graphics.Interpolator
+android.graphics.LayerRasterizer
+android.graphics.LightingColorFilter
 android.graphics.LinearGradient
+android.graphics.MaskFilter
 android.graphics.Matrix
-android.graphics.Matrix$ScaleToFit
+android.graphics.Movie
 android.graphics.NinePatch
 android.graphics.Paint
+android.graphics.Paint$Align
+android.graphics.Paint$Cap
+android.graphics.Paint$FontMetrics
+android.graphics.Paint$FontMetricsInt
+android.graphics.Paint$Join
+android.graphics.Paint$Style
 android.graphics.PaintFlagsDrawFilter
 android.graphics.Path
-android.graphics.Path$Direction
+android.graphics.Path$FillType
+android.graphics.PathDashPathEffect
+android.graphics.PathEffect
+android.graphics.PathMeasure
 android.graphics.Picture
-android.graphics.PorterDuff
+android.graphics.PixelFormat
+android.graphics.PixelXorXfermode
+android.graphics.Point
+android.graphics.PointF
 android.graphics.PorterDuff$Mode
+android.graphics.PorterDuffColorFilter
 android.graphics.PorterDuffXfermode
+android.graphics.RadialGradient
+android.graphics.Rasterizer
 android.graphics.Rect
+android.graphics.Rect$1
 android.graphics.RectF
+android.graphics.RectF$1
 android.graphics.Region
+android.graphics.Region$1
 android.graphics.Region$Op
+android.graphics.RegionIterator
 android.graphics.Shader
 android.graphics.Shader$TileMode
+android.graphics.SumPathEffect
+android.graphics.SweepGradient
+android.graphics.TableMaskFilter
 android.graphics.Typeface
 android.graphics.Xfermode
+android.graphics.YuvImage
+android.graphics.drawable.Animatable
+android.graphics.drawable.AnimatedRotateDrawable
+android.graphics.drawable.AnimatedRotateDrawable$AnimatedRotateState
 android.graphics.drawable.AnimationDrawable
+android.graphics.drawable.AnimationDrawable$AnimationState
 android.graphics.drawable.BitmapDrawable
 android.graphics.drawable.BitmapDrawable$BitmapState
+android.graphics.drawable.ClipDrawable
+android.graphics.drawable.ClipDrawable$ClipState
 android.graphics.drawable.ColorDrawable
 android.graphics.drawable.ColorDrawable$ColorState
 android.graphics.drawable.Drawable
+android.graphics.drawable.Drawable$Callback
+android.graphics.drawable.Drawable$ConstantState
 android.graphics.drawable.DrawableContainer
+android.graphics.drawable.DrawableContainer$DrawableContainerState
 android.graphics.drawable.GradientDrawable
+android.graphics.drawable.GradientDrawable$GradientState
+android.graphics.drawable.GradientDrawable$Orientation
 android.graphics.drawable.LayerDrawable
 android.graphics.drawable.LayerDrawable$ChildDrawable
 android.graphics.drawable.LayerDrawable$LayerState
 android.graphics.drawable.NinePatchDrawable
 android.graphics.drawable.NinePatchDrawable$NinePatchState
-android.graphics.drawable.PaintDrawable
-android.graphics.drawable.RotateDrawable
-android.graphics.drawable.RotateDrawable$RotateState
-android.graphics.drawable.ScaleDrawable
-android.graphics.drawable.ScaleDrawable$ScaleState
 android.graphics.drawable.ShapeDrawable
-android.graphics.drawable.ShapeDrawable$ShapeState
 android.graphics.drawable.StateListDrawable
 android.graphics.drawable.StateListDrawable$StateListState
 android.graphics.drawable.TransitionDrawable
 android.graphics.drawable.TransitionDrawable$TransitionState
-android.graphics.drawable.shapes.RoundRectShape
+android.graphics.utils.BoundaryPatch
+android.hardware.Camera
+android.hardware.Camera$Parameters
+android.hardware.GeomagneticField
 android.hardware.SensorManager
-android.inputmethodservice.KeyboardView
+android.location.Address
+android.location.Criteria
+android.location.GeocoderParams
+android.location.IGpsStatusListener$Stub
 android.location.ILocationManager$Stub
+android.location.ILocationManager$Stub$Proxy
 android.location.Location
+android.location.LocationManager
+android.location.LocationProviderInterface
+android.media.AudioFormat
 android.media.AudioManager
+android.media.AudioRecord
+android.media.AudioSystem
+android.media.AudioTrack
+android.media.ExifInterface
 android.media.IAudioService$Stub
-android.media.IAudioService$Stub$Proxy
+android.media.JetPlayer
+android.media.MediaFile
+android.media.MediaMetadataRetriever
+android.media.MediaPlayer
+android.media.MediaScanner
+android.media.Metadata
+android.media.MiniThumbFile
+android.media.ThumbnailUtils
+android.media.ToneGenerator
+android.net.ConnectivityManager
+android.net.Credentials
+android.net.DhcpInfo
+android.net.DhcpInfo$1
+android.net.Downloads
+android.net.Downloads$ByUri
+android.net.IConnectivityManager$Stub
+android.net.LocalServerSocket
 android.net.LocalSocket
-android.net.LocalSocketAddress
-android.net.LocalSocketAddress$Namespace
 android.net.LocalSocketImpl
 android.net.LocalSocketImpl$SocketInputStream
 android.net.LocalSocketImpl$SocketOutputStream
 android.net.NetworkInfo
 android.net.NetworkInfo$DetailedState
+android.net.NetworkUtils
 android.net.SSLCertificateSocketFactory
 android.net.TrafficStats
 android.net.Uri
-android.net.Uri$1
-android.net.Uri$AbstractHierarchicalUri
-android.net.Uri$AbstractPart
 android.net.Uri$HierarchicalUri
 android.net.Uri$OpaqueUri
 android.net.Uri$Part
-android.net.Uri$Part$EmptyPart
-android.net.Uri$PathPart
-android.net.Uri$PathSegments
-android.net.Uri$StringUri
 android.net.WebAddress
-android.net.http.CertificateChainValidator
+android.net.http.AndroidHttpClient
+android.net.http.AndroidHttpClientConnection
 android.net.http.EventHandler
+android.net.http.Headers
 android.net.http.HttpsConnection
+android.net.http.HttpDateTime
+android.net.http.Request
 android.net.http.RequestQueue
+android.net.http.SslCertificate
 android.net.http.SslError
 android.net.wifi.IWifiManager$Stub
+android.net.wifi.ScanResult
 android.net.wifi.SupplicantState
 android.net.wifi.WifiConfiguration
 android.net.wifi.WifiInfo
-android.opengl.Material
+android.net.wifi.WifiManager
+android.net.wifi.WifiNative
+android.opengl.ETC1
+android.opengl.GLES10
+android.opengl.GLES10Ext
+android.opengl.GLES11
+android.opengl.GLES11Ext
+android.opengl.GLES20
+android.opengl.GLSurfaceView
+android.opengl.GLSurfaceView$ComponentSizeChooser
+android.opengl.GLUtils
+android.opengl.Matrix
+android.opengl.Visibility
 android.os.Binder
 android.os.BinderProxy
 android.os.Build
+android.os.Build$VERSION
 android.os.Bundle
-android.os.Bundle$1
+android.os.Debug
+android.os.Debug$MemoryInfo
+android.os.Debug$MemoryInfo$1
+android.os.DropBoxManager$Entry
 android.os.Environment
+android.os.FileObserver$ObserverThread
 android.os.FileUtils
+android.os.FileUtils$FileStatus
 android.os.Handler
-android.os.HandlerThread
 android.os.IBinder
+android.os.IInterface
 android.os.IPowerManager$Stub
-android.os.IPowerManager$Stub$Proxy
-android.os.IServiceManager
-android.os.IVibratorService$Stub
-android.os.IVibratorService$Stub$Proxy
 android.os.Looper
+android.os.MemoryFile
 android.os.Message
-android.os.Message$1
-android.os.MessageQueue
-android.os.MessageQueue$IdleHandler
 android.os.Parcel
-android.os.PatternMatcher
-android.os.PatternMatcher$1
-android.os.PowerManager
-android.os.PowerManager$WakeLock
-android.os.PowerManager$WakeLock$1
+android.os.Parcel$1
+android.os.ParcelFileDescriptor
+android.os.ParcelFileDescriptor$1
+android.os.ParcelUuid
+android.os.Parcelable
+android.os.Parcelable$Creator
+android.os.Power
 android.os.Process
-android.os.ServiceManager
-android.os.ServiceManagerNative
-android.os.ServiceManagerProxy
-android.os.Vibrator
-android.preference.CheckBoxPreference
+android.os.RecoverySystem
+android.os.ResultReceiver
+android.os.StatFs
+android.os.SystemClock
+android.os.SystemProperties
+android.os.UEventObserver
+android.os.storage.IMountService$Stub
+android.os.storage.IMountService$Stub$Proxy
+android.pim.EventRecurrence
+android.pim.RecurrenceSet
+android.preference.CheckBoxPreference$SavedState
 android.preference.DialogPreference
-android.preference.EditTextPreference
 android.preference.ListPreference
 android.preference.Preference
 android.preference.PreferenceActivity
 android.preference.PreferenceGroup
 android.preference.PreferenceGroupAdapter
+android.preference.PreferenceInflater
 android.preference.PreferenceManager
 android.preference.PreferenceScreen
 android.preference.RingtonePreference
-android.sax.RootElement
+android.preference.VolumePreference
+android.preference.VolumePreference$SeekBarVolumizer
+android.provider.Browser
+android.provider.Calendar
+android.provider.Calendar$Attendees
+android.provider.Calendar$CalendarAlerts
+android.provider.Calendar$Calendars
+android.provider.Calendar$EventDays
+android.provider.Calendar$Events
+android.provider.Calendar$Reminders
+android.provider.Contacts
+android.provider.Contacts$ContactMethods
+android.provider.ContactsContract
+android.provider.ContactsContract$CommonDataKinds$Email
+android.provider.ContactsContract$CommonDataKinds$Phone
+android.provider.ContactsContract$CommonDataKinds$StructuredPostal
+android.provider.ContactsContract$Contacts
+android.provider.ContactsContract$Data
+android.provider.ContactsContract$DataColumnsWithJoins
+android.provider.ContactsContract$PhoneLookup
+android.provider.ContactsContract$RawContacts
+android.provider.ContactsContract$RawContacts$EntityIteratorImpl
+android.provider.ContactsContract$RawContactsEntity
+android.provider.Downloads
+android.provider.Downloads$Impl
+android.provider.MediaStore
+android.provider.MediaStore$Audio$Artists
+android.provider.MediaStore$Audio$Media
+android.provider.MediaStore$Images$Media
+android.provider.MediaStore$Images$Thumbnails
+android.provider.MediaStore$Video$Media
+android.provider.SearchRecentSuggestions
+android.provider.Settings$Secure
+android.provider.Settings$System
+android.provider.UserDictionary$Words
+android.security.KeyStore
+android.security.Md5MessageDigest
+android.security.MessageDigest
+android.security.Sha1MessageDigest
+android.server.BluetoothA2dpService
+android.server.BluetoothEventLoop
+android.server.BluetoothService
+android.speech.tts.ITts$Stub
+android.speech.tts.ITts$Stub$Proxy
+android.speech.tts.ITtsCallback$Stub
+android.speech.tts.TextToSpeech
 android.telephony.PhoneNumberUtils
-android.telephony.PhoneStateListener
 android.telephony.ServiceState
-android.telephony.TelephonyManager
-android.telephony.SmsManager
+android.telephony.SignalStrength
 android.telephony.SmsMessage
-android.text.AutoText
+android.telephony.SmsMessage$MessageClass
+android.telephony.TelephonyManager
+android.text.AndroidCharacter
 android.text.BoringLayout
-android.text.BoringLayout$Metrics
 android.text.DynamicLayout
-android.text.DynamicLayout$ChangeWatcher
-android.text.Editable
-android.text.Editable$Factory
-android.text.GetChars
-android.text.GraphicsOperations
 android.text.Html$HtmlParser
-android.text.InputFilter
+android.text.HtmlToSpannedConverter
 android.text.Layout
-android.text.Layout$Alignment
-android.text.Layout$Directions
-android.text.Layout$Ellipsizer
-android.text.NoCopySpan
-android.text.NoCopySpan$Concrete
-android.text.PackedIntVector
-android.text.PackedObjectVector
-android.text.ParcelableSpan
 android.text.Selection
-android.text.Selection$END
-android.text.Selection$START
-android.text.SpanWatcher
-android.text.Spannable
-android.text.Spannable$Factory
-android.text.SpannableString
 android.text.SpannableStringBuilder
-android.text.SpannableStringInternal
-android.text.Spanned
 android.text.SpannedString
-android.text.StaticLayout
-android.text.Styled
-android.text.TextPaint
 android.text.TextUtils
-android.text.TextUtils$1
-android.text.TextUtils$EllipsizeCallback
-android.text.TextUtils$SimpleStringSplitter
-android.text.TextUtils$TruncateAt
-android.text.TextWatcher
 android.text.format.DateUtils
+android.text.format.Formatter
 android.text.format.Time
 android.text.method.ArrowKeyMovementMethod
 android.text.method.BaseKeyListener
-android.text.method.KeyListener
+android.text.method.DigitsKeyListener
+android.text.method.LinkMovementMethod
 android.text.method.MetaKeyKeyListener
-android.text.method.MovementMethod
 android.text.method.QwertyKeyListener
-android.text.method.ReplacementTransformationMethod
 android.text.method.ReplacementTransformationMethod$SpannedReplacementCharSequence
 android.text.method.SingleLineTransformationMethod
 android.text.method.TextKeyListener
 android.text.method.TextKeyListener$Capitalize
-android.text.method.TextKeyListener$SettingsObserver
-android.text.method.TransformationMethod
-android.text.style.AlignmentSpan
-android.text.style.CharacterStyle
-android.text.style.ForegroundColorSpan
-android.text.style.LeadingMarginSpan
-android.text.style.LineBackgroundSpan
-android.text.style.LineHeightSpan
-android.text.style.MetricAffectingSpan
-android.text.style.ParagraphStyle
-android.text.style.ReplacementSpan
+android.text.style.ImageSpan
+android.text.style.RelativeSizeSpan
+android.text.style.ScaleXSpan
 android.text.style.StyleSpan
-android.text.style.URLSpan
-android.text.style.UpdateAppearance
-android.text.style.UpdateLayout
-android.text.style.WrapTogetherSpan
+android.text.style.TextAppearanceSpan
 android.text.util.Linkify
 android.util.AttributeSet
 android.util.DisplayMetrics
+android.util.EventLog
+android.util.EventLog$Event
 android.util.FloatMath
+android.util.Log
+android.util.LongSparseArray
+android.util.MonthDisplayHelper
+android.util.Patterns
 android.util.SparseArray
+android.util.StateSet
 android.util.TypedValue
-android.util.Xml$XmlSerializerFactory
+android.util.Xml
+android.util.Xml$Encoding
+android.util.base64.Base64$Encoder
 android.view.AbsSavedState
-android.view.ContextMenu
-android.view.ContextMenu$ContextMenuInfo
 android.view.ContextThemeWrapper
 android.view.Display
 android.view.FocusFinder
-android.view.FocusFinder$1
-android.view.GestureDetector$SimpleOnGestureListener
-android.view.Gravity
-android.view.IWindow
+android.view.GestureDetector
 android.view.IWindow$Stub
-android.view.IWindowManager
 android.view.IWindowManager$Stub
 android.view.IWindowManager$Stub$Proxy
-android.view.IWindowSession
 android.view.IWindowSession$Stub
-android.view.IWindowSession$Stub$Proxy
 android.view.KeyCharacterMap
+android.view.KeyCharacterMap$KeyData
 android.view.KeyEvent
-android.view.KeyEvent$1
-android.view.KeyEvent$Callback
-android.view.LayoutInflater
-android.view.LayoutInflater$Factory
-android.view.Menu
-android.view.MenuInflater
-android.view.MenuItem
 android.view.MotionEvent
-android.view.MotionEvent$1
+android.view.ScaleGestureDetector
 android.view.Surface
-android.view.SurfaceHolder
+android.view.Surface$1
+android.view.SurfaceSession
 android.view.SurfaceView
-android.view.TouchDelegate
+android.view.SurfaceView$MyWindow
 android.view.VelocityTracker
 android.view.View
-android.view.View$AttachInfo
 android.view.View$AttachInfo$Callbacks
+android.view.View$AttachInfo$InvalidateInfo
 android.view.View$BaseSavedState
-android.view.View$BaseSavedState$1
-android.view.View$MeasureSpec
-android.view.View$OnCreateContextMenuListener
-android.view.View$ScrollabilityCache
 android.view.ViewConfiguration
 android.view.ViewGroup
-android.view.ViewGroup$LayoutParams
-android.view.ViewGroup$MarginLayoutParams
-android.view.ViewManager
+android.view.ViewParent
 android.view.ViewRoot
-android.view.ViewRoot$1
-android.view.ViewRoot$InputMethodCallback
-android.view.ViewRoot$RunQueue
-android.view.ViewRoot$TrackballAxis
 android.view.ViewRoot$W
 android.view.ViewStub
-android.view.ViewTreeObserver
-android.view.ViewTreeObserver$InternalInsetsInfo
-android.view.ViewTreeObserver$OnPreDrawListener
 android.view.Window
-android.view.Window$Callback
-android.view.Window$LocalWindowManager
-android.view.WindowLeaked
-android.view.WindowManager
 android.view.WindowManager$LayoutParams
-android.view.WindowManager$LayoutParams$1
 android.view.WindowManagerImpl
-android.view.animation.AccelerateDecelerateInterpolator
-android.view.animation.AlphaAnimation
+android.view.accessibility.AccessibilityEvent
 android.view.animation.Animation
 android.view.animation.AnimationSet
-android.view.animation.LinearInterpolator
-android.view.animation.Transformation
 android.view.inputmethod.BaseInputConnection
 android.view.inputmethod.CompletionInfo
-android.view.inputmethod.CompletionInfo$1
-
 android.view.inputmethod.EditorInfo
-android.view.inputmethod.EditorInfo$1
-
 android.view.inputmethod.ExtractedText
-android.view.inputmethod.ExtractedText$1
-
-android.view.inputmethod.ExtractedTextRequest
-android.view.inputmethod.ExtractedTextRequest$1
-
-android.view.inputmethod.InputBinding
-android.view.inputmethod.InputBinding$1
-android.view.inputmethod.InputConnection
-android.view.inputmethod.InputMethod
-android.view.inputmethod.InputMethod$SessionCallback
-
-android.view.inputmethod.InputMethodInfo
-android.view.inputmethod.InputMethodInfo$1
 android.view.inputmethod.InputMethodManager
-android.view.inputmethod.InputMethodManager$1
-android.view.inputmethod.InputMethodManager$2
-android.view.inputmethod.InputMethodManager$ControlledInputConnectionWrapper
-android.view.inputmethod.InputMethodManager$H
-
-android.view.inputmethod.InputMethodSession
-android.view.inputmethod.InputMethodSession$EventCallback
 android.webkit.BrowserFrame
 android.webkit.CacheManager
 android.webkit.CallbackProxy
+android.webkit.ConsoleMessage$MessageLevel
 android.webkit.CookieManager
 android.webkit.CookieSyncManager
+android.webkit.DownloadListener
+android.webkit.FileLoader
+android.webkit.GeolocationPermissions
+android.webkit.GeolocationService
+android.webkit.HTML5VideoViewProxy
 android.webkit.JWebCoreJavaBridge
 android.webkit.LoadListener
-android.webkit.MimeTypeMap
+android.webkit.PluginManager
 android.webkit.URLUtil
-android.webkit.WebBackForwardList
-android.webkit.WebHistoryItem
-android.webkit.WebIconDatabase
-android.webkit.WebIconDatabase$EventHandler
-android.webkit.WebIconDatabase$EventHandler$1
 android.webkit.WebIconDatabase$EventHandler$IconResult
+android.webkit.WebIconDatabase$IconListener
 android.webkit.WebSettings
-android.webkit.WebSettings$EventHandler
-android.webkit.WebSettings$EventHandler$1
-android.webkit.WebSettings$LayoutAlgorithm
-android.webkit.WebSettings$RenderPriority
 android.webkit.WebSettings$TextSize
-android.webkit.WebSyncManager
-android.webkit.WebSyncManager$SyncHandler
+android.webkit.WebStorage
 android.webkit.WebTextView
 android.webkit.WebView
-android.webkit.WebView$ExtendedZoomControls
-android.webkit.WebView$PrivateHandler
+android.webkit.WebView$DragTrackerHandler
+android.webkit.WebView$ScaleDetectorListener
 android.webkit.WebViewCore
-android.webkit.WebViewCore$CursorData
-android.webkit.WebViewCore$EventHub
-android.webkit.WebViewCore$EventHub$1
-android.webkit.WebViewCore$WebCoreThread
-android.webkit.WebViewCore$WebCoreThread$1
+android.webkit.WebViewCore$4
+android.webkit.WebViewCore$TextSelectionData
+android.webkit.WebViewCore$TouchEventData
+android.webkit.WebViewCore$TouchUpData
 android.webkit.WebViewDatabase
 android.widget.AbsListView
-android.widget.AbsListView$CheckForLongPress
-android.widget.AbsListView$CheckForTap
-android.widget.AbsListView$LayoutParams
+android.widget.AbsListView$3
+android.widget.AbsListView$CheckForKeyLongPress
 android.widget.AbsListView$PerformClick
-android.widget.AbsListView$RecycleBin
 android.widget.AbsListView$SavedState
-android.widget.AbsListView$SavedState$1
 android.widget.AbsSeekBar
 android.widget.AbsSpinner
+android.widget.AbsSpinner$SavedState
 android.widget.AbsoluteLayout
-android.widget.AbsoluteLayout$LayoutParams
 android.widget.AdapterView
-android.widget.AdapterView$AdapterDataSetObserver
 android.widget.ArrayAdapter
 android.widget.AutoCompleteTextView
 android.widget.AutoCompleteTextView$DropDownItemClickListener
 android.widget.AutoCompleteTextView$DropDownListView
 android.widget.BaseAdapter
-android.widget.Button
+android.widget.BaseExpandableListAdapter
 android.widget.CheckBox
-android.widget.Checkable
-android.widget.CheckedTextView
 android.widget.CompoundButton
+android.widget.CompoundButton$SavedState
 android.widget.CursorAdapter
-android.widget.CursorAdapter$ChangeObserver
-android.widget.CursorAdapter$MyDataSetObserver
 android.widget.CursorTreeAdapter
+android.widget.DatePicker
 android.widget.EditText
+android.widget.ExpandableListConnector
 android.widget.ExpandableListView
 android.widget.FrameLayout
-android.widget.FrameLayout$LayoutParams
-android.widget.Gallery
+android.widget.GridView
 android.widget.HeaderViewListAdapter
 android.widget.ImageView
 android.widget.ImageView$ScaleType
 android.widget.LinearLayout
-android.widget.LinearLayout$LayoutParams
 android.widget.ListView
-android.widget.ListView$ArrowScrollFocusResult
 android.widget.ListView$SavedState
-android.widget.ListView$SavedState$1
+android.widget.MediaController
+android.widget.MediaController$4
+android.widget.MultiAutoCompleteTextView
+android.widget.NumberPicker
 android.widget.PopupWindow
+android.widget.PopupWindow$PopupViewContainer
 android.widget.ProgressBar
-android.widget.RadioGroup
+android.widget.ProgressBar$SavedState
+android.widget.QuickContactBadge
 android.widget.RatingBar
 android.widget.RelativeLayout
-android.widget.RelativeLayout$LayoutParams
+android.widget.RelativeLayout$DependencyGraph$Node
 android.widget.RemoteViews
+android.widget.ResourceCursorAdapter
 android.widget.ScrollBarDrawable
 android.widget.ScrollView
-android.widget.Scroller
 android.widget.SeekBar
 android.widget.SimpleCursorAdapter
 android.widget.SlidingDrawer
 android.widget.Spinner
-android.widget.Spinner$DropDownAdapter
 android.widget.TabHost
 android.widget.TabWidget
 android.widget.TableLayout
 android.widget.TableRow
 android.widget.TextView
-android.widget.TextView$1
-android.widget.TextView$Blink
-android.widget.TextView$BufferType
-android.widget.TextView$ChangeWatcher
-android.widget.TextView$CharWrapper
-android.widget.TextView$Drawables
-android.widget.TextView$InputContentType
-android.widget.TextView$InputMethodState
+android.widget.TextView$CommitSelectionReceiver
 android.widget.TextView$Marquee
-android.widget.TextView$MenuHandler
-android.widget.TextView$SavedState
-android.widget.TextView$SavedState$1
-android.widget.ToggleButton
+android.widget.TimePicker
 android.widget.TwoLineListItem
+android.widget.VideoView
 android.widget.ViewAnimator
 android.widget.ViewSwitcher
 android.widget.ZoomButton
+android.widget.ZoomButtonsController
 android.widget.ZoomControls
-com.android.common.ArrayListCursor
-com.android.common.FastXmlSerializer
-com.android.common.NetworkConnectivityListener
-com.android.common.NetworkConnectivityListener$State
-com.android.common.XmlUtils
-com.android.internal.database.SortCursor
+com.android.internal.R$styleable
+com.android.internal.app.AlertActivity
+com.android.internal.app.AlertController
+com.android.internal.app.AlertController$AlertParams
+com.android.internal.app.AlertController$RecycleListView
+com.android.internal.app.ChooserActivity
+com.android.internal.app.ResolverActivity
+com.android.internal.app.ResolverActivity$ResolveListAdapter
 com.android.internal.appwidget.IAppWidgetService$Stub
-com.android.internal.http.multipart.FilePart
-com.android.internal.http.multipart.MultipartEntity
-com.android.internal.http.multipart.Part
-com.android.internal.http.multipart.PartSource
-com.android.internal.http.multipart.StringPart
-com.android.internal.logging.AndroidConfig
+com.android.internal.content.SyncStateContentProviderHelper
+com.android.internal.graphics.NativeUtils
+com.android.internal.location.DummyLocationProvider
+com.android.internal.location.GpsLocationProvider
 com.android.internal.logging.AndroidHandler
 com.android.internal.os.AndroidPrintStream
+com.android.internal.os.BinderInternal
 com.android.internal.os.BinderInternal$GcWatcher
+com.android.internal.os.IResultReceiver$Stub
 com.android.internal.os.LoggingPrintStream
 com.android.internal.os.LoggingPrintStream$1
 com.android.internal.os.RuntimeInit
 com.android.internal.os.RuntimeInit$1
 com.android.internal.os.RuntimeInit$UncaughtHandler
-com.android.internal.os.ZygoteInit$MethodAndArgsCaller
-com.android.internal.policy.IPolicy
+com.android.internal.os.SamplingProfilerIntegration
+com.android.internal.os.ZygoteConnection
+com.android.internal.os.ZygoteConnection$Arguments
+com.android.internal.os.ZygoteInit
+com.android.internal.net.DomainNameValidator
 com.android.internal.policy.PolicyManager
 com.android.internal.policy.impl.PhoneLayoutInflater
 com.android.internal.policy.impl.PhoneWindow
-com.android.internal.policy.impl.PhoneWindow$1
-com.android.internal.policy.impl.PhoneWindow$ContextMenuCallback
 com.android.internal.policy.impl.PhoneWindow$DecorView
-com.android.internal.policy.impl.PhoneWindow$PanelFeatureState
 com.android.internal.policy.impl.PhoneWindow$PanelFeatureState$SavedState
-com.android.internal.policy.impl.PhoneWindow$PanelFeatureState$SavedState$1
+com.android.internal.policy.impl.PhoneWindowManager
 com.android.internal.policy.impl.Policy
-com.android.internal.telephony.Connection$DisconnectCause
-com.android.internal.telephony.Connection$PostDialState
-com.android.internal.telephony.IPhoneStateListener$Stub
-com.android.internal.telephony.ITelephony$Stub
-com.android.internal.telephony.Phone
-com.android.internal.telephony.Phone$DataActivityState
-com.android.internal.telephony.Phone$DataState
-com.android.internal.telephony.Phone$State
-com.android.internal.telephony.Phone$SuppService
-com.android.internal.telephony.PhoneBase
-com.android.internal.telephony.PhoneStateIntentReceiver
-com.android.internal.telephony.IccCard$State
-com.android.internal.telephony.BaseCommands
-com.android.internal.telephony.CallForwardInfo
-com.android.internal.telephony.CommandsInterface
-com.android.internal.telephony.DriverCall
-com.android.internal.telephony.DriverCall$State
-com.android.internal.telephony.gsm.GsmConnection
-com.android.internal.telephony.gsm.GSMPhone
 com.android.internal.telephony.GsmAlphabet
-com.android.internal.telephony.gsm.GsmMmiCode
-com.android.internal.telephony.gsm.SimCard
-com.android.internal.telephony.ISms$Stub
-com.android.internal.telephony.RIL
-com.android.internal.telephony.ServiceStateTracker
-
-com.android.internal.telephony.gsm.stk.ComprehensionTlvTag
-com.android.internal.telephony.gsm.stk.ResultCode
+com.android.internal.telephony.ITelephony$Stub
+com.android.internal.telephony.ITelephony$Stub$Proxy
+com.android.internal.telephony.ITelephonyRegistry$Stub
+com.android.internal.telephony.IccCard$State
+com.android.internal.telephony.Phone$State
+com.android.internal.telephony.SmsAddress
+com.android.internal.telephony.SmsMessageBase
+com.android.internal.telephony.gsm.GsmSmsAddress
+com.android.internal.telephony.gsm.SmsMessage
+com.android.internal.telephony.gsm.SmsMessage$PduParser
+com.android.internal.util.ArrayUtils
+com.android.internal.util.FastMath
+com.android.internal.util.FastXmlSerializer
+com.android.internal.util.HanziToPinyin
+com.android.internal.util.XmlUtils
 com.android.internal.view.IInputConnectionWrapper
-com.android.internal.view.IInputConnectionWrapper$MyHandler
-com.android.internal.view.IInputConnectionWrapper$SomeArgs
-
-com.android.internal.view.IInputContext
 com.android.internal.view.IInputContext$Stub
-com.android.internal.view.IInputContext$Stub$Proxy
-
-com.android.internal.view.IInputContextCallback
-com.android.internal.view.IInputContextCallback$Stub
-com.android.internal.view.IInputContextCallback$Stub$Proxy
-
-com.android.internal.view.IInputMethod
-com.android.internal.view.IInputMethod$Stub
-com.android.internal.view.IInputMethod$Stub$Proxy
-
-com.android.internal.view.IInputMethodCallback
-com.android.internal.view.IInputMethodCallback$Stub
-com.android.internal.view.IInputMethodCallback$Stub$Proxy
-
-com.android.internal.view.IInputMethodClient
-com.android.internal.view.IInputMethodClient$Stub
-com.android.internal.view.IInputMethodClient$Stub$Proxy
-
-com.android.internal.view.IInputMethodManager
 com.android.internal.view.IInputMethodManager$Stub
-com.android.internal.view.IInputMethodManager$Stub$Proxy
-
-com.android.internal.view.IInputMethodSession
-com.android.internal.view.IInputMethodSession$Stub
-com.android.internal.view.IInputMethodSession$Stub$Proxy
-
-com.android.internal.view.InputBindResult
-com.android.internal.view.InputBindResult$1
-
-com.android.internal.view.InputConnectionWrapper
-com.android.internal.view.InputConnectionWrapper$InputContextCallback
-com.android.internal.view.menu.ExpandedMenuView
+com.android.internal.view.menu.ContextMenuBuilder
 com.android.internal.view.menu.IconMenuItemView
 com.android.internal.view.menu.IconMenuView
+com.android.internal.view.menu.IconMenuView$SavedState
 com.android.internal.view.menu.ListMenuItemView
 com.android.internal.view.menu.MenuBuilder
-com.android.internal.view.menu.MenuBuilder$Callback
-com.android.internal.view.menu.MenuDialogHelper
 com.android.internal.view.menu.MenuItemImpl
 com.android.internal.view.menu.SubMenuBuilder
-com.android.internal.widget.RotarySelector
-com.android.internal.widget.Smileys
-com.google.android.gles_jni.EGLDisplayImpl
+com.android.internal.widget.ContactHeaderWidget
+com.android.internal.widget.DialogTitle
+com.android.internal.widget.EditableInputConnection
+com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
+com.android.internal.widget.LockPatternUtils
+com.android.internal.widget.LockPatternView
+com.android.internal.widget.LockPatternView$Cell
 com.google.android.gles_jni.EGLImpl
 com.google.android.gles_jni.GLImpl
 com.ibm.icu4jni.charset.CharsetDecoderICU
 com.ibm.icu4jni.charset.CharsetEncoderICU
 com.ibm.icu4jni.charset.CharsetICU
-com.ibm.icu4jni.text.CollationAttribute
+com.ibm.icu4jni.charset.CharsetProviderICU
+com.ibm.icu4jni.charset.NativeConverter
+com.ibm.icu4jni.common.ErrorCode
+com.ibm.icu4jni.lang.UCharacter
+com.ibm.icu4jni.regex.NativeRegEx
+com.ibm.icu4jni.text.Collator
+com.ibm.icu4jni.text.NativeBreakIterator
+com.ibm.icu4jni.text.NativeCollation
 com.ibm.icu4jni.text.NativeDecimalFormat
 com.ibm.icu4jni.text.RuleBasedCollator
+com.ibm.icu4jni.text.RuleBasedNumberFormat
+com.ibm.icu4jni.util.Resources
 com.ibm.icu4jni.util.Resources$DefaultTimeZones
-dalvik.system.DexFile
+dalvik.system.DalvikLogHandler
+dalvik.system.DalvikLogging
+dalvik.system.NativeStart
 dalvik.system.PathClassLoader
+dalvik.system.SamplingProfiler
+dalvik.system.TouchDex
+dalvik.system.VMDebug
+dalvik.system.VMRuntime
+dalvik.system.VMStack
+dalvik.system.Zygote
 java.beans.PropertyChangeEvent
 java.beans.PropertyChangeListener
 java.beans.PropertyChangeSupport
 java.io.BufferedInputStream
+java.io.BufferedReader
 java.io.ByteArrayInputStream
-java.io.ByteArrayOutputStream
+java.io.Closeable
+java.io.DataInput
+java.io.DataOutput
+java.io.DataOutputStream
 java.io.File
 java.io.FileDescriptor
 java.io.FileInputStream
 java.io.FileInputStream$RepositioningLock
 java.io.FileNotFoundException
+java.io.FileOutputStream
 java.io.FilterInputStream
+java.io.FilterOutputStream
+java.io.Flushable
 java.io.IOException
+java.io.InputStream
+java.io.InputStreamReader
+java.io.InterruptedIOException
+java.io.ObjectInput
+java.io.ObjectInputStream
+java.io.ObjectOutput
+java.io.ObjectOutputStream
 java.io.ObjectStreamClass
+java.io.ObjectStreamClass$OSCThreadLocalCache
+java.io.ObjectStreamConstants
+java.io.ObjectStreamException
+java.io.ObjectStreamField
+java.io.OutputStream
+java.io.OutputStreamWriter
+java.io.PrintStream
 java.io.PrintWriter
+java.io.PushbackReader
 java.io.RandomAccessFile
 java.io.RandomAccessFile$RepositionLock
-java.io.StringWriter
-java.io.Writer
+java.io.Reader
+java.io.Serializable
+java.io.StreamCorruptedException
+java.lang.AbstractStringBuilder
+java.lang.Appendable
+java.lang.ArrayIndexOutOfBoundsException
+java.lang.Boolean
+java.lang.BootClassLoader
+java.lang.Byte
+java.lang.CharSequence
+java.lang.Character
+java.lang.Character$UnicodeBlock
 java.lang.Class
 java.lang.ClassCache
-java.lang.ClassNotFoundException
+java.lang.ClassCache$EnumComparator
+java.lang.ClassLoader
+java.lang.ClassLoader$SystemClassLoader
+java.lang.Cloneable
+java.lang.Comparable
+java.lang.Double
+java.lang.Enum
+java.lang.Error
+java.lang.Exception
+java.lang.Float
 java.lang.IllegalArgumentException
-java.lang.IllegalStateException
+java.lang.IndexOutOfBoundsException
 java.lang.Integer
+java.lang.InternalError
+java.lang.InterruptedException
+java.lang.Iterable
+java.lang.LangAccessImpl
 java.lang.LinkageError
 java.lang.Long
+java.lang.Math
 java.lang.NoClassDefFoundError
+java.lang.NoSuchMethodError
+java.lang.Number
 java.lang.NumberFormatException
 java.lang.Object
+java.lang.OutOfMemoryError
+java.lang.Readable
+java.lang.Runnable
 java.lang.Runtime
 java.lang.RuntimeException
+java.lang.RuntimePermission
+java.lang.SecurityException
+java.lang.Short
+java.lang.StackOverflowError
+java.lang.StackTraceElement
+java.lang.StrictMath
 java.lang.String
+java.lang.String$CaseInsensitiveComparator
 java.lang.StringBuffer
 java.lang.StringBuilder
+java.lang.System
+java.lang.SystemProperties
 java.lang.Thread
+java.lang.Thread$State
+java.lang.Thread$UncaughtExceptionHandler
+java.lang.ThreadGroup
+java.lang.ThreadGroup$ChildrenGroupsLock
+java.lang.ThreadGroup$ChildrenThreadsLock
 java.lang.ThreadLocal
 java.lang.ThreadLocal$Values
 java.lang.Throwable
+java.lang.UnsatisfiedLinkError
+java.lang.UnsupportedOperationException
+java.lang.VMClassLoader
 java.lang.VMThread
+java.lang.VirtualMachineError
+java.lang.Void
+java.lang.annotation.Annotation
+java.lang.ref.PhantomReference
+java.lang.ref.Reference
 java.lang.ref.ReferenceQueue
 java.lang.ref.SoftReference
 java.lang.ref.WeakReference
+java.lang.reflect.AccessibleObject
+java.lang.reflect.AnnotatedElement
+java.lang.reflect.Array
 java.lang.reflect.Constructor
+java.lang.reflect.Field
+java.lang.reflect.GenericDeclaration
+java.lang.reflect.InvocationHandler
+java.lang.reflect.Member
 java.lang.reflect.Method
 java.lang.reflect.Modifier
+java.lang.reflect.Proxy
+java.lang.reflect.ReflectionAccessImpl
+java.lang.reflect.Type
 java.math.BigDecimal
 java.math.BigInt
 java.math.BigInteger
 java.math.Multiplication
+java.net.AddressCache
+java.net.AddressCache$1
+java.net.ConnectException
 java.net.ContentHandler
+java.net.DatagramPacket
+java.net.Inet4Address
 java.net.InetAddress
+java.net.InetAddress$1
+java.net.InetAddress$2
 java.net.InetAddress$WaitReachable
+java.net.InetSocketAddress
 java.net.JarURLConnection
 java.net.NetPermission
-java.net.ProxySelectorImpl
-java.net.Socket$ConnectLock
+java.net.NetworkInterface
+java.net.ServerSocket
+java.net.Socket
+java.net.SocketException
+java.net.SocketImpl
+java.net.SocketOptions
 java.net.URI
 java.net.URL
 java.net.URLConnection
 java.net.URLConnection$DefaultContentHandler
 java.net.URLStreamHandler
+java.nio.BaseByteBuffer
+java.nio.Buffer
+java.nio.BufferFactory
+java.nio.ByteBuffer
 java.nio.ByteOrder
+java.nio.CharArrayBuffer
+java.nio.CharBuffer
 java.nio.CharSequenceAdapter
+java.nio.CharToByteBufferAdapter
 java.nio.DirectByteBuffer
+java.nio.FloatToByteBufferAdapter
+java.nio.HeapByteBuffer
+java.nio.IntToByteBufferAdapter
+java.nio.LongBuffer
+java.nio.LongToByteBufferAdapter
+java.nio.NIOAccess
+java.nio.ReadWriteCharArrayBuffer
 java.nio.ReadWriteDirectByteBuffer
-java.nio.ReadWriteIntArrayBuffer
-java.nio.ReadWriteShortArrayBuffer
-java.nio.ShortBuffer
+java.nio.ReadWriteHeapByteBuffer
 java.nio.ShortToByteBufferAdapter
+java.nio.channels.ByteChannel
+java.nio.channels.Channel
+java.nio.channels.FileChannel
+java.nio.channels.GatheringByteChannel
+java.nio.channels.InterruptibleChannel
+java.nio.channels.ReadableByteChannel
+java.nio.channels.ScatteringByteChannel
+java.nio.channels.WritableByteChannel
+java.nio.channels.spi.AbstractInterruptibleChannel
+java.nio.channels.spi.AbstractInterruptibleChannel$1
+java.nio.channels.spi.AbstractInterruptibleChannel$2
+java.nio.charset.Charset
+java.nio.charset.Charset$1
+java.nio.charset.CharsetDecoder
 java.nio.charset.CharsetEncoder
+java.nio.charset.CoderResult
+java.nio.charset.CodingErrorAction
+java.nio.charset.spi.CharsetProvider
 java.security.AccessControlContext
-java.security.GeneralSecurityException
+java.security.AccessController
+java.security.BasicPermission
+java.security.Guard
 java.security.KeyStore
 java.security.MessageDigest
+java.security.Permission
+java.security.PrivilegedAction
+java.security.PrivilegedExceptionAction
 java.security.ProtectionDomain
 java.security.Provider
-java.security.SecureRandom
 java.security.Security
-java.security.cert.CertPathValidator
-java.security.cert.CertificateFactory
-java.security.cert.PKIXParameters
-java.security.cert.TrustAnchor
-java.security.cert.X509CertSelector
 java.security.cert.X509Certificate
+java.text.AttributedCharacterIterator$Attribute
 java.text.Collator
+java.text.Collator$1
 java.text.DateFormat
 java.text.DateFormat$Field
 java.text.DecimalFormat
 java.text.DecimalFormatSymbols
-java.text.MessageFormat
+java.text.Format
 java.text.NumberFormat
-java.text.RuleBasedCollator
 java.text.SimpleDateFormat
-java.util.AbstractList$FullListIterator
-java.util.AbstractList$SimpleListIterator
+java.util.AbstractCollection
+java.util.AbstractList
+java.util.AbstractMap
+java.util.AbstractSet
 java.util.ArrayList
+java.util.ArrayList$ArrayListIterator
 java.util.Arrays
 java.util.Arrays$ArrayList
+java.util.BitSet
 java.util.Calendar
-java.util.Collections$SynchronizedCollection
-java.util.Collections$UnmodifiableList
-java.util.Collections$UnmodifiableMap
-java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$1
+java.util.Collection
+java.util.Collections
+java.util.Collections$EmptyList
+java.util.Collections$EmptyMap
+java.util.Collections$EmptySet
+java.util.Collections$SingletonSet
+java.util.Collections$UnmodifiableCollection
+java.util.Collections$UnmodifiableCollection$1
+java.util.Collections$UnmodifiableRandomAccessList
+java.util.Collections$UnmodifiableSet
+java.util.Comparator
 java.util.Date
+java.util.Dictionary
 java.util.EnumMap
+java.util.EnumSet
+java.util.Enumeration
 java.util.EventListener
 java.util.EventObject
 java.util.Formatter
 java.util.GregorianCalendar
 java.util.HashMap
+java.util.HashMap$HashIterator
+java.util.HashMap$HashMapEntry
+java.util.HashMap$KeyIterator
+java.util.HashMap$KeySet
+java.util.HashMap$Values
 java.util.HashSet
 java.util.Hashtable
+java.util.Hashtable$HashIterator
+java.util.Hashtable$HashtableEntry
+java.util.Hashtable$KeyEnumeration
+java.util.Hashtable$ValueIterator
+java.util.Hashtable$Values
 java.util.IdentityHashMap
+java.util.Iterator
 java.util.LinkedHashMap
+java.util.LinkedHashMap$LinkedEntry
+java.util.LinkedHashMap$LinkedHashIterator
+java.util.LinkedHashMap$ValueIterator
 java.util.LinkedList
-java.util.LinkedList$Link
 java.util.List
+java.util.ListIterator
 java.util.Locale
+java.util.Map
+java.util.Map$Entry
+java.util.MiniEnumSet
 java.util.Properties
-java.util.Random
+java.util.PropertyPermission
+java.util.RandomAccess
 java.util.ResourceBundle
+java.util.Set
 java.util.SimpleTimeZone
+java.util.SortedMap
+java.util.SortedSet
+java.util.SpecialAccess
+java.util.Stack
+java.util.StringTokenizer
 java.util.TimeZone
 java.util.TreeMap
-java.util.TreeMap$MapEntry
 java.util.TreeSet
+java.util.UUID
 java.util.Vector
 java.util.WeakHashMap
 java.util.WeakHashMap$Entry
 java.util.concurrent.ConcurrentHashMap
 java.util.concurrent.ConcurrentLinkedQueue
-java.util.concurrent.DelayQueue
+java.util.concurrent.ConcurrentLinkedQueue$Node
+java.util.concurrent.CopyOnWriteArrayList
+java.util.concurrent.CopyOnWriteArrayList$COWIterator
+java.util.concurrent.Executors$DelegatedExecutorService
+java.util.concurrent.FutureTask
 java.util.concurrent.LinkedBlockingQueue
-java.util.concurrent.ScheduledThreadPoolExecutor
-java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue
+java.util.concurrent.Semaphore
+java.util.concurrent.ThreadPoolExecutor
 java.util.concurrent.TimeUnit
 java.util.concurrent.atomic.AtomicBoolean
 java.util.concurrent.atomic.AtomicInteger
+java.util.concurrent.atomic.AtomicLong
+java.util.concurrent.atomic.AtomicReference
 java.util.concurrent.atomic.UnsafeAccess
+java.util.concurrent.locks.AbstractOwnableSynchronizer
 java.util.concurrent.locks.AbstractQueuedSynchronizer
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node
 java.util.concurrent.locks.Lock
-java.util.concurrent.locks.LockSupport
 java.util.concurrent.locks.ReentrantLock
-java.util.concurrent.locks.ReentrantLock$FairSync
 java.util.concurrent.locks.ReentrantLock$NonfairSync
 java.util.concurrent.locks.ReentrantLock$Sync
-java.util.concurrent.locks.ReentrantReadWriteLock
-java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync
 java.util.concurrent.locks.UnsafeAccess
 java.util.jar.Attributes
 java.util.jar.Attributes$Name
@@ -852,25 +1041,25 @@
 java.util.jar.JarEntry
 java.util.jar.JarFile
 java.util.jar.JarFile$1JarFileEnumerator
-java.util.jar.JarFile$JarFileInputStream
 java.util.jar.JarVerifier
 java.util.jar.Manifest
-java.util.logging.ErrorManager
-java.util.logging.Formatter
 java.util.logging.Handler
 java.util.logging.Level
 java.util.logging.LogManager
 java.util.logging.LogManager$1
 java.util.logging.LogManager$2
 java.util.logging.LogManager$2$1
-java.util.logging.LogManager$3
-java.util.logging.LogRecord
+java.util.logging.LogManager$4
 java.util.logging.Logger
+java.util.logging.Logger$1
 java.util.logging.LoggingPermission
-java.util.logging.SimpleFormatter
+java.util.regex.MatchResult
 java.util.regex.Matcher
 java.util.regex.Pattern
-java.util.zip.DeflaterOutputStream
+java.util.zip.Adler32
+java.util.zip.CRC32
+java.util.zip.Checksum
+java.util.zip.Deflater
 java.util.zip.Inflater
 java.util.zip.InflaterInputStream
 java.util.zip.ZipConstants
@@ -879,63 +1068,90 @@
 java.util.zip.ZipFile
 java.util.zip.ZipFile$2
 java.util.zip.ZipFile$RAFStream
-javax.microedition.khronos.egl.EGLContext
+java.util.zip.ZipFile$ZipInflaterInputStream
+javax.crypto.Cipher
+javax.crypto.Mac
+javax.crypto.spec.IvParameterSpec
+javax.microedition.khronos.egl.EGL
+javax.microedition.khronos.egl.EGL10
+javax.microedition.khronos.opengles.GL
+javax.microedition.khronos.opengles.GL10
+javax.microedition.khronos.opengles.GL10Ext
+javax.microedition.khronos.opengles.GL11
+javax.microedition.khronos.opengles.GL11Ext
+javax.microedition.khronos.opengles.GL11ExtensionPack
+javax.net.ssl.DefaultHostnameVerifier
 javax.net.ssl.HttpsURLConnection
-javax.net.ssl.SSLHandshakeException
+javax.net.ssl.SSLServerSocket
+javax.net.ssl.SSLSession
+javax.net.ssl.SSLSocket
+javax.net.ssl.SSLSocketFactory
 javax.security.auth.x500.X500Principal
 javax.security.cert.X509Certificate
-javax.security.cert.X509Certificate$2
 junit.framework.Assert
-org.apache.commons.codec.binary.Base64
-org.apache.commons.codec.binary.Hex
 org.apache.commons.logging.LogFactory
-org.apache.commons.logging.impl.Jdk14Logger
 org.apache.harmony.archive.util.Util
-org.apache.harmony.dalvik.ddmc.Chunk
+org.apache.harmony.dalvik.NativeTestTarget
 org.apache.harmony.dalvik.ddmc.ChunkHandler
 org.apache.harmony.dalvik.ddmc.DdmServer
-org.apache.harmony.dalvik.ddmc.DdmVmInternal
+org.apache.harmony.kernel.vm.LangAccess
+org.apache.harmony.kernel.vm.ReflectionAccess
+org.apache.harmony.lang.annotation.AnnotationFactory
+org.apache.harmony.lang.annotation.AnnotationMember
 org.apache.harmony.luni.internal.net.www.protocol.file.FileURLConnection
 org.apache.harmony.luni.internal.net.www.protocol.file.Handler
 org.apache.harmony.luni.internal.net.www.protocol.http.Handler
-org.apache.harmony.luni.internal.net.www.protocol.https.Handler
 org.apache.harmony.luni.internal.net.www.protocol.jar.Handler
 org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnectionImpl
-org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnectionImpl$1
 org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnectionImpl$JarURLConnectionInputStream
 org.apache.harmony.luni.internal.util.TimezoneGetter
-org.apache.harmony.luni.internal.util.ZoneInfo
 org.apache.harmony.luni.internal.util.ZoneInfoDB
+org.apache.harmony.luni.net.GenericIPMreq
 org.apache.harmony.luni.net.PlainSocketImpl
+org.apache.harmony.luni.platform.Endianness
+org.apache.harmony.luni.platform.ICommonDataTypes
+org.apache.harmony.luni.platform.IFileSystem
+org.apache.harmony.luni.platform.IMemorySystem
+org.apache.harmony.luni.platform.INetworkSystem
+org.apache.harmony.luni.platform.OSFileSystem
+org.apache.harmony.luni.platform.OSMemory
+org.apache.harmony.luni.platform.OSNetworkSystem
+org.apache.harmony.luni.platform.Platform
 org.apache.harmony.luni.platform.PlatformAddress
-org.apache.harmony.luni.util.TwoKeyHashMap
+org.apache.harmony.luni.platform.PlatformAddressFactory
+org.apache.harmony.luni.util.FloatingPointParser
+org.apache.harmony.luni.util.InputStreamHelper
+org.apache.harmony.luni.util.InputStreamHelper$1
+org.apache.harmony.luni.util.InputStreamHelper$ExposedByteArrayInputStream
+org.apache.harmony.luni.util.LocaleCache
+org.apache.harmony.luni.util.Msg
+org.apache.harmony.luni.util.NumberConverter
+org.apache.harmony.luni.util.PriviAction
+org.apache.harmony.luni.util.ThreadLocalCache
+org.apache.harmony.luni.util.ThreadLocalCache$1
+org.apache.harmony.luni.util.ThreadLocalCache$2
+org.apache.harmony.luni.util.ThreadLocalCache$3
+org.apache.harmony.luni.util.ThreadLocalCache$4
+org.apache.harmony.luni.util.ThreadLocalCache$5
+org.apache.harmony.luni.util.Util
+org.apache.harmony.nio.FileChannelFactory
+org.apache.harmony.nio.internal.DirectBuffer
+org.apache.harmony.nio.internal.FileChannelImpl
 org.apache.harmony.nio.internal.FileChannelImpl$RepositioningLock
+org.apache.harmony.nio.internal.FileLockImpl
 org.apache.harmony.nio.internal.LockManager
 org.apache.harmony.nio.internal.LockManager$1
-org.apache.harmony.nio.internal.ReadOnlyFileChannel
-org.apache.harmony.security.asn1.ASN1BitString
-org.apache.harmony.security.asn1.ASN1BitString$ASN1NamedBitList
-org.apache.harmony.security.asn1.ASN1Boolean
-org.apache.harmony.security.asn1.ASN1Explicit
+org.apache.harmony.nio.internal.WriteOnlyFileChannel
 org.apache.harmony.security.asn1.ASN1GeneralizedTime
-org.apache.harmony.security.asn1.ASN1Implicit
-org.apache.harmony.security.asn1.ASN1Integer
-org.apache.harmony.security.asn1.ASN1OctetString
-org.apache.harmony.security.asn1.ASN1SetOf
+org.apache.harmony.security.asn1.ASN1Oid
 org.apache.harmony.security.asn1.ASN1StringType
-org.apache.harmony.security.asn1.ASN1StringType$1
-org.apache.harmony.security.asn1.ASN1StringType$2
-org.apache.harmony.security.asn1.ASN1StringType$3
-org.apache.harmony.security.asn1.ASN1StringType$4
-org.apache.harmony.security.asn1.ASN1StringType$5
-org.apache.harmony.security.asn1.ASN1StringType$6
-org.apache.harmony.security.asn1.ASN1StringType$7
-org.apache.harmony.security.asn1.ASN1UTCTime
-org.apache.harmony.security.asn1.BitString
+org.apache.harmony.security.asn1.DerInputStream
+org.apache.harmony.security.asn1.DerOutputStream
 org.apache.harmony.security.fortress.Engine
 org.apache.harmony.security.fortress.SecurityUtils
 org.apache.harmony.security.fortress.Services
 org.apache.harmony.security.pkcs7.ContentInfo
+org.apache.harmony.security.provider.cert.DRLCertFactory
 org.apache.harmony.security.provider.cert.X509CertFactoryImpl
 org.apache.harmony.security.provider.cert.X509CertImpl
 org.apache.harmony.security.provider.cert.X509CertPathImpl
@@ -943,183 +1159,111 @@
 org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl
 org.apache.harmony.security.utils.AlgNameMapper
 org.apache.harmony.security.x501.AttributeTypeAndValue
-org.apache.harmony.security.x501.AttributeValue
 org.apache.harmony.security.x501.DirectoryString
-org.apache.harmony.security.x501.DirectoryString$1
 org.apache.harmony.security.x501.Name
-org.apache.harmony.security.x501.Name$1
 org.apache.harmony.security.x509.AlgorithmIdentifier
-org.apache.harmony.security.x509.AlgorithmIdentifier$1
 org.apache.harmony.security.x509.BasicConstraints
-org.apache.harmony.security.x509.BasicConstraints$1
 org.apache.harmony.security.x509.Certificate
-org.apache.harmony.security.x509.Certificate$1
+org.apache.harmony.security.x509.EDIPartyName
 org.apache.harmony.security.x509.Extension
-org.apache.harmony.security.x509.Extension$1
-org.apache.harmony.security.x509.Extension$2
 org.apache.harmony.security.x509.Extensions
-org.apache.harmony.security.x509.Extensions$1
 org.apache.harmony.security.x509.GeneralName
 org.apache.harmony.security.x509.GeneralNames
 org.apache.harmony.security.x509.KeyUsage
 org.apache.harmony.security.x509.ORAddress
+org.apache.harmony.security.x509.OtherName
 org.apache.harmony.security.x509.SubjectPublicKeyInfo
-org.apache.harmony.security.x509.SubjectPublicKeyInfo$1
 org.apache.harmony.security.x509.TBSCertificate
-org.apache.harmony.security.x509.TBSCertificate$1
 org.apache.harmony.security.x509.Time
-org.apache.harmony.security.x509.Time$1
 org.apache.harmony.security.x509.Validity
-org.apache.harmony.security.x509.Validity$1
+org.apache.harmony.text.BidiWrapper
+org.apache.harmony.xml.ExpatAttributes
 org.apache.harmony.xml.ExpatParser
 org.apache.harmony.xml.ExpatPullParser
-org.apache.harmony.xml.ExpatReader
-org.apache.harmony.xnet.provider.jsse.ClientSessionContext
+org.apache.harmony.xml.parsers.SAXParserFactoryImpl
+org.apache.harmony.xnet.provider.jsse.FileClientSessionCache
+org.apache.harmony.xnet.provider.jsse.NativeCrypto
+org.apache.harmony.xnet.provider.jsse.OpenSSLServerSocketImpl
 org.apache.harmony.xnet.provider.jsse.OpenSSLSessionImpl
 org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl
 org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$Finalizer
-org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream
-org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLOutputStream
+org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$LoggerHolder
+org.apache.harmony.xnet.provider.jsse.ProtocolVersion
 org.apache.harmony.xnet.provider.jsse.SSLContextImpl
 org.apache.harmony.xnet.provider.jsse.SSLParameters
-org.apache.harmony.xnet.provider.jsse.TrustManagerFactoryImpl
-org.apache.harmony.xnet.provider.jsse.TrustManagerImpl
-org.apache.http.HttpHost
-org.apache.http.HttpRequestInterceptor
+org.apache.harmony.xnet.provider.jsse.ServerSessionContext
 org.apache.http.HttpVersion
-org.apache.http.auth.AuthSchemeRegistry
-org.apache.http.client.HttpClient
-org.apache.http.client.RequestDirector
+org.apache.http.client.methods.HttpEntityEnclosingRequestBase
+org.apache.http.client.methods.HttpGet
+org.apache.http.client.methods.HttpPost
 org.apache.http.client.methods.HttpRequestBase
-org.apache.http.client.protocol.RequestAddCookies
-org.apache.http.client.protocol.RequestDefaultHeaders
-org.apache.http.client.protocol.RequestProxyAuthentication
-org.apache.http.client.protocol.RequestTargetAuthentication
-org.apache.http.client.protocol.ResponseProcessCookies
-org.apache.http.conn.params.ConnManagerParams$1
+org.apache.http.conn.BasicManagedEntity
+org.apache.http.conn.params.ConnManagerParams
 org.apache.http.conn.params.ConnRouteParams
 org.apache.http.conn.routing.HttpRoute
-org.apache.http.conn.routing.RouteInfo$LayerType
-org.apache.http.conn.routing.RouteInfo$TunnelType
-org.apache.http.conn.routing.RouteTracker
-org.apache.http.conn.scheme.PlainSocketFactory
-org.apache.http.conn.scheme.Scheme
-org.apache.http.conn.scheme.SchemeRegistry
-org.apache.http.conn.ssl.AllowAllHostnameVerifier
-org.apache.http.conn.ssl.BrowserCompatHostnameVerifier
+org.apache.http.conn.ssl.AbstractVerifier
 org.apache.http.conn.ssl.SSLSocketFactory
-org.apache.http.conn.ssl.StrictHostnameVerifier
 org.apache.http.conn.util.InetAddressUtils
-org.apache.http.cookie.CookieSpecRegistry
-org.apache.http.impl.DefaultConnectionReuseStrategy
-org.apache.http.impl.DefaultHttpResponseFactory
+org.apache.http.impl.AbstractHttpClientConnection
 org.apache.http.impl.EnglishReasonPhraseCatalog
-org.apache.http.impl.HttpConnectionMetricsImpl
 org.apache.http.impl.SocketHttpClientConnection
-org.apache.http.impl.auth.BasicSchemeFactory
-org.apache.http.impl.auth.DigestSchemeFactory
 org.apache.http.impl.client.AbstractAuthenticationHandler
 org.apache.http.impl.client.AbstractHttpClient
-org.apache.http.impl.client.BasicCredentialsProvider
+org.apache.http.impl.client.BasicCookieStore
 org.apache.http.impl.client.DefaultHttpClient
-org.apache.http.impl.client.DefaultHttpRequestRetryHandler
-org.apache.http.impl.client.DefaultProxyAuthenticationHandler
-org.apache.http.impl.client.DefaultRedirectHandler
-org.apache.http.impl.client.DefaultTargetAuthenticationHandler
-org.apache.http.impl.client.DefaultUserTokenHandler
 org.apache.http.impl.client.EntityEnclosingRequestWrapper
 org.apache.http.impl.conn.AbstractClientConnAdapter
+org.apache.http.impl.conn.AbstractPooledConnAdapter
 org.apache.http.impl.conn.DefaultClientConnection
-org.apache.http.impl.conn.DefaultClientConnectionOperator
-org.apache.http.impl.conn.DefaultHttpRoutePlanner
-org.apache.http.impl.conn.DefaultResponseParser
-org.apache.http.impl.conn.IdleConnectionHandler
-org.apache.http.impl.conn.tsccm.BasicPoolEntry
-org.apache.http.impl.conn.tsccm.BasicPoolEntryRef
+org.apache.http.impl.conn.SingleClientConnManager
 org.apache.http.impl.conn.tsccm.ConnPoolByRoute
-org.apache.http.impl.conn.tsccm.RefQueueWorker
-org.apache.http.impl.conn.tsccm.RouteSpecificPool
 org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager
 org.apache.http.impl.cookie.BasicClientCookie
-org.apache.http.impl.cookie.BestMatchSpecFactory
-org.apache.http.impl.cookie.BrowserCompatSpecFactory
+org.apache.http.impl.cookie.BrowserCompatSpec
 org.apache.http.impl.cookie.DateUtils
-org.apache.http.impl.cookie.NetscapeDraftSpecFactory
-org.apache.http.impl.cookie.RFC2109SpecFactory
-org.apache.http.impl.cookie.RFC2965SpecFactory
-org.apache.http.impl.entity.EntityDeserializer
-org.apache.http.impl.entity.EntitySerializer
-org.apache.http.impl.entity.LaxContentLengthStrategy
-org.apache.http.impl.entity.StrictContentLengthStrategy
-org.apache.http.impl.io.HttpRequestWriter
-org.apache.http.impl.io.HttpTransportMetricsImpl
+org.apache.http.impl.cookie.DateUtils$DateFormatHolder
+org.apache.http.impl.cookie.RFC2109Spec
 org.apache.http.impl.io.SocketInputBuffer
-org.apache.http.impl.io.SocketOutputBuffer
-org.apache.http.message.BasicHeaderValueParser
 org.apache.http.message.BasicHttpEntityEnclosingRequest
+org.apache.http.message.BasicHttpRequest
 org.apache.http.message.BasicHttpResponse
-org.apache.http.message.BasicLineFormatter
 org.apache.http.message.BasicLineParser
+org.apache.http.message.BasicNameValuePair
+org.apache.http.message.BasicTokenIterator
 org.apache.http.params.BasicHttpParams
 org.apache.http.protocol.BasicHttpProcessor
 org.apache.http.protocol.HTTP
-org.apache.http.protocol.HttpRequestExecutor
-org.apache.http.protocol.HttpRequestInterceptorList
-org.apache.http.protocol.HttpResponseInterceptorList
-org.apache.http.protocol.RequestConnControl
-org.apache.http.protocol.RequestContent
-org.apache.http.protocol.RequestExpectContinue
-org.apache.http.protocol.RequestTargetHost
-org.apache.http.protocol.RequestUserAgent
-org.apache.http.util.ByteArrayBuffer
-org.apache.http.util.CharArrayBuffer
-org.apache.http.util.EntityUtils
-org.apache.http.util.VersionInfo
-org.bouncycastle.asn1.DERBitString
-org.bouncycastle.asn1.DERIA5String
-org.bouncycastle.asn1.DERInteger
+org.bouncycastle.asn1.DERNull
 org.bouncycastle.asn1.DERObject
 org.bouncycastle.asn1.DERObjectIdentifier
-org.bouncycastle.asn1.DEROctetString
-org.bouncycastle.asn1.DERPrintableString
-org.bouncycastle.asn1.DERSequence
-org.bouncycastle.asn1.DERSet
-org.bouncycastle.asn1.DERTaggedObject
-org.bouncycastle.asn1.DERUTCTime
-org.bouncycastle.asn1.DERUTF8String
-org.bouncycastle.asn1.OrderedTable
+org.bouncycastle.asn1.iana.IANAObjectIdentifiers
 org.bouncycastle.asn1.nist.NISTObjectIdentifiers
+org.bouncycastle.asn1.oiw.OIWObjectIdentifiers
 org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers
-org.bouncycastle.asn1.x509.AlgorithmIdentifier
-org.bouncycastle.asn1.x509.RSAPublicKeyStructure
-org.bouncycastle.asn1.x509.SubjectPublicKeyInfo
-org.bouncycastle.asn1.x509.TBSCertificateStructure
-org.bouncycastle.asn1.x509.Time
-org.bouncycastle.asn1.x509.X509CertificateStructure
-org.bouncycastle.asn1.x509.X509Extension
 org.bouncycastle.asn1.x509.X509Extensions
 org.bouncycastle.asn1.x509.X509Name
-org.bouncycastle.asn1.x509.X509NameElementList
-org.bouncycastle.asn1.x9.X9ObjectIdentifiers
+org.bouncycastle.crypto.digests.SHA1Digest
 org.bouncycastle.crypto.engines.AESFastEngine
+org.bouncycastle.crypto.macs.HMac
+org.bouncycastle.jce.provider.BouncyCastleProvider
 org.bouncycastle.jce.provider.CertPathValidatorUtilities
-org.bouncycastle.jce.provider.JCEBlockCipher$AES
-org.bouncycastle.jce.provider.JCERSAPublicKey
-org.bouncycastle.jce.provider.JDKKeyFactory$RSA
+org.bouncycastle.jce.provider.JCEBlockCipher
 org.bouncycastle.jce.provider.JDKKeyStore
-org.bouncycastle.jce.provider.JDKKeyStore$StoreEntry
+org.bouncycastle.jce.provider.JDKX509CertificateFactory
 org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi
-org.bouncycastle.jce.provider.RSAUtil
+org.bouncycastle.jce.provider.WrapCipherSpi
 org.bouncycastle.jce.provider.X509CertificateObject
 org.ccil.cowan.tagsoup.HTMLScanner
+org.ccil.cowan.tagsoup.HTMLSchema
 org.ccil.cowan.tagsoup.Parser
-org.json.JSONArray
 org.json.JSONObject
-org.json.JSONStringer
 org.kxml2.io.KXmlParser
 org.kxml2.io.KXmlSerializer
+org.openssl.NativeBN
+org.xml.sax.Attributes
+org.xml.sax.InputSource
+org.xml.sax.helpers.AttributesImpl
 org.xml.sax.helpers.DefaultHandler
-org.xml.sax.helpers.NewInstance
+org.xmlpull.v1.XmlPullParser
 org.xmlpull.v1.XmlPullParserFactory
-org.xmlpull.v1.sax2.Driver
 sun.misc.Unsafe
diff --git a/sax/tests/saxtests/src/android/sax/SafeSaxTest.java b/sax/tests/saxtests/src/android/sax/SafeSaxTest.java
index bee3938..e8cf2f7 100644
--- a/sax/tests/saxtests/src/android/sax/SafeSaxTest.java
+++ b/sax/tests/saxtests/src/android/sax/SafeSaxTest.java
@@ -29,7 +29,7 @@
 import android.text.format.Time;
 import android.util.Log;
 import android.util.Xml;
-import com.android.common.XmlUtils;
+import com.android.internal.util.XmlUtils;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
diff --git a/services/java/com/android/server/AppWidgetService.java b/services/java/com/android/server/AppWidgetService.java
index 0b466f1..a5b0db9 100644
--- a/services/java/com/android/server/AppWidgetService.java
+++ b/services/java/com/android/server/AppWidgetService.java
@@ -57,7 +57,7 @@
 
 import com.android.internal.appwidget.IAppWidgetService;
 import com.android.internal.appwidget.IAppWidgetHost;
-import com.android.common.FastXmlSerializer;
+import com.android.internal.util.FastXmlSerializer;
 
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java
index f79a02a..d4b28e2 100644
--- a/services/java/com/android/server/BackupManagerService.java
+++ b/services/java/com/android/server/BackupManagerService.java
@@ -1647,11 +1647,22 @@
                     }
 
                     if (metaInfo.versionCode > packageInfo.versionCode) {
-                        String message = "Version " + metaInfo.versionCode
-                                + " > installed version " + packageInfo.versionCode;
-                        Log.w(TAG, "Package " + packageName + ": " + message);
-                        EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE, packageName, message);
-                        continue;
+                        // Data is from a "newer" version of the app than we have currently
+                        // installed.  If the app has not declared that it is prepared to
+                        // handle this case, we do not attempt the restore.
+                        if ((packageInfo.applicationInfo.flags
+                                & ApplicationInfo.FLAG_RESTORE_ANY_VERSION) == 0) {
+                            String message = "Version " + metaInfo.versionCode
+                                    + " > installed version " + packageInfo.versionCode;
+                            Log.w(TAG, "Package " + packageName + ": " + message);
+                            EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE,
+                                    packageName, message);
+                            continue;
+                        } else {
+                            if (DEBUG) Log.v(TAG, "Version " + metaInfo.versionCode
+                                    + " > installed " + packageInfo.versionCode
+                                    + " but restoreAnyVersion");
+                        }
                     }
 
                     if (!signaturesMatch(metaInfo.signatures, packageInfo)) {
@@ -1695,8 +1706,10 @@
                         // The agent was probably running with a stub Application object,
                         // which isn't a valid run mode for the main app logic.  Shut
                         // down the app so that next time it's launched, it gets the
-                        // usual full initialization.
-                        if ((packageInfo.applicationInfo.flags
+                        // usual full initialization.  Note that this is only done for
+                        // full-system restores: when a single app has requested a restore,
+                        // it is explicitly not killed following that operation.
+                        if (mTargetPackage == null && (packageInfo.applicationInfo.flags
                                 & ApplicationInfo.FLAG_KILL_AFTER_RESTORE) != 0) {
                             if (DEBUG) Log.d(TAG, "Restore complete, killing host process of "
                                     + packageInfo.applicationInfo.processName);
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 108246d..19f4b8a 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -289,6 +289,7 @@
          * the number of different network types is not going
          * to change very often.
          */
+        boolean noMobileData = !getMobileDataEnabled();
         for (int netType : mPriorityList) {
             switch (mNetAttributes[netType].mRadio) {
             case ConnectivityManager.TYPE_WIFI:
@@ -306,6 +307,10 @@
                 mNetTrackers[netType] = new MobileDataStateTracker(context, mHandler,
                     netType, mNetAttributes[netType].mName);
                 mNetTrackers[netType].startMonitoring();
+                if (noMobileData) {
+                    if (DBG) Log.d(TAG, "tearing down Mobile networks due to setting");
+                    mNetTrackers[netType].teardown();
+                }
                 break;
             default:
                 Log.e(TAG, "Trying to create a DataStateTracker for an unknown radio type " +
@@ -530,6 +535,10 @@
         // TODO - move this into the MobileDataStateTracker
         int usedNetworkType = networkType;
         if(networkType == ConnectivityManager.TYPE_MOBILE) {
+            if (!getMobileDataEnabled()) {
+                if (DBG) Log.d(TAG, "requested special network with data disabled - rejected");
+                return Phone.APN_TYPE_NOT_AVAILABLE;
+            }
             if (TextUtils.equals(feature, Phone.FEATURE_ENABLE_MMS)) {
                 usedNetworkType = ConnectivityManager.TYPE_MOBILE_MMS;
             } else if (TextUtils.equals(feature, Phone.FEATURE_ENABLE_SUPL)) {
@@ -767,6 +776,46 @@
         mContext.sendBroadcast(broadcast);
     }
 
+    /**
+     * @see ConnectivityManager#getMobileDataEnabled()
+     */
+    public boolean getMobileDataEnabled() {
+        enforceAccessPermission();
+        boolean retVal = Settings.Secure.getInt(mContext.getContentResolver(),
+                Settings.Secure.MOBILE_DATA, 1) == 1;
+        if (DBG) Log.d(TAG, "getMobileDataEnabled returning " + retVal);
+        return retVal;
+    }
+
+    /**
+     * @see ConnectivityManager#setMobileDataEnabled(boolean)
+     */
+    public synchronized void setMobileDataEnabled(boolean enabled) {
+        enforceChangePermission();
+        if (DBG) Log.d(TAG, "setMobileDataEnabled(" + enabled + ")");
+
+        if (getMobileDataEnabled() == enabled) return;
+
+        Settings.Secure.putInt(mContext.getContentResolver(),
+                Settings.Secure.MOBILE_DATA, enabled ? 1 : 0);
+
+        if (enabled) {
+            if (mNetTrackers[ConnectivityManager.TYPE_MOBILE] != null) {
+                if (DBG) Log.d(TAG, "starting up " + mNetTrackers[ConnectivityManager.TYPE_MOBILE]);
+                mNetTrackers[ConnectivityManager.TYPE_MOBILE].reconnect();
+            }
+        } else {
+            for (NetworkStateTracker nt : mNetTrackers) {
+                if (nt == null) continue;
+                int netType = nt.getNetworkInfo().getType();
+                if (mNetAttributes[netType].mRadio == ConnectivityManager.TYPE_MOBILE) {
+                    if (DBG) Log.d(TAG, "tearing down " + nt);
+                    nt.teardown();
+                }
+            }
+        }
+    }
+
     private int getNumConnectedNetworks() {
         int numConnectedNets = 0;
 
@@ -885,9 +934,18 @@
 
             int newType = -1;
             int newPriority = -1;
+            boolean noMobileData = !getMobileDataEnabled();
             for (int checkType=0; checkType <= ConnectivityManager.MAX_NETWORK_TYPE; checkType++) {
                 if (checkType == prevNetType) continue;
                 if (mNetAttributes[checkType] == null) continue;
+                if (mNetAttributes[checkType].mRadio == ConnectivityManager.TYPE_MOBILE &&
+                        noMobileData) {
+                    if (DBG) {
+                        Log.d(TAG, "not failing over to mobile type " + checkType +
+                                " because Mobile Data Disabled");
+                    }
+                    continue;
+                }
                 if (mNetAttributes[checkType].isDefault()) {
                     /* TODO - if we have multiple nets we could use
                      * we may want to put more thought into which we choose
diff --git a/services/java/com/android/server/DevicePolicyManagerService.java b/services/java/com/android/server/DevicePolicyManagerService.java
index ac65aa9..9899e99 100644
--- a/services/java/com/android/server/DevicePolicyManagerService.java
+++ b/services/java/com/android/server/DevicePolicyManagerService.java
@@ -16,9 +16,9 @@
 
 package com.android.server;
 
-import com.android.common.FastXmlSerializer;
-import com.android.common.XmlUtils;
 import com.android.internal.content.PackageMonitor;
+import com.android.internal.util.FastXmlSerializer;
+import com.android.internal.util.XmlUtils;
 import com.android.internal.widget.LockPatternUtils;
 
 import org.xmlpull.v1.XmlPullParser;
diff --git a/services/java/com/android/server/DockObserver.java b/services/java/com/android/server/DockObserver.java
index 027f35c..a0c850f 100644
--- a/services/java/com/android/server/DockObserver.java
+++ b/services/java/com/android/server/DockObserver.java
@@ -305,6 +305,14 @@
                     (KeyguardManager)mContext.getSystemService(Context.KEYGUARD_SERVICE);
             mKeyguardLock = keyguardManager.newKeyguardLock(TAG);
 
+            final boolean enableCarMode = mDockState == Intent.EXTRA_DOCK_STATE_CAR;
+            if (enableCarMode) {
+                try {
+                    setCarMode(enableCarMode);
+                } catch (RemoteException e) {
+                    Log.w(TAG, "Unable to change car mode.", e);
+                }
+            }
             // don't bother broadcasting undocked here
             if (mDockState != Intent.EXTRA_DOCK_STATE_UNDOCKED) {
                 update();
diff --git a/services/java/com/android/server/KeyInputQueue.java b/services/java/com/android/server/KeyInputQueue.java
index 2640cfb..1bb897b 100644
--- a/services/java/com/android/server/KeyInputQueue.java
+++ b/services/java/com/android/server/KeyInputQueue.java
@@ -32,7 +32,7 @@
 import android.view.Surface;
 import android.view.WindowManagerPolicy;
 
-import com.android.common.XmlUtils;
+import com.android.internal.util.XmlUtils;
 
 import org.xmlpull.v1.XmlPullParser;
 
diff --git a/services/java/com/android/server/MountService.java b/services/java/com/android/server/MountService.java
index 2dc12f6..4485c79 100644
--- a/services/java/com/android/server/MountService.java
+++ b/services/java/com/android/server/MountService.java
@@ -16,32 +16,29 @@
 
 package com.android.server;
 
+import com.android.server.am.ActivityManagerService;
+
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.pm.PackageManager;
-import android.content.res.Resources;
 import android.net.Uri;
 import android.os.storage.IMountService;
 import android.os.storage.IMountServiceListener;
 import android.os.storage.StorageResultCode;
+import android.os.Handler;
+import android.os.Message;
 import android.os.RemoteException;
 import android.os.IBinder;
 import android.os.Environment;
 import android.os.ServiceManager;
 import android.os.SystemClock;
 import android.os.SystemProperties;
-import android.os.UEventObserver;
-import android.os.Handler;
-import android.text.TextUtils;
 import android.util.Log;
 import java.util.ArrayList;
 import java.util.HashSet;
 
-import java.io.File;
-import java.io.FileReader;
-
 /**
  * MountService implements back-end services for platform storage
  * management.
@@ -115,14 +112,119 @@
     private PackageManagerService                 mPms;
     private boolean                               mUmsEnabling;
     private ArrayList<MountServiceBinderListener> mListeners;
-    private boolean                               mBooted;
-    private boolean                               mReady;
+    private boolean                               mBooted = false;
+    private boolean                               mReady = false;
+    private boolean                               mSendUmsConnectedOnBoot = false;
 
     /**
      * Private hash of currently mounted secure containers.
      */
     private HashSet<String> mAsecMountSet = new HashSet<String>();
 
+    private static final int H_UNMOUNT_PM_UPDATE = 1;
+    private static final int H_UNMOUNT_PM_DONE = 2;
+    private static final int H_UNMOUNT_MS = 3;
+    private static final int RETRY_UNMOUNT_DELAY = 30; // in ms
+    private static final int MAX_UNMOUNT_RETRIES = 4;
+
+    private IntentFilter mPmFilter = new IntentFilter(
+            Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE);
+    private BroadcastReceiver mPmReceiver = new BroadcastReceiver() {
+        public void onReceive(Context context, Intent intent) {
+            String action = intent.getAction();
+            if (Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE.equals(action)) {
+                mHandler.sendEmptyMessage(H_UNMOUNT_PM_DONE);
+            }
+        }
+    };
+
+    class UnmountCallBack {
+        String path;
+        int retries;
+        boolean force;
+
+        UnmountCallBack(String path, boolean force) {
+            retries = 0;
+            this.path = path;
+            this.force = force;
+        }
+    }
+
+    final private Handler mHandler = new Handler() {
+        ArrayList<UnmountCallBack> mForceUnmounts = new ArrayList<UnmountCallBack>();
+
+        public void handleMessage(Message msg) {
+            switch (msg.what) {
+                case H_UNMOUNT_PM_UPDATE: {
+                    UnmountCallBack ucb = (UnmountCallBack) msg.obj;
+                    mForceUnmounts.add(ucb);
+                    mContext.registerReceiver(mPmReceiver, mPmFilter);
+                    boolean hasExtPkgs = mPms.updateExternalMediaStatus(false);
+                    if (!hasExtPkgs) {
+                        // Unregister right away
+                        mHandler.sendEmptyMessage(H_UNMOUNT_PM_DONE);
+                    }
+                    break;
+                }
+                case H_UNMOUNT_PM_DONE: {
+                    // Unregister receiver
+                    mContext.unregisterReceiver(mPmReceiver);
+                    UnmountCallBack ucb = mForceUnmounts.get(0);
+                    if (ucb == null || ucb.path == null) {
+                        // Just ignore
+                        return;
+                    }
+                    String path = ucb.path;
+                    boolean done = false;
+                    if (!ucb.force) {
+                        done = true;
+                    } else {
+                        int pids[] = getStorageUsers(path);
+                        if (pids == null || pids.length == 0) {
+                            done = true;
+                        } else {
+                            // Kill processes holding references first
+                            ActivityManagerService ams = (ActivityManagerService)
+                            ServiceManager.getService("activity");
+                            // Eliminate system process here?
+                            boolean ret = ams.killPidsForMemory(pids);
+                            if (ret) {
+                                // Confirm if file references have been freed.
+                                pids = getStorageUsers(path);
+                                if (pids == null || pids.length == 0) {
+                                    done = true;
+                                }
+                            }
+                        }
+                    }
+                    if (done) {
+                        mForceUnmounts.remove(0);
+                        mHandler.sendMessage(mHandler.obtainMessage(H_UNMOUNT_MS,
+                                ucb));
+                    } else {
+                        if (ucb.retries >= MAX_UNMOUNT_RETRIES) {
+                            Log.i(TAG, "Cannot unmount inspite of " +
+                                    MAX_UNMOUNT_RETRIES + " to unmount media");
+                            // Send final broadcast indicating failure to unmount.                      
+                        } else {
+                            mHandler.sendMessageDelayed(
+                                    mHandler.obtainMessage(H_UNMOUNT_PM_DONE,
+                                            ucb.retries++),
+                                    RETRY_UNMOUNT_DELAY);
+                        }
+                    }
+                    break;
+                }
+                case H_UNMOUNT_MS : {
+                    UnmountCallBack ucb = (UnmountCallBack) msg.obj;
+                    String path = ucb.path;
+                    doUnmountVolume(path, true);
+                    break;
+                }
+            }
+        }
+    };
+
     private void waitForReady() {
         while (mReady == false) {
             for (int retries = 5; retries > 0; retries--) {
@@ -162,6 +264,14 @@
                                     Log.e(TAG, String.format("Boot-time mount failed (%d)", rc));
                                 }
                             }
+                            /*
+                             * If UMS is connected in boot, send the connected event
+                             * now that we're up.
+                             */
+                            if (mSendUmsConnectedOnBoot) {
+                                sendUmsIntent(true);
+                                mSendUmsConnectedOnBoot = false;
+                            }
                         } catch (Exception ex) {
                             Log.e(TAG, "Boot-time mount exception", ex);
                         }
@@ -545,14 +655,28 @@
         return rc;
     }
 
+    /*
+     * If force is not set, we do not unmount if there are
+     * processes holding references to the volume about to be unmounted.
+     * If force is set, all the processes holding references need to be
+     * killed via the ActivityManager before actually unmounting the volume.
+     * This might even take a while and might be retried after timed delays
+     * to make sure we dont end up in an instable state and kill some core
+     * processes.
+     */
     private int doUnmountVolume(String path, boolean force) {
         if (!getVolumeState(path).equals(Environment.MEDIA_MOUNTED)) {
             return VoldResponseCode.OpFailedVolNotMounted;
         }
 
+        // We unmounted the volume. No of the asec containers are available now.
+        synchronized (mAsecMountSet) {
+            mAsecMountSet.clear();
+        }
         // Notify PackageManager of potential media removal and deal with
         // return code later on. The caller of this api should be aware or have been
         // notified that the applications installed on the media will be killed.
+        // Redundant probably. But no harm in updating state again.
         mPms.updateExternalMediaStatus(false);
         try {
             mConnector.doCommand(String.format(
@@ -636,16 +760,17 @@
         }
 
         if (mBooted == true) {
-            Intent intent;
-            if (avail) {
-                intent = new Intent(Intent.ACTION_UMS_CONNECTED);
-            } else {
-                intent = new Intent(Intent.ACTION_UMS_DISCONNECTED);
-            }
-            mContext.sendBroadcast(intent);
+            sendUmsIntent(avail);
+        } else {
+            mSendUmsConnectedOnBoot = avail;
         }
     }
 
+    private void sendUmsIntent(boolean c) {
+        mContext.sendBroadcast(
+                new Intent((c ? Intent.ACTION_UMS_CONNECTED : Intent.ACTION_UMS_DISCONNECTED)));
+    }
+
     private void validatePermission(String perm) {
         if (mContext.checkCallingOrSelfPermission(perm) != PackageManager.PERMISSION_GRANTED) {
             throw new SecurityException(String.format("Requires %s permission", perm));
@@ -804,11 +929,12 @@
         return doMountVolume(path);
     }
 
-    public int unmountVolume(String path, boolean force) {
+    public void unmountVolume(String path, boolean force) {
         validatePermission(android.Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS);
         waitForReady();
 
-        return doUnmountVolume(path, force);
+        UnmountCallBack ucb = new UnmountCallBack(path, force);
+        mHandler.sendMessage(mHandler.obtainMessage(H_UNMOUNT_PM_UPDATE, ucb));
     }
 
     public int formatVolume(String path) {
@@ -1019,6 +1145,13 @@
         } catch (NativeDaemonConnectorException e) {
             rc = StorageResultCode.OperationFailedInternalError;
         }
+        if (rc == StorageResultCode.OperationSucceeded) {
+            synchronized (mAsecMountSet) {
+                if (!mAsecMountSet.contains(newId)) {
+                    mAsecMountSet.add(newId);
+                }
+            }
+        }
 
         return rc;
     }
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index 9e0d623..63fdaef 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -18,9 +18,9 @@
 
 import com.android.internal.app.IMediaContainerService;
 import com.android.internal.app.ResolverActivity;
-import com.android.common.FastXmlSerializer;
-import com.android.common.XmlUtils;
 import com.android.internal.content.PackageHelper;
+import com.android.internal.util.FastXmlSerializer;
+import com.android.internal.util.XmlUtils;
 import com.android.server.JournaledFile;
 
 import org.xmlpull.v1.XmlPullParser;
@@ -8877,6 +8877,9 @@
        return prefix + tmpIdx;
    }
 
+   /*
+    * Return true if PackageManager does have packages to be updated.
+    */
    public boolean updateExternalMediaStatus(final boolean mediaStatus) {
        synchronized (mPackages) {
            if (DEBUG_SD_INSTALL) Log.i(TAG, "updateExternalMediaStatus:: mediaStatus=" +
@@ -8885,16 +8888,24 @@
                return false;
            }
            mMediaMounted = mediaStatus;
-           final HashMap<SdInstallArgs, String> processCids =
-                   new HashMap<SdInstallArgs, String>();
-           final int[] uidArr = getExternalMediaPackages(mediaStatus, processCids);
-           if (processCids.size() == 0) {
+           boolean ret = false;
+           synchronized (mPackages) {
+               Set<String> appList = mSettings.findPackagesWithFlag(ApplicationInfo.FLAG_ON_SDCARD);
+               ret = appList != null && appList.size() > 0;
+           }
+           if (!ret) {
+               // No packages will be effected by the sdcard update. Just return.
                return false;
            }
             // Queue up an async operation since the package installation may take a little while.
            mHandler.post(new Runnable() {
                public void run() {
                    mHandler.removeCallbacks(this);
+                   // If we are up here that means there are packages to be
+                   // enabled or disabled.
+                   final HashMap<SdInstallArgs, String> processCids =
+                       new HashMap<SdInstallArgs, String>();
+                   final int[] uidArr = getExternalMediaPackages(mediaStatus, processCids);
                    if (mediaStatus) {
                        if (DEBUG_SD_INSTALL) Log.i(TAG, "Loading packages");
                        loadMediaPackages(processCids, uidArr);
@@ -9019,9 +9030,9 @@
            }
            args.doPostInstall(retCode);
        }
-       // Send broadcasts first
+       // Send a broadcast to let everyone know we are done processing
+       sendResourcesChangedBroadcast(true, pkgList, uidArr);
        if (pkgList.size() > 0) {
-           sendResourcesChangedBroadcast(true, pkgList, uidArr);
            Runtime.getRuntime().gc();
            // If something failed do we clean up here or next install?
        }
@@ -9049,9 +9060,9 @@
                }
            }
        }
+       sendResourcesChangedBroadcast(false, pkgList, uidArr);
        // Send broadcasts
        if (pkgList.size() > 0) {
-           sendResourcesChangedBroadcast(false, pkgList, uidArr);
            Runtime.getRuntime().gc();
        }
        // Do clean up. Just unmount
diff --git a/services/java/com/android/server/WallpaperManagerService.java b/services/java/com/android/server/WallpaperManagerService.java
index 481e6a4..aebb0ff 100644
--- a/services/java/com/android/server/WallpaperManagerService.java
+++ b/services/java/com/android/server/WallpaperManagerService.java
@@ -67,9 +67,9 @@
 
 import com.android.internal.content.PackageMonitor;
 import com.android.internal.service.wallpaper.ImageWallpaper;
+import com.android.internal.util.FastXmlSerializer;
 import com.android.server.DevicePolicyManagerService.ActiveAdmin;
 import com.android.server.DevicePolicyManagerService.MyPackageMonitor;
-import com.android.common.FastXmlSerializer;
 
 class WallpaperManagerService extends IWallpaperManager.Stub {
     static final String TAG = "WallpaperService";
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java
index 10d6e3a..16638bc 100644
--- a/services/java/com/android/server/connectivity/Tethering.java
+++ b/services/java/com/android/server/connectivity/Tethering.java
@@ -76,14 +76,21 @@
 
     private BroadcastReceiver mStateReceiver;
 
+    private static final String USB_NEAR_IFACE_ADDR      = "169.254.2.1";
+
     private String[] mDhcpRange;
+    private static final String DHCP_DEFAULT_RANGE_START = "169.254.2.10";
+    private static final String DHCP_DEFAULT_RANGE_STOP  = "169.254.2.64";
 
     private String[] mDnsServers;
+    private static final String DNS_DEFAULT_SERVER1 = "8.8.8.8";
+    private static final String DNS_DEFAULT_SERVER2 = "4.2.2.2";
 
     private String mUpstreamIfaceName;
 
     // turning on/off RNDIS resets the interface generating and extra discon/conn cycle
     // count how many to ignore..  Self correcting if you plug/unplug a bunch of times.
+    // TODO - brittle - maybe don't need?
     private int mUsbResetExpected = 0;
 
     HierarchicalStateMachine mTetherMasterSM;
@@ -119,8 +126,8 @@
                 com.android.internal.R.array.config_tether_dhcp_range);
         if (mDhcpRange.length == 0) {
             mDhcpRange = new String[2];
-            mDhcpRange[0] = new String("169.254.2.2");
-            mDhcpRange[1] = new String("169.254.2.64");
+            mDhcpRange[0] = DHCP_DEFAULT_RANGE_START;
+            mDhcpRange[1] = DHCP_DEFAULT_RANGE_STOP;
         } else if(mDhcpRange.length == 1) {
             String[] tmp = new String[2];
             tmp[0] = mDhcpRange[0];
@@ -135,8 +142,8 @@
 
         // TODO - remove and rely on real notifications of the current iface
         mDnsServers = new String[2];
-        mDnsServers[0] = "8.8.8.8";
-        mDnsServers[1] = "4.2.2.2";
+        mDnsServers[0] = DNS_DEFAULT_SERVER1;
+        mDnsServers[1] = DNS_DEFAULT_SERVER2;
         mUpstreamIfaceName = "rmnet0";
     }
 
@@ -300,7 +307,8 @@
         broadcast.putStringArrayListExtra(ConnectivityManager.EXTRA_ERRORED_TETHER,
                 erroredList);
         mContext.sendStickyBroadcast(broadcast);
-
+        Log.d(TAG, "sendTetherStateChangedBroadcast " + availableList.size() + ", " +
+                activeList.size() + ", " + erroredList.size());
         // check if we need to send a USB notification
         // Check if the user wants to be bothered
         boolean tellUser = (Settings.Secure.getInt(mContext.getContentResolver(),
@@ -429,7 +437,7 @@
                         return;
                     }
                 }
-                Tethering.this.toggleUsbIfaces(true); // add them
+                Tethering.this.enableUsbIfaces(true); // add them
             } else if (action.equals(Intent.ACTION_UMS_DISCONNECTED)) {
                 Log.w(TAG, "got UMS disconneded broadcast");
                 synchronized (Tethering.this) {
@@ -439,7 +447,7 @@
                         return;
                     }
                 }
-                Tethering.this.toggleUsbIfaces(false); // remove them
+                Tethering.this.enableUsbIfaces(false); // remove them
             } else if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
                 IBinder b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE);
                 IConnectivityManager service = IConnectivityManager.Stub.asInterface(b);
@@ -458,7 +466,7 @@
     }
 
     // used on cable insert/remove
-    private void toggleUsbIfaces(boolean add) {
+    private void enableUsbIfaces(boolean enable) {
         IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
         INetworkManagementService service = INetworkManagementService.Stub.asInterface(b);
         String[] ifaces = new String[0];
@@ -471,7 +479,7 @@
         for (String iface : ifaces) {
             for (String regex : mTetherableUsbRegexs) {
                 if (iface.matches(regex)) {
-                    if (add) {
+                    if (enable) {
                         interfaceAdded(iface);
                     } else {
                         interfaceRemoved(iface);
@@ -482,8 +490,8 @@
     }
 
     // toggled when we enter/leave the fully teathered state
-    private boolean enableRndisUsb(boolean enabled) {
-        Log.d(TAG, "enableRndisUsb(" + enabled + ")");
+    private boolean enableUsbRndis(boolean enabled) {
+        Log.d(TAG, "enableUsbRndis(" + enabled + ")");
         IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
                 INetworkManagementService service = INetworkManagementService.Stub.asInterface(b);
 
@@ -509,8 +517,8 @@
     }
 
     // configured when we start tethering and unconfig'd on error or conclusion
-    private boolean configureUsb(boolean enabled) {
-        Log.d(TAG, "configureUsb(" + enabled + ")");
+    private boolean configureUsbIface(boolean enabled) {
+        Log.d(TAG, "configureUsbIface(" + enabled + ")");
 
         IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
         INetworkManagementService service = INetworkManagementService.Stub.asInterface(b);
@@ -536,6 +544,10 @@
                                 ifcg.interfaceFlags = ifcg.interfaceFlags.replace("down", "up");
                             } else {
                                 ifcg.interfaceFlags = ifcg.interfaceFlags.replace("up", "down");
+                                // TODO - clean this up - maybe a better regex?
+                                ifcg.interfaceFlags = ifcg.interfaceFlags.replace(" running", "");
+                                ifcg.interfaceFlags = ifcg.interfaceFlags.replace("running ","");
+                                ifcg.interfaceFlags = ifcg.interfaceFlags.replace("running","");
                             }
                             service.setInterfaceConfig(iface, ifcg);
                         }
@@ -547,21 +559,6 @@
             }
         }
 
-        if (!enabled) {
-            // turn off ndis
-            try {
-                synchronized (this) {
-                    if (service.isUsbRNDISStarted()) {
-                        mUsbResetExpected += 2;
-                        service.stopUsbRNDIS();
-                    }
-                }
-            } catch (Exception e) {
-                Log.e(TAG, "Error stopping usb RNDIS :" + e);
-                return false;
-            }
-        }
-
         return true;
     }
 
@@ -822,7 +819,7 @@
             if (errored && mUsb) {
                 // note everything's been unwound by this point so nothing to do on
                 // further error..
-                Tethering.this.configureUsb(false);
+                Tethering.this.configureUsbIface(false);
             }
         }
 
@@ -863,7 +860,7 @@
             public void enter() {
                 setAvailable(false);
                 if (mUsb) {
-                    if (!Tethering.this.configureUsb(true)) {
+                    if (!Tethering.this.configureUsbIface(true)) {
                         Message m = mTetherMasterSM.obtainMessage(
                                 TetherMasterSM.CMD_TETHER_MODE_UNREQUESTED);
                         m.obj = TetherInterfaceSM.this;
@@ -889,7 +886,7 @@
                         m.obj = TetherInterfaceSM.this;
                         mTetherMasterSM.sendMessage(m);
                         if (mUsb) {
-                            if (!Tethering.this.configureUsb(false)) {
+                            if (!Tethering.this.configureUsbIface(false)) {
                                 transitionTo(mUsbConfigurationErrorState);
                                 break;
                             }
@@ -947,7 +944,7 @@
                     sendMessageAtFrontOfQueue(m);
                     return;
                 }
-                if (mUsb) Tethering.this.enableRndisUsb(true);
+                if (mUsb) Tethering.this.enableUsbRndis(true);
                 Log.d(TAG, "Tethered " + mIfaceName);
                 setAvailable(false);
                 setTethered(true);
@@ -955,7 +952,7 @@
             }
             @Override
             public void exit() {
-                if(mUsb) Tethering.this.enableRndisUsb(false);
+                if (mUsb) Tethering.this.enableUsbRndis(false);
             }
             @Override
             public boolean processMessage(Message message) {
@@ -986,7 +983,7 @@
                         mTetherMasterSM.sendMessage(m);
                         if (message.what == CMD_TETHER_UNREQUESTED) {
                             if (mUsb) {
-                                if (!Tethering.this.configureUsb(false)) {
+                                if (!Tethering.this.configureUsbIface(false)) {
                                     transitionTo(mUsbConfigurationErrorState);
                                 } else {
                                     transitionTo(mInitialState);
@@ -998,7 +995,6 @@
                             transitionTo(mUnavailableState);
                         }
                         Log.d(TAG, "Untethered " + mIfaceName);
-                        sendTetherStateChangedBroadcast();
                         break;
                     case CMD_CELL_DUN_ERROR:
                     case CMD_IP_FORWARDING_ENABLE_ERROR:
@@ -1030,7 +1026,7 @@
                         Log.d(TAG, "Tether lost upstream connection " + mIfaceName);
                         sendTetherStateChangedBroadcast();
                         if (mUsb) {
-                            if (!Tethering.this.configureUsb(false)) {
+                            if (!Tethering.this.configureUsbIface(false)) {
                                 transitionTo(mUsbConfigurationErrorState);
                                 break;
                             }
@@ -1187,7 +1183,6 @@
         private HierarchicalState mCellDunRequestedState;
         private HierarchicalState mCellDunAliveState;
         private HierarchicalState mTetherModeAliveState;
-        private HierarchicalState mCellDunUnRequestedState;
 
         private HierarchicalState mCellDunErrorState;
         private HierarchicalState mSetIpForwardingEnabledErrorState;
@@ -1215,8 +1210,6 @@
             addState(mCellDunAliveState);
             mTetherModeAliveState = new TetherModeAliveState();
             addState(mTetherModeAliveState);
-            mCellDunUnRequestedState = new CellDunUnRequestedState();
-            addState(mCellDunUnRequestedState);
 
             mCellDunErrorState = new CellDunErrorState();
             addState(mCellDunErrorState);
@@ -1236,8 +1229,81 @@
             setInitialState(mInitialState);
         }
 
+        class TetherMasterUtilState extends HierarchicalState {
+            @Override
+            public boolean processMessage(Message m) {
+                return false;
+            }
+            public int turnOnMobileDun() {
+                IBinder b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE);
+                IConnectivityManager service = IConnectivityManager.Stub.asInterface(b);
+                int retValue = Phone.APN_REQUEST_FAILED;
+                try {
+                    retValue = service.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
+                            Phone.FEATURE_ENABLE_DUN, new Binder());
+                } catch (Exception e) {
+                }
+                return retValue;
+            }
+            public boolean turnOffMobileDun() {
+                IBinder b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE);
+                IConnectivityManager service =
+                        IConnectivityManager.Stub.asInterface(b);
+                try {
+                    service.stopUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
+                            Phone.FEATURE_ENABLE_DUN);
+                } catch (Exception e) {
+                    return false;
+                }
+                return true;
+            }
+            public boolean turnOnMasterTetherSettings() {
+                IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
+                INetworkManagementService service =
+                        INetworkManagementService.Stub.asInterface(b);
+                try {
+                    service.setIpForwardingEnabled(true);
+                } catch (Exception e) {
+                    transitionTo(mSetIpForwardingEnabledErrorState);
+                    return false;
+                }
+                try {
+                    service.startTethering(mDhcpRange[0], mDhcpRange[1]);
+                } catch (Exception e) {
+                    transitionTo(mStartTetheringErrorState);
+                    return false;
+                }
+                try {
+                    service.setDnsForwarders(mDnsServers);
+                } catch (Exception e) {
+                    transitionTo(mSetDnsForwardersErrorState);
+                    return false;
+                }
+                transitionTo(mTetherModeAliveState);
+                return true;
+            }
+            public boolean turnOffMasterTetherSettings() {
+                IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
+                INetworkManagementService service =
+                        INetworkManagementService.Stub.asInterface(b);
+                try {
+                    service.stopTethering();
+                } catch (Exception e) {
+                    transitionTo(mStopTetheringErrorState);
+                    return false;
+                }
+                try {
+                    service.setIpForwardingEnabled(false);
+                } catch (Exception e) {
+                    transitionTo(mSetIpForwardingDisabledErrorState);
+                    return false;
+                }
+                transitionTo(mInitialState);
+                return true;
+            }
+        }
 
-        class InitialState extends HierarchicalState {
+        class InitialState extends TetherMasterUtilState {
             @Override
             public boolean processMessage(Message message) {
                 Log.d(TAG, "MasterInitialState.processMessage what=" + message.what);
@@ -1267,20 +1333,11 @@
                 return retValue;
             }
         }
-        class CellDunRequestedState extends HierarchicalState {
+        class CellDunRequestedState extends TetherMasterUtilState {
             @Override
             public void enter() {
                 ++mSequenceNumber;
-                IBinder b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE);
-                IConnectivityManager service =
-                        IConnectivityManager.Stub.asInterface(b);
-                int result;
-                try {
-                    result = service.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
-                            Phone.FEATURE_ENABLE_DUN, new Binder());
-                } catch (Exception e) {
-                    result = Phone.APN_REQUEST_FAILED;
-                }
+                int result = turnOnMobileDun();
                 switch (result) {
                     case Phone.APN_ALREADY_ACTIVE:
                         Log.d(TAG, "Dun already active");
@@ -1319,34 +1376,13 @@
                         if (index != -1) {
                             mNotifyList.remove(index);
                             if (mNotifyList.isEmpty()) {
-                                transitionTo(mCellDunUnRequestedState);
+                                turnOffMobileDun();
+                                transitionTo(mInitialState);
                             }
                         }
                         break;
                     case CMD_CELL_DUN_ENABLED:
-                        IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
-                        INetworkManagementService service =
-                                INetworkManagementService.Stub.asInterface(b);
-
-                        try {
-                            service.setIpForwardingEnabled(true);
-                        } catch (Exception e) {
-                            transitionTo(mSetIpForwardingEnabledErrorState);
-                            break;
-                        }
-                        try {
-                            service.startTethering(mDhcpRange[0], mDhcpRange[1]);
-                        } catch (Exception e) {
-                            transitionTo(mStartTetheringErrorState);
-                            break;
-                        }
-                        try {
-                            service.setDnsForwarders(mDnsServers);
-                        } catch (Exception e) {
-                            transitionTo(mSetDnsForwardersErrorState);
-                            break;
-                        }
-                        transitionTo(mTetherModeAliveState);
+                        turnOnMasterTetherSettings();
                         break;
                     case CMD_CELL_DUN_DISABLED:
                         break;
@@ -1363,7 +1399,7 @@
             }
         }
 
-        class CellDunAliveState extends HierarchicalState {
+        class CellDunAliveState extends TetherMasterUtilState {
             @Override
             public void enter() {
                 Log.d(TAG, "renewing Dun in " + CELL_DUN_RENEW_MS + "ms");
@@ -1378,29 +1414,7 @@
                     case CMD_TETHER_MODE_REQUESTED:
                         TetherInterfaceSM who = (TetherInterfaceSM)message.obj;
                         mNotifyList.add(who);
-                        IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
-                        INetworkManagementService service =
-                                INetworkManagementService.Stub.asInterface(b);
-
-                        try {
-                            service.setIpForwardingEnabled(true);
-                        } catch (Exception e) {
-                            transitionTo(mSetIpForwardingEnabledErrorState);
-                            break;
-                        }
-                        try {
-                            service.startTethering(mDhcpRange[0], mDhcpRange[1]);
-                        } catch (Exception e) {
-                            transitionTo(mStartTetheringErrorState);
-                            break;
-                        }
-                        try {
-                            service.setDnsForwarders(mDnsServers);
-                        } catch (Exception e) {
-                            transitionTo(mSetDnsForwardersErrorState);
-                            break;
-                        }
-                        transitionTo(mTetherModeAliveState);
+                        turnOnMasterTetherSettings();
                         break;
                     case CMD_TETHER_MODE_UNREQUESTED:
                         who = (TetherInterfaceSM)message.obj;
@@ -1408,7 +1422,8 @@
                         if (index != -1) {
                             mNotifyList.remove(index);
                             if (mNotifyList.isEmpty()) {
-                                transitionTo(mCellDunUnRequestedState);
+                                turnOffMobileDun();
+                                transitionTo(mInitialState);
                             }
                         }
                         break;
@@ -1418,13 +1433,7 @@
                     case CMD_CELL_DUN_RENEW:
                         Log.d(TAG, "renewing dun connection - requeuing for another " +
                                 CELL_DUN_RENEW_MS + "ms");
-                        b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE);
-                        IConnectivityManager cservice = IConnectivityManager.Stub.asInterface(b);
-                        try {
-                            cservice.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
-                                    Phone.FEATURE_ENABLE_DUN, new Binder());
-                        } catch (Exception e) {
-                        }
+                        turnOnMobileDun();
                         sendMessageDelayed(obtainMessage(CMD_CELL_DUN_RENEW), CELL_DUN_RENEW_MS);
                         break;
                     default:
@@ -1435,7 +1444,7 @@
             }
         }
 
-        class TetherModeAliveState extends HierarchicalState {
+        class TetherModeAliveState extends TetherMasterUtilState {
             @Override
             public void enter() {
                 Log.d(TAG, "renewing Dun in " + CELL_DUN_RENEW_MS + "ms");
@@ -1461,7 +1470,8 @@
                         if (index != -1) {
                             mNotifyList.remove(index);
                             if (mNotifyList.isEmpty()) {
-                                transitionTo(mCellDunUnRequestedState);
+                                turnOffMobileDun();
+                                turnOffMasterTetherSettings(); // transitions appropriately
                             }
                         }
                         break;
@@ -1473,33 +1483,12 @@
                             sm.sendMessage(sm.obtainMessage(
                                     TetherInterfaceSM.CMD_TETHER_MODE_DEAD));
                         }
-                        IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
-                        INetworkManagementService service =
-                                INetworkManagementService.Stub.asInterface(b);
-                        try {
-                            service.stopTethering();
-                        } catch (Exception e) {
-                            transitionTo(mStopTetheringErrorState);
-                            break;
-                        }
-                        try {
-                            service.setIpForwardingEnabled(false);
-                        } catch (Exception e) {
-                            transitionTo(mSetIpForwardingDisabledErrorState);
-                            break;
-                        }
-                        transitionTo(mInitialState);
+                        turnOffMasterTetherSettings(); // transitions appropriately
                         break;
                     case CMD_CELL_DUN_RENEW:
                         Log.d(TAG, "renewing dun connection - requeuing for another " +
                                 CELL_DUN_RENEW_MS + "ms");
-                        b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE);
-                        IConnectivityManager cservice = IConnectivityManager.Stub.asInterface(b);
-                        try {
-                            cservice.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
-                                    Phone.FEATURE_ENABLE_DUN, new Binder());
-                        } catch (Exception e) {
-                        }
+                        turnOnMobileDun();
                         sendMessageDelayed(obtainMessage(CMD_CELL_DUN_RENEW), CELL_DUN_RENEW_MS);
                         break;
                     default:
@@ -1510,58 +1499,6 @@
             }
         }
 
-        class CellDunUnRequestedState extends HierarchicalState {
-            @Override
-            public void enter() {
-                IBinder b = ServiceManager.getService(Context.CONNECTIVITY_SERVICE);
-                IConnectivityManager service =
-                        IConnectivityManager.Stub.asInterface(b);
-                NetworkInfo dunInfo = null;
-                try {
-                    dunInfo = service.getNetworkInfo(ConnectivityManager.TYPE_MOBILE_DUN);
-                } catch (Exception e) {}
-                if (dunInfo != null && !dunInfo.isConnectedOrConnecting()) {
-                    sendMessage(obtainMessage(CMD_CELL_DUN_DISABLED));
-                    return;
-                }
-                try {
-                    service.stopUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
-                            Phone.FEATURE_ENABLE_DUN);
-                } catch (Exception e) {}
-                Message m =  obtainMessage(CMD_CELL_DUN_TIMEOUT);
-                m.arg1 = ++mSequenceNumber;
-                // use a short timeout - this will often be a no-op and
-                // we just want this request to get into the queue before we
-                // try again.
-                sendMessageDelayed(m, CELL_DISABLE_DUN_TIMEOUT_MS);
-            }
-            @Override
-            public boolean processMessage(Message message) {
-                Log.d(TAG, "CellDunUnRequestedState.processMessage what=" + message.what);
-                boolean retValue = true;
-                switch (message.what) {
-                    case CMD_TETHER_MODE_REQUESTED:
-                    case CMD_TETHER_MODE_UNREQUESTED:
-                        deferMessage(message);
-                        break;
-                    case CMD_CELL_DUN_DISABLED:
-                        transitionTo(mInitialState);
-                        break;
-                    case CMD_CELL_DUN_TIMEOUT:
-                        // if we aren't using a sep apn, we won't get a disconnect broadcast..
-                        // just go back to initial after our short pause
-                        if (message.arg1 == mSequenceNumber) {
-                            transitionTo(mInitialState);
-                        }
-                        break;
-                    default:
-                        retValue = false;
-                        break;
-                }
-                return retValue;
-            }
-        }
-
         class ErrorState extends HierarchicalState {
             int mErrorNotification;
             @Override
diff --git a/telephony/java/com/android/internal/telephony/IccProvider.java b/telephony/java/com/android/internal/telephony/IccProvider.java
index 4232887..fa91457 100644
--- a/telephony/java/com/android/internal/telephony/IccProvider.java
+++ b/telephony/java/com/android/internal/telephony/IccProvider.java
@@ -19,8 +19,9 @@
 import android.content.ContentProvider;
 import android.content.UriMatcher;
 import android.content.ContentValues;
-import com.android.common.ArrayListCursor;
+import android.database.AbstractCursor;
 import android.database.Cursor;
+import android.database.CursorWindow;
 import android.net.Uri;
 import android.os.SystemProperties;
 import android.os.RemoteException;
@@ -35,6 +36,149 @@
 import com.android.internal.telephony.AdnRecord;
 import com.android.internal.telephony.IIccPhoneBook;
 
+/**
+ * XXX old code -- should be replaced with MatrixCursor.
+ * @deprecated This is has been replaced by MatrixCursor.
+*/
+class ArrayListCursor extends AbstractCursor {
+    private String[] mColumnNames;
+    private ArrayList<Object>[] mRows;
+
+    @SuppressWarnings({"unchecked"})
+    public ArrayListCursor(String[] columnNames, ArrayList<ArrayList> rows) {
+        int colCount = columnNames.length;
+        boolean foundID = false;
+        // Add an _id column if not in columnNames
+        for (int i = 0; i < colCount; ++i) {
+            if (columnNames[i].compareToIgnoreCase("_id") == 0) {
+                mColumnNames = columnNames;
+                foundID = true;
+                break;
+            }
+        }
+
+        if (!foundID) {
+            mColumnNames = new String[colCount + 1];
+            System.arraycopy(columnNames, 0, mColumnNames, 0, columnNames.length);
+            mColumnNames[colCount] = "_id";
+        }
+
+        int rowCount = rows.size();
+        mRows = new ArrayList[rowCount];
+
+        for (int i = 0; i < rowCount; ++i) {
+            mRows[i] = rows.get(i);
+            if (!foundID) {
+                mRows[i].add(i);
+            }
+        }
+    }
+
+    @Override
+    public void fillWindow(int position, CursorWindow window) {
+        if (position < 0 || position > getCount()) {
+            return;
+        }
+
+        window.acquireReference();
+        try {
+            int oldpos = mPos;
+            mPos = position - 1;
+            window.clear();
+            window.setStartPosition(position);
+            int columnNum = getColumnCount();
+            window.setNumColumns(columnNum);
+            while (moveToNext() && window.allocRow()) {
+                for (int i = 0; i < columnNum; i++) {
+                    final Object data = mRows[mPos].get(i);
+                    if (data != null) {
+                        if (data instanceof byte[]) {
+                            byte[] field = (byte[]) data;
+                            if (!window.putBlob(field, mPos, i)) {
+                                window.freeLastRow();
+                                break;
+                            }
+                        } else {
+                            String field = data.toString();
+                            if (!window.putString(field, mPos, i)) {
+                                window.freeLastRow();
+                                break;
+                            }
+                        }
+                    } else {
+                        if (!window.putNull(mPos, i)) {
+                            window.freeLastRow();
+                            break;
+                        }
+                    }
+                }
+            }
+
+            mPos = oldpos;
+        } catch (IllegalStateException e){
+            // simply ignore it
+        } finally {
+            window.releaseReference();
+        }
+    }
+
+    @Override
+    public int getCount() {
+        return mRows.length;
+    }
+
+    @Override
+    public String[] getColumnNames() {
+        return mColumnNames;
+    }
+
+    @Override
+    public byte[] getBlob(int columnIndex) {
+        return (byte[]) mRows[mPos].get(columnIndex);
+    }
+
+    @Override
+    public String getString(int columnIndex) {
+        Object cell = mRows[mPos].get(columnIndex);
+        return (cell == null) ? null : cell.toString();
+    }
+
+    @Override
+    public short getShort(int columnIndex) {
+        Number num = (Number) mRows[mPos].get(columnIndex);
+        return num.shortValue();
+    }
+
+    @Override
+    public int getInt(int columnIndex) {
+        Number num = (Number) mRows[mPos].get(columnIndex);
+        return num.intValue();
+    }
+
+    @Override
+    public long getLong(int columnIndex) {
+        Number num = (Number) mRows[mPos].get(columnIndex);
+        return num.longValue();
+    }
+
+    @Override
+    public float getFloat(int columnIndex) {
+        Number num = (Number) mRows[mPos].get(columnIndex);
+        return num.floatValue();
+    }
+
+    @Override
+    public double getDouble(int columnIndex) {
+        Number num = (Number) mRows[mPos].get(columnIndex);
+        return num.doubleValue();
+    }
+
+    @Override
+    public boolean isNull(int columnIndex) {
+        return mRows[mPos].get(columnIndex) == null;
+    }
+}
+
 
 /**
  * {@hide}
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
index fbb3c4c..d5f18e0 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
@@ -23,6 +23,8 @@
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.SharedPreferences;
+import android.net.ConnectivityManager;
+import android.net.IConnectivityManager;
 import android.net.NetworkInfo;
 import android.net.wifi.WifiManager;
 import android.os.AsyncResult;
@@ -188,8 +190,16 @@
         // and 2) whether the RIL will setup the baseband to auto-PS attach.
         SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(phone.getContext());
 
+        boolean dataEnabledSetting = true;
+        try {
+            dataEnabledSetting = IConnectivityManager.Stub.asInterface(ServiceManager.
+                    getService(Context.CONNECTIVITY_SERVICE)).getMobileDataEnabled();
+        } catch (Exception e) {
+            // nothing to do - use the old behavior and leave data on
+        }
         dataEnabled[APN_DEFAULT_ID] =
-                !sp.getBoolean(CDMAPhone.DATA_DISABLED_ON_BOOT_KEY, false);
+                !sp.getBoolean(CDMAPhone.DATA_DISABLED_ON_BOOT_KEY, false) &&
+                dataEnabledSetting;
         if (dataEnabled[APN_DEFAULT_ID]) {
             enabledCount++;
         }
diff --git a/telephony/java/com/android/internal/telephony/cdma/EriManager.java b/telephony/java/com/android/internal/telephony/cdma/EriManager.java
index 0e186d0..37c1d55 100644
--- a/telephony/java/com/android/internal/telephony/cdma/EriManager.java
+++ b/telephony/java/com/android/internal/telephony/cdma/EriManager.java
@@ -23,8 +23,8 @@
 
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.PhoneBase;
+import com.android.internal.util.XmlUtils;
 
-import com.android.common.XmlUtils;
 
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java
index 905d5e3..d893ec4 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java
@@ -18,8 +18,8 @@
 
 import android.os.Message;
 import android.util.Log;
+import android.util.Patterns;
 
-import com.android.common.Patterns;
 import com.android.internal.telephony.DataConnection;
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.RILConstants;
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index 1fd6be8..30beaaa 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -27,6 +27,8 @@
 import android.content.SharedPreferences;
 import android.database.ContentObserver;
 import android.database.Cursor;
+import android.net.ConnectivityManager;
+import android.net.IConnectivityManager;
 import android.net.NetworkInfo;
 import android.net.Uri;
 import android.net.wifi.WifiManager;
@@ -243,7 +245,15 @@
         // This preference tells us 1) initial condition for "dataEnabled",
         // and 2) whether the RIL will setup the baseband to auto-PS attach.
         SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(phone.getContext());
-        dataEnabled[APN_DEFAULT_ID] = !sp.getBoolean(GSMPhone.DATA_DISABLED_ON_BOOT_KEY, false);
+        boolean dataEnabledSetting = true;
+        try {
+            dataEnabledSetting = IConnectivityManager.Stub.asInterface(ServiceManager.
+                getService(Context.CONNECTIVITY_SERVICE)).getMobileDataEnabled();
+        } catch (Exception e) {
+            // nothing to do - use the old behavior and leave data on
+        }
+        dataEnabled[APN_DEFAULT_ID] = !sp.getBoolean(GSMPhone.DATA_DISABLED_ON_BOOT_KEY, false) &&
+                dataEnabledSetting;
         if (dataEnabled[APN_DEFAULT_ID]) {
             enabledCount++;
         }
diff --git a/telephony/java/com/android/internal/telephony/gsm/SpnOverride.java b/telephony/java/com/android/internal/telephony/gsm/SpnOverride.java
index abb0230..9ea30101 100644
--- a/telephony/java/com/android/internal/telephony/gsm/SpnOverride.java
+++ b/telephony/java/com/android/internal/telephony/gsm/SpnOverride.java
@@ -13,7 +13,7 @@
 import android.util.Log;
 import android.util.Xml;
 
-import com.android.common.XmlUtils;
+import com.android.internal.util.XmlUtils;
 
 public class SpnOverride {
     private HashMap<String, String> CarrierSpnMap;
diff --git a/telephony/java/com/android/internal/telephony/gsm/VoiceMailConstants.java b/telephony/java/com/android/internal/telephony/gsm/VoiceMailConstants.java
index 0bedd53..0e49e35 100644
--- a/telephony/java/com/android/internal/telephony/gsm/VoiceMailConstants.java
+++ b/telephony/java/com/android/internal/telephony/gsm/VoiceMailConstants.java
@@ -28,7 +28,8 @@
 
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
-import com.android.common.XmlUtils;
+
+import com.android.internal.util.XmlUtils;
 
 /**
  * {@hide}
diff --git a/common/tests/res/raw/alt_ip_only.crt b/tests/AndroidTests/res/raw/alt_ip_only.crt
similarity index 100%
rename from common/tests/res/raw/alt_ip_only.crt
rename to tests/AndroidTests/res/raw/alt_ip_only.crt
diff --git a/common/tests/res/raw/subject_alt_only.crt b/tests/AndroidTests/res/raw/subject_alt_only.crt
similarity index 100%
rename from common/tests/res/raw/subject_alt_only.crt
rename to tests/AndroidTests/res/raw/subject_alt_only.crt
diff --git a/common/tests/res/raw/subject_only.crt b/tests/AndroidTests/res/raw/subject_only.crt
similarity index 100%
rename from common/tests/res/raw/subject_only.crt
rename to tests/AndroidTests/res/raw/subject_only.crt
diff --git a/common/tests/res/raw/subject_with_alt_names.crt b/tests/AndroidTests/res/raw/subject_with_alt_names.crt
similarity index 100%
rename from common/tests/res/raw/subject_with_alt_names.crt
rename to tests/AndroidTests/res/raw/subject_with_alt_names.crt
diff --git a/common/tests/res/raw/subject_with_wild_alt_name.crt b/tests/AndroidTests/res/raw/subject_with_wild_alt_name.crt
similarity index 100%
rename from common/tests/res/raw/subject_with_wild_alt_name.crt
rename to tests/AndroidTests/res/raw/subject_with_wild_alt_name.crt
diff --git a/common/tests/res/raw/wild_alt_name_only.crt b/tests/AndroidTests/res/raw/wild_alt_name_only.crt
similarity index 100%
rename from common/tests/res/raw/wild_alt_name_only.crt
rename to tests/AndroidTests/res/raw/wild_alt_name_only.crt
diff --git a/tests/AndroidTests/src/com/android/unit_tests/AsecTests.java b/tests/AndroidTests/src/com/android/unit_tests/AsecTests.java
index e85254d..5aaf13b 100755
--- a/tests/AndroidTests/src/com/android/unit_tests/AsecTests.java
+++ b/tests/AndroidTests/src/com/android/unit_tests/AsecTests.java
@@ -55,6 +55,7 @@
     void failStr(String errMsg) {
         Log.w(TAG, "errMsg="+errMsg);
     }
+
     void failStr(Exception e) {
         Log.w(TAG, "e.getMessage="+e.getMessage());
         Log.w(TAG, "e="+e);
@@ -67,6 +68,13 @@
         cleanupContainers();
     }
 
+    @Override
+    protected void tearDown() throws Exception {
+        super.tearDown();
+        if (localLOGV) Log.i(TAG, "Cleaning out old test containers");
+        cleanupContainers();
+    }
+
     private void cleanupContainers() throws RemoteException {
         IMountService ms = getMs();
         String[] containers = ms.getSecureContainerList();
diff --git a/common/tests/src/com/android/common/DNParserTest.java b/tests/AndroidTests/src/com/android/unit_tests/DNParserTest.java
similarity index 95%
rename from common/tests/src/com/android/common/DNParserTest.java
rename to tests/AndroidTests/src/com/android/unit_tests/DNParserTest.java
index 34b140a..61d0b42 100644
--- a/common/tests/src/com/android/common/DNParserTest.java
+++ b/tests/AndroidTests/src/com/android/unit_tests/DNParserTest.java
@@ -13,7 +13,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.common;
+package com.android.unit_tests;
+
+import com.android.internal.net.DNParser;
 
 import javax.security.auth.x500.X500Principal;
 
diff --git a/common/tests/src/com/android/common/DomainNameValidatorTest.java b/tests/AndroidTests/src/com/android/unit_tests/DomainNameValidatorTest.java
similarity index 98%
rename from common/tests/src/com/android/common/DomainNameValidatorTest.java
rename to tests/AndroidTests/src/com/android/unit_tests/DomainNameValidatorTest.java
index b825be4..1754dbe 100644
--- a/common/tests/src/com/android/common/DomainNameValidatorTest.java
+++ b/tests/AndroidTests/src/com/android/unit_tests/DomainNameValidatorTest.java
@@ -13,9 +13,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.common;
+package com.android.unit_tests;
 
-import com.android.common.tests.R;
+import com.android.internal.net.DomainNameValidator;
 
 import android.test.AndroidTestCase;
 
diff --git a/tests/AndroidTests/src/com/android/unit_tests/PackageManagerTests.java b/tests/AndroidTests/src/com/android/unit_tests/PackageManagerTests.java
index d161a88..5e3895a 100755
--- a/tests/AndroidTests/src/com/android/unit_tests/PackageManagerTests.java
+++ b/tests/AndroidTests/src/com/android/unit_tests/PackageManagerTests.java
@@ -403,7 +403,7 @@
             return ip;
         } finally {
             if (cleanUp) {
-                cleanUpInstall(ip);
+                //cleanUpInstall(ip);
             }
         }
     }
diff --git a/common/tests/src/com/android/common/PatternsTest.java b/tests/AndroidTests/src/com/android/unit_tests/PatternsTest.java
similarity index 97%
rename from common/tests/src/com/android/common/PatternsTest.java
rename to tests/AndroidTests/src/com/android/unit_tests/PatternsTest.java
index 9e2ad58..0edcd6d 100644
--- a/common/tests/src/com/android/common/PatternsTest.java
+++ b/tests/AndroidTests/src/com/android/unit_tests/PatternsTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 The Android Open Source Project
+ * Copyright (C) 2010 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.
@@ -13,14 +13,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-package com.android.common;
+package com.android.unit_tests;
 
 import android.test.suitebuilder.annotation.SmallTest;
-import junit.framework.TestCase;
+import android.util.Patterns;
 
 import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+
+import junit.framework.TestCase;
 
 public class PatternsTest extends TestCase {
 
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/FileFilter.java b/tests/DumpRenderTree/src/com/android/dumprendertree/FileFilter.java
index ac980549..6ceb0f9 100644
--- a/tests/DumpRenderTree/src/com/android/dumprendertree/FileFilter.java
+++ b/tests/DumpRenderTree/src/com/android/dumprendertree/FileFilter.java
@@ -81,6 +81,30 @@
     };
 
     static void fillIgnoreResultList() {
+        // This first block of tests are for HTML5 features, for which Android
+        // should pass all tests. They are skipped only temporarily.
+        // TODO: Fix these failing tests and remove them from this list.
+        ignoreResultList.add("fast/dom/Geolocation/callback-exception.html"); // exception output incorrect with V8
+        ignoreResultList.add("http/tests/appcache/auth.html"); // file not found
+        ignoreResultList.add("http/tests/appcache/deferred-events.html"); // file not found
+        ignoreResultList.add("http/tests/appcache/deferred-events-delete-while-raising.html"); // file not found
+        ignoreResultList.add("http/tests/appcache/destroyed-frame.html"); // file not found
+        ignoreResultList.add("http/tests/appcache/detached-iframe.html"); // file not found
+        ignoreResultList.add("http/tests/appcache/different-scheme.html"); // file not found
+        ignoreResultList.add("http/tests/appcache/disabled.html"); // not found
+        ignoreResultList.add("http/tests/appcache/empty-manifest.html"); // flaky
+        ignoreResultList.add("http/tests/appcache/foreign-iframe-main.html"); // flaky - skips states
+        ignoreResultList.add("http/tests/appcache/local-content.html"); // text diff
+        ignoreResultList.add("http/tests/appcache/max-size.html"); // no layoutTestController.setAppCacheMaximumSize
+        ignoreResultList.add("http/tests/appcache/manifest-with-empty-file.html"); // flaky
+        ignoreResultList.add("http/tests/appcache/whitelist-wildcard.html"); // file not found
+        ignoreResultList.add("storage/database-lock-after-reload.html"); // failure
+        ignoreResultList.add("storage/domstorage/localstorage/string-conversion.html"); // false failure due to whitespace diff in output with V8
+        ignoreResultList.add("storage/domstorage/sessionstorage/string-conversion.html"); // false failure due to whitespace diff in output with V8
+        ignoreResultList.add("storage/statement-error-callback.html"); // expected line number diff in V8 only
+        ignoreResultList.add("storage/transaction-error-callback.html"); // expected line number diff in V8 only
+        ignoreResultList.add("storage/transaction-callback-exception-crash.html"); // expected line number diff in V8 only
+
         ignoreResultList.add("fast/css/case-transform.html"); // will not fix #619707
         ignoreResultList.add("fast/dom/Element/offsetLeft-offsetTop-body-quirk.html"); // different screen size result in extra spaces in Apple compared to us
         ignoreResultList.add("fast/dom/Window/Plug-ins.html"); // need test plugin
diff --git a/tests/SslLoad/src/com/android/sslload/SslLoad.java b/tests/SslLoad/src/com/android/sslload/SslLoad.java
index 1470d48..62aa524 100644
--- a/tests/SslLoad/src/com/android/sslload/SslLoad.java
+++ b/tests/SslLoad/src/com/android/sslload/SslLoad.java
@@ -35,7 +35,7 @@
 import android.widget.Button;
 import android.widget.TextView;
 import android.util.Log;
-import com.android.common.AndroidHttpClient;
+import android.net.http.AndroidHttpClient;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.ResponseHandler;
 import org.apache.http.client.methods.HttpGet;
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index 88c5441..ae4bd14 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -221,12 +221,12 @@
            && code != ResXMLTree::BAD_DOCUMENT) {
         if (code == ResXMLTree::START_TAG) {
             if (strcmp16(block.getElementName(&len), uses_sdk16.string()) == 0) {
-                ssize_t minSdkIndex = block.indexOfAttribute("android",
+                ssize_t minSdkIndex = block.indexOfAttribute(RESOURCES_ANDROID_NAMESPACE,
                                                              "minSdkVersion");
                 if (minSdkIndex >= 0) {
-                    String8 minSdkString = String8(
-                        block.getAttributeStringValue(minSdkIndex, &len));
-		    bundle->setMinSdkVersion(minSdkString.string());
+                    const uint16_t* minSdk16 = block.getAttributeStringValue(minSdkIndex, &len);
+                    const char* minSdk8 = strdup(String8(minSdk16).string());
+                    bundle->setMinSdkVersion(minSdk8);
                 }
             }
         }
diff --git a/tools/layoutlib/bridge/src/android/graphics/Canvas.java b/tools/layoutlib/bridge/src/android/graphics/Canvas.java
index 8bf5e85..d5d315e 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Canvas.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Canvas.java
@@ -236,11 +236,6 @@
     // OVERRIDEN METHODS
     // --------------------
 
-    @Override
-    public void finalize() throws Throwable {
-        // pass
-    }
-
     /* (non-Javadoc)
      * @see android.graphics.Canvas#setBitmap(android.graphics.Bitmap)
      */
diff --git a/tools/layoutlib/bridge/src/android/graphics/Matrix.java b/tools/layoutlib/bridge/src/android/graphics/Matrix.java
index 522415c..9e30671 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Matrix.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Matrix.java
@@ -52,11 +52,6 @@
         mValues = data;
     }
 
-    @Override
-    public void finalize() throws Throwable {
-        // pass
-    }
-
     //---------- Custom Methods
 
     /**
diff --git a/tools/layoutlib/bridge/src/android/graphics/Paint.java b/tools/layoutlib/bridge/src/android/graphics/Paint.java
index 2d03618..e4f9794 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Paint.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Paint.java
@@ -219,11 +219,6 @@
     }
 
     @Override
-    public void finalize() throws Throwable {
-        // pass
-    }
-
-    @Override
     public void reset() {
         super.reset();
     }
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
index 41d9f9d..8e9e75f 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
@@ -16,7 +16,7 @@
 
 package com.android.layoutlib.bridge;
 
-import com.android.common.XmlUtils;
+import com.android.internal.util.XmlUtils;
 import com.android.layoutlib.api.ILayoutBridge;
 import com.android.layoutlib.api.ILayoutLog;
 import com.android.layoutlib.api.ILayoutResult;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeTypedArray.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeTypedArray.java
index 6a98780..70c5bd7 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeTypedArray.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeTypedArray.java
@@ -16,7 +16,7 @@
 
 package com.android.layoutlib.bridge;
 
-import com.android.common.XmlUtils;
+import com.android.internal.util.XmlUtils;
 import com.android.layoutlib.api.IResourceValue;
 import com.android.layoutlib.api.IStyleResourceValue;
 
diff --git a/tools/preload/20100223.compiled b/tools/preload/20100223.compiled
new file mode 100644
index 0000000..3056388
--- /dev/null
+++ b/tools/preload/20100223.compiled
Binary files differ
diff --git a/tools/preload/MemoryUsage.java b/tools/preload/MemoryUsage.java
index bc21b6f..d8f95f4 100644
--- a/tools/preload/MemoryUsage.java
+++ b/tools/preload/MemoryUsage.java
@@ -166,7 +166,7 @@
             + ":/system/framework/loadclass.jar";
 
     private static final String[] GET_DIRTY_PAGES = {
-        "adb", "-e", "shell", "dalvikvm", CLASS_PATH, "LoadClass" };
+        "adb", "shell", "dalvikvm", CLASS_PATH, "LoadClass" };
 
     /**
      * Measures memory usage for the given class.
@@ -248,7 +248,7 @@
                 String line = in.readLine();
                 if (line == null || !line.startsWith("DECAFBAD,")) {
                     System.err.println("Got bad response for " + className
-                            + ": " + line);
+                            + ": " + line + "; command was " + Arrays.toString(commands));
                     errorCount += 1;
                     return NOT_AVAILABLE;
                 }
diff --git a/tools/preload/Policy.java b/tools/preload/Policy.java
index a8d761d..f557365 100644
--- a/tools/preload/Policy.java
+++ b/tools/preload/Policy.java
@@ -43,9 +43,14 @@
         "system_server",
         "com.google.process.content",
         "android.process.media",
+        "com.android.bluetooth",
+        "com.android.calendar",
+        "com.android.inputmethod.latin",
         "com.android.phone",
-        "com.google.android.apps.maps.FriendService",
+        "com.google.android.apps.maps.FriendService", // pre froyo
+        "com.google.android.apps.maps:FriendService", // froyo
         "com.google.android.apps.maps.LocationFriendService",
+        "com.google.android.deskclock",
         "com.google.process.gapps",
         "android.tts"
     ));
diff --git a/tools/preload/Record.java b/tools/preload/Record.java
index b2be4d4..9d45a26 100644
--- a/tools/preload/Record.java
+++ b/tools/preload/Record.java
@@ -19,6 +19,19 @@
  */
 class Record {
 
+    /**
+     * The delimiter character we use, {@code :}, conflicts with some other
+     * names. In that case, manually replace the delimiter with something else.
+     */
+    private static final String[] REPLACE_CLASSES = {
+            "com.google.android.apps.maps:FriendService",
+            "com.google.android.apps.maps\\u003AFriendService",
+            "com.google.android.apps.maps:driveabout",
+            "com.google.android.apps.maps\\u003Adriveabout",
+            "com.google.android.apps.maps:LocationFriendService",
+            "com.google.android.apps.maps\\u003ALocationFriendService",
+    };
+
     enum Type {
         /** Start of initialization. */
         START_LOAD,
@@ -74,6 +87,10 @@
         }
 
         sourceLineNumber = lineNum;
+
+        for (int i = 0; i < REPLACE_CLASSES.length; i+= 2) {
+            line = line.replace(REPLACE_CLASSES[i], REPLACE_CLASSES[i+1]);
+        }
         
         line = line.substring(1);
         String[] parts = line.split(":");