Merge "Move USB framework support from android.hardware to android.hardware.usb package"
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 9e72c1b..c502e6f 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -2417,6 +2417,7 @@
      */
     public boolean onMenuOpened(int featureId, Menu menu) {
         if (featureId == Window.FEATURE_ACTION_BAR) {
+            initActionBar();
             if (mActionBar != null) {
                 mActionBar.dispatchMenuVisibilityChanged(true);
             } else {
diff --git a/core/java/android/view/ViewPropertyAnimator.java b/core/java/android/view/ViewPropertyAnimator.java
index 27e7db1..1d56e9d 100644
--- a/core/java/android/view/ViewPropertyAnimator.java
+++ b/core/java/android/view/ViewPropertyAnimator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2011 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.
@@ -33,11 +33,11 @@
  * more convenient syntax to animate a specific property, then ViewPropertyAnimator might be
  * more well-suited to the task.
  *
- * <p>This class could provide better performance for several simultaneous animations, because
- * it will optimize invalidatesionto take place only once for several properties instead of each
- * aniamted property independently causing its own invalidation. Also, the syntax of using this
+ * <p>This class may provide better performance for several simultaneous animations, because
+ * it will optimize invalidate calls to take place only once for several properties instead of each
+ * animated property independently causing its own invalidation. Also, the syntax of using this
  * class could be easier to use because the caller need only tell the View object which
- * property to animate, and the value to animate either to or by, and this calss handles the
+ * property to animate, and the value to animate either to or by, and this class handles the
  * details of configuring the underlying Animator class and starting it.</p>
  *
  * <p>This class is not constructed by the caller, but rather by the View whose properties
@@ -103,7 +103,7 @@
 
     /**
      * Constants used to associate a property being requested and the mechanism used to set
-     * the property (this calss calls directly into View to set the properties in question).
+     * the property (this class calls directly into View to set the properties in question).
      */
     private static final int NONE           = 0x0000;
     private static final int TRANSLATION_X  = 0x0001;
@@ -260,7 +260,7 @@
 
     /**
      * This method will cause the View's <code>x</code> property to be animated to the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The value to be animated to.
      * @see View#setX(float)
@@ -273,7 +273,7 @@
 
     /**
      * This method will cause the View's <code>x</code> property to be animated by the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The amount to be animated by, as an offset from the current value.
      * @see View#setX(float)
@@ -286,7 +286,7 @@
 
     /**
      * This method will cause the View's <code>y</code> property to be animated to the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The value to be animated to.
      * @see View#setY(float)
@@ -299,7 +299,7 @@
 
     /**
      * This method will cause the View's <code>y</code> property to be animated by the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The amount to be animated by, as an offset from the current value.
      * @see View#setY(float)
@@ -312,7 +312,7 @@
 
     /**
      * This method will cause the View's <code>rotation</code> property to be animated to the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The value to be animated to.
      * @see View#setRotation(float)
@@ -325,7 +325,7 @@
 
     /**
      * This method will cause the View's <code>rotation</code> property to be animated by the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The amount to be animated by, as an offset from the current value.
      * @see View#setRotation(float)
@@ -338,7 +338,7 @@
 
     /**
      * This method will cause the View's <code>rotationX</code> property to be animated to the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The value to be animated to.
      * @see View#setRotationX(float)
@@ -351,7 +351,7 @@
 
     /**
      * This method will cause the View's <code>rotationX</code> property to be animated by the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The amount to be animated by, as an offset from the current value.
      * @see View#setRotationX(float)
@@ -364,7 +364,7 @@
 
     /**
      * This method will cause the View's <code>rotationY</code> property to be animated to the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The value to be animated to.
      * @see View#setRotationY(float)
@@ -377,7 +377,7 @@
 
     /**
      * This method will cause the View's <code>rotationY</code> property to be animated by the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The amount to be animated by, as an offset from the current value.
      * @see View#setRotationY(float)
@@ -390,7 +390,7 @@
 
     /**
      * This method will cause the View's <code>translationX</code> property to be animated to the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The value to be animated to.
      * @see View#setTranslationX(float)
@@ -403,7 +403,7 @@
 
     /**
      * This method will cause the View's <code>translationX</code> property to be animated by the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The amount to be animated by, as an offset from the current value.
      * @see View#setTranslationX(float)
@@ -416,7 +416,7 @@
 
     /**
      * This method will cause the View's <code>translationY</code> property to be animated to the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The value to be animated to.
      * @see View#setTranslationY(float)
@@ -429,7 +429,7 @@
 
     /**
      * This method will cause the View's <code>translationY</code> property to be animated by the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The amount to be animated by, as an offset from the current value.
      * @see View#setTranslationY(float)
@@ -442,7 +442,7 @@
 
     /**
      * This method will cause the View's <code>scaleX</code> property to be animated to the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The value to be animated to.
      * @see View#setScaleX(float)
@@ -455,7 +455,7 @@
 
     /**
      * This method will cause the View's <code>scaleX</code> property to be animated by the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The amount to be animated by, as an offset from the current value.
      * @see View#setScaleX(float)
@@ -468,7 +468,7 @@
 
     /**
      * This method will cause the View's <code>scaleY</code> property to be animated to the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The value to be animated to.
      * @see View#setScaleY(float)
@@ -481,7 +481,7 @@
 
     /**
      * This method will cause the View's <code>scaleY</code> property to be animated by the
-     * specifed value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The amount to be animated by, as an offset from the current value.
      * @see View#setScaleY(float)
@@ -494,7 +494,7 @@
 
     /**
      * This method will cause the View's <code>alpha</code> property to be animated to the
-     * specified value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The value to be animated to.
      * @see View#setAlpha(float)
@@ -507,7 +507,7 @@
 
     /**
      * This method will cause the View's <code>alpha</code> property to be animated by the
-     * specified value.
+     * specified value. Animations already running on the property will be canceled.
      *
      * @param value The amount to be animated by, as an offset from the current value.
      * @see View#setAlpha(float)
@@ -548,7 +548,7 @@
 
     /**
      * Utility function, called by the various x(), y(), etc. methods. This stores the
-     * constnat name for the property along with the from/delta values that will be used to
+     * constant name for the property along with the from/delta values that will be used to
      * calculate and set the property during the animation. This structure is added to the
      * pending animations, awaiting the eventual start() of the underlying animator. A
      * Runnable is posted to start the animation, and any pending such Runnable is canceled
@@ -578,14 +578,14 @@
     }
 
     /**
-     * Utility function, called by animatePropert() and animatePropertyBy(), which handles the
+     * Utility function, called by animateProperty() and animatePropertyBy(), which handles the
      * details of adding a pending animation and posting the request to start the animation.
      *
      * @param constantName The specifier for the property being animated
-     * @param fromValue The starting value of the property
+     * @param startValue The starting value of the property
      * @param byValue The amount by which the property will change
      */
-    private void animatePropertyBy(int constantName, float fromValue, float byValue) {
+    private void animatePropertyBy(int constantName, float startValue, float byValue) {
         // First, cancel any existing animations on this property
         if (mAnimatorMap.size() > 0) {
             Animator animatorToCancel = null;
@@ -598,7 +598,7 @@
                     // on a property will cancel a previous animation on that property, so
                     // there can only ever be one such animation running.
                     if (bundle.mPropertyMask == NONE) {
-                        // the animation is not longer changing animthing - cancel it
+                        // the animation is not longer changing anything - cancel it
                         animatorToCancel = runningAnim;
                         break;
                     }
@@ -609,7 +609,6 @@
             }
         }
 
-        float startValue = getValue(constantName);
         NameValuesHolder nameValuePair = new NameValuesHolder(constantName, startValue, byValue);
         mPendingAnimations.add(nameValuePair);
         mView.getHandler().removeCallbacks(mAnimationStarter);
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java
index 492cb80..47c69be 100644
--- a/core/java/android/webkit/WebTextView.java
+++ b/core/java/android/webkit/WebTextView.java
@@ -947,6 +947,8 @@
         @Override
         public void setBounds(int left, int top, int right, int bottom) {
             super.setBounds(left, top, right, bottom);
+            bottom--;
+            right -= 2;
             // Top line
             mLines[0] = left;
             mLines[1] = top + 1;
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index f877fc8..43f8790 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -5043,15 +5043,13 @@
         super.onAttachedToWindow();
         if (hasWindowFocus()) setActive(true);
         final ViewTreeObserver treeObserver = getViewTreeObserver();
-        if (treeObserver != null) {
-            if (mGlobalLayoutListener == null) {
-                mGlobalLayoutListener = new InnerGlobalLayoutListener();
-                treeObserver.addOnGlobalLayoutListener(mGlobalLayoutListener);
-            }
-            if (mScrollChangedListener == null) {
-                mScrollChangedListener = new InnerScrollChangedListener();
-                treeObserver.addOnScrollChangedListener(mScrollChangedListener);
-            }
+        if (mGlobalLayoutListener == null) {
+            mGlobalLayoutListener = new InnerGlobalLayoutListener();
+            treeObserver.addOnGlobalLayoutListener(mGlobalLayoutListener);
+        }
+        if (mScrollChangedListener == null) {
+            mScrollChangedListener = new InnerScrollChangedListener();
+            treeObserver.addOnScrollChangedListener(mScrollChangedListener);
         }
 
         addAccessibilityApisToJavaScript();
@@ -5064,15 +5062,13 @@
         if (hasWindowFocus()) setActive(false);
 
         final ViewTreeObserver treeObserver = getViewTreeObserver();
-        if (treeObserver != null) {
-            if (mGlobalLayoutListener != null) {
-                treeObserver.removeGlobalOnLayoutListener(mGlobalLayoutListener);
-                mGlobalLayoutListener = null;
-            }
-            if (mScrollChangedListener != null) {
-                treeObserver.removeOnScrollChangedListener(mScrollChangedListener);
-                mScrollChangedListener = null;
-            }
+        if (mGlobalLayoutListener != null) {
+            treeObserver.removeGlobalOnLayoutListener(mGlobalLayoutListener);
+            mGlobalLayoutListener = null;
+        }
+        if (mScrollChangedListener != null) {
+            treeObserver.removeOnScrollChangedListener(mScrollChangedListener);
+            mScrollChangedListener = null;
         }
 
         removeAccessibilityApisFromJavaScript();
@@ -5106,8 +5102,7 @@
 
     /**
      * @deprecated WebView should not have implemented
-     * ViewTreeObserver.OnGlobalFocusChangeListener.  This method
-     * does nothing now.
+     * ViewTreeObserver.OnGlobalFocusChangeListener. This method does nothing now.
      */
     @Deprecated
     public void onGlobalFocusChanged(View oldFocus, View newFocus) {
@@ -7758,6 +7753,7 @@
             int     mEnabled;
             int     mId;
 
+            @Override
             public String toString() {
                 return mString;
             }
@@ -8222,6 +8218,7 @@
      * zero to make the view transparent.
      * @param color   the ARGB color described by Color.java
      */
+    @Override
     public void setBackgroundColor(int color) {
         mBackgroundColor = color;
         mWebViewCore.sendMessage(EventHub.SET_BACKGROUND_COLOR, color);
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 47bf57f..b1fdae0 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -2268,11 +2268,9 @@
         super.onAttachedToWindow();
 
         final ViewTreeObserver treeObserver = getViewTreeObserver();
-        if (treeObserver != null) {
-            treeObserver.addOnTouchModeChangeListener(this);
-            if (mTextFilterEnabled && mPopup != null && !mGlobalLayoutListenerAddedFilter) {
-                treeObserver.addOnGlobalLayoutListener(this);
-            }
+        treeObserver.addOnTouchModeChangeListener(this);
+        if (mTextFilterEnabled && mPopup != null && !mGlobalLayoutListenerAddedFilter) {
+            treeObserver.addOnGlobalLayoutListener(this);
         }
 
         if (mAdapter != null && mDataSetObserver == null) {
@@ -2297,12 +2295,10 @@
         mRecycler.clear();
 
         final ViewTreeObserver treeObserver = getViewTreeObserver();
-        if (treeObserver != null) {
-            treeObserver.removeOnTouchModeChangeListener(this);
-            if (mTextFilterEnabled && mPopup != null) {
-                treeObserver.removeGlobalOnLayoutListener(this);
-                mGlobalLayoutListenerAddedFilter = false;
-            }
+        treeObserver.removeOnTouchModeChangeListener(this);
+        if (mTextFilterEnabled && mPopup != null) {
+            treeObserver.removeGlobalOnLayoutListener(this);
+            mGlobalLayoutListenerAddedFilter = false;
         }
 
         if (mAdapter != null) {
diff --git a/core/java/android/widget/TabHost.java b/core/java/android/widget/TabHost.java
index 03eea66..57a8531 100644
--- a/core/java/android/widget/TabHost.java
+++ b/core/java/android/widget/TabHost.java
@@ -183,18 +183,14 @@
     protected void onAttachedToWindow() {
         super.onAttachedToWindow();
         final ViewTreeObserver treeObserver = getViewTreeObserver();
-        if (treeObserver != null) {
-            treeObserver.addOnTouchModeChangeListener(this);
-        }
+        treeObserver.addOnTouchModeChangeListener(this);
     }
 
     @Override
     protected void onDetachedFromWindow() {
         super.onDetachedFromWindow();
         final ViewTreeObserver treeObserver = getViewTreeObserver();
-        if (treeObserver != null) {
-            treeObserver.removeOnTouchModeChangeListener(this);
-        }
+        treeObserver.removeOnTouchModeChangeListener(this);
     }
 
     /**
diff --git a/core/java/android/widget/TabWidget.java b/core/java/android/widget/TabWidget.java
index d74ef24..6f76dd0 100644
--- a/core/java/android/widget/TabWidget.java
+++ b/core/java/android/widget/TabWidget.java
@@ -172,6 +172,11 @@
 
     @Override
     void measureHorizontal(int widthMeasureSpec, int heightMeasureSpec) {
+        if (MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.UNSPECIFIED) {
+            super.measureHorizontal(widthMeasureSpec, heightMeasureSpec);
+            return;
+        }
+
         // First, measure with no constraint
         final int unspecifiedWidth = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
         mImposedTabsHeight = -1;
@@ -208,9 +213,7 @@
         }
 
         // Measure again, this time with imposed tab widths and respecting initial spec request
-        if (mImposedTabsHeight >= 0 || unspecifiedWidth != widthMeasureSpec) {
-            super.measureHorizontal(widthMeasureSpec, heightMeasureSpec);
-        }
+        super.measureHorizontal(widthMeasureSpec, heightMeasureSpec);
     }
 
     /**
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 4f74846..41fa758 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -125,10 +125,10 @@
     <string name="contentServiceSync" msgid="8353523060269335667">"Sincronización"</string>
     <string name="contentServiceSyncNotificationTitle" msgid="397743349191901458">"Sincronización"</string>
     <string name="contentServiceTooManyDeletesNotificationDesc" msgid="8100981435080696431">"Demasiadas eliminaciones de <xliff:g id="CONTENT_TYPE">%s</xliff:g>"</string>
-    <string name="low_memory" product="tablet" msgid="2292820184396262278">"Se ha agotado el espacio de almacenamiento de la tableta. Elimina algunos archivos para liberar espacio."</string>
+    <string name="low_memory" product="tablet" msgid="2292820184396262278">"Se ha agotado el espacio de almacenamiento del tablet. Elimina algunos archivos para liberar espacio."</string>
     <string name="low_memory" product="default" msgid="6632412458436461203">"Se ha agotado el espacio de almacenamiento del teléfono. Elimina algunos archivos para liberar espacio."</string>
     <string name="me" msgid="6545696007631404292">"Yo"</string>
-    <string name="power_dialog" product="tablet" msgid="8545351420865202853">"Opciones de tableta"</string>
+    <string name="power_dialog" product="tablet" msgid="8545351420865202853">"Opciones del tablet"</string>
     <string name="power_dialog" product="default" msgid="1319919075463988638">"Opciones del teléfono"</string>
     <string name="silent_mode" msgid="7167703389802618663">"Modo silencio"</string>
     <string name="turn_on_radio" msgid="3912793092339962371">"Activar conexión inalámbrica"</string>
@@ -136,12 +136,12 @@
     <string name="screen_lock" msgid="799094655496098153">"Bloqueo de pantalla"</string>
     <string name="power_off" msgid="4266614107412865048">"Apagar"</string>
     <string name="shutdown_progress" msgid="2281079257329981203">"Apagando..."</string>
-    <string name="shutdown_confirm" product="tablet" msgid="3385745179555731470">"La tableta se apagará."</string>
+    <string name="shutdown_confirm" product="tablet" msgid="3385745179555731470">"El tablet se apagará."</string>
     <string name="shutdown_confirm" product="default" msgid="649792175242821353">"El teléfono se apagará."</string>
     <string name="shutdown_confirm_question" msgid="6656441286856415014">"¿Quieres apagar el teléfono?"</string>
     <string name="recent_tasks_title" msgid="3691764623638127888">"Reciente"</string>
     <string name="no_recent_tasks" msgid="279702952298056674">"No hay aplicaciones recientes"</string>
-    <string name="global_actions" product="tablet" msgid="408477140088053665">"Opciones de tableta"</string>
+    <string name="global_actions" product="tablet" msgid="408477140088053665">"Opciones del tablet"</string>
     <string name="global_actions" product="default" msgid="2406416831541615258">"Opciones del teléfono"</string>
     <string name="global_action_lock" msgid="2844945191792119712">"Bloqueo de pantalla"</string>
     <string name="global_action_power_off" msgid="4471879440839879722">"Apagar"</string>
@@ -159,7 +159,7 @@
     <string name="permgrouplab_messages" msgid="7521249148445456662">"Tus mensajes"</string>
     <string name="permgroupdesc_messages" msgid="7045736972019211994">"Leer y escribir SMS, mensajes de correo electrónico y otros mensajes"</string>
     <string name="permgrouplab_personalInfo" msgid="3519163141070533474">"Tu información personal"</string>
-    <string name="permgroupdesc_personalInfo" product="tablet" msgid="6975389054186265786">"Accede directamente al calendario y a los contactos almacenados en la tableta."</string>
+    <string name="permgroupdesc_personalInfo" product="tablet" msgid="6975389054186265786">"Accede directamente al calendario y a los contactos almacenados en el tablet."</string>
     <string name="permgroupdesc_personalInfo" product="default" msgid="5488050357388806068">"Acceso directo al calendario y a los contactos almacenados en el teléfono"</string>
     <string name="permgrouplab_location" msgid="635149742436692049">"Tu ubicación"</string>
     <string name="permgroupdesc_location" msgid="2430258821648348660">"Controlar su ubicación física"</string>
@@ -193,10 +193,10 @@
     <string name="permlab_sendSms" msgid="5600830612147671529">"enviar mensajes SMS"</string>
     <string name="permdesc_sendSms" msgid="1946540351763502120">"Permite que la aplicación envíe mensajes SMS. Es posible que tengas que pagar si las aplicaciones malintencionadas envían mensajes sin tu confirmación."</string>
     <string name="permlab_readSms" msgid="4085333708122372256">"leer SMS o MMS"</string>
-    <string name="permdesc_readSms" product="tablet" msgid="5836710350295631545">"Permite que la aplicación lea mensajes SMS almacenados en la tableta o en la tarjeta SIM. Las aplicaciones malintencionadas pueden leer los mensajes confidenciales."</string>
+    <string name="permdesc_readSms" product="tablet" msgid="5836710350295631545">"Permite que la aplicación lea mensajes SMS almacenados en el tablet o en la tarjeta SIM. Las aplicaciones malintencionadas pueden leer los mensajes confidenciales."</string>
     <string name="permdesc_readSms" product="default" msgid="3002170087197294591">"Permite que la aplicación lea mensajes SMS almacenados en el teléfono o en la tarjeta SIM. Las aplicaciones malintencionadas pueden leer los mensajes confidenciales."</string>
     <string name="permlab_writeSms" msgid="6881122575154940744">"editar SMS o MMS"</string>
-    <string name="permdesc_writeSms" product="tablet" msgid="5332124772918835437">"Permite que la aplicación escriba en mensajes SMS almacenados en la tableta o en la tarjeta SIM. Las aplicaciones malintencionadas pueden borrar los mensajes."</string>
+    <string name="permdesc_writeSms" product="tablet" msgid="5332124772918835437">"Permite que la aplicación escriba en mensajes SMS almacenados en el tablet o en la tarjeta SIM. Las aplicaciones malintencionadas pueden borrar los mensajes."</string>
     <string name="permdesc_writeSms" product="default" msgid="6299398896177548095">"Permite que la aplicación escriba en mensajes SMS almacenados en el teléfono o en la tarjeta SIM. Las aplicaciones malintencionadas pueden borrar los mensajes."</string>
     <string name="permlab_receiveWapPush" msgid="8258226427716551388">"recibir WAP"</string>
     <string name="permdesc_receiveWapPush" msgid="5979623826128082171">"Permite que la aplicación reciba y procese mensajes WAP. Las aplicaciones malintencionadas pueden controlar los mensajes o eliminarlos sin mostrarlos al usuario."</string>
@@ -247,7 +247,7 @@
     <string name="permlab_manageAppTokens" msgid="17124341698093865">"administrar tokens de aplicación"</string>
     <string name="permdesc_manageAppTokens" msgid="977127907524195988">"Permite que las aplicaciones creen y administren sus propios tokens, ignorando su orden z normal. Nunca debería ser necesario para las aplicaciones normales."</string>
     <string name="permlab_injectEvents" msgid="1378746584023586600">"pulsar teclas y botones de control"</string>
-    <string name="permdesc_injectEvents" product="tablet" msgid="7200014808195664505">"Permite que la aplicación proporcione sus propios eventos de entrada (pulsación de teclas, etc.) a otras aplicaciones. Las aplicaciones malintencionadas pueden utilizar este permiso para controlar la tableta."</string>
+    <string name="permdesc_injectEvents" product="tablet" msgid="7200014808195664505">"Permite que la aplicación proporcione sus propios eventos de entrada (pulsación de teclas, etc.) a otras aplicaciones. Las aplicaciones malintencionadas pueden utilizar este permiso para controlar el tablet."</string>
     <string name="permdesc_injectEvents" product="default" msgid="3946098050410874715">"Permite que la aplicación proporcione sus propios eventos de entrada (pulsación de teclas, etc.) a otras aplicaciones. Las aplicaciones malintencionadas pueden utilizar este permiso para controlar el teléfono."</string>
     <string name="permlab_readInputState" msgid="469428900041249234">"registrar lo que se escribe y las acciones que se realizan"</string>
     <string name="permdesc_readInputState" msgid="5132879321450325445">"Permite que las aplicaciones observen las teclas que pulsas incluso cuando interactúas con otra aplicación (como, por ejemplo, al introducir una contraseña). No debería ser necesario nunca para las aplicaciones normales."</string>
@@ -276,17 +276,17 @@
     <string name="permlab_installPackages" msgid="335800214119051089">"instalar aplicaciones directamente"</string>
     <string name="permdesc_installPackages" msgid="526669220850066132">"Permite que una aplicación instale paquetes Android nuevos o actualizados. Las aplicaciones malintencionadas pueden utilizar este permiso para añadir aplicaciones nuevas con permisos arbitrariamente potentes."</string>
     <string name="permlab_clearAppCache" msgid="4747698311163766540">"eliminar todos los datos de caché de la aplicación"</string>
-    <string name="permdesc_clearAppCache" product="tablet" msgid="3097119797652477973">"Permite que una aplicación libere espacio de almacenamiento en la tableta mediante la eliminación de archivos del directorio de caché de la aplicación. El acceso está muy restringido (limitado normalmente al proceso del sistema)."</string>
+    <string name="permdesc_clearAppCache" product="tablet" msgid="3097119797652477973">"Permite que una aplicación libere espacio de almacenamiento en el tablet mediante la eliminación de archivos del directorio de caché de la aplicación. El acceso está muy restringido (limitado normalmente al proceso del sistema)."</string>
     <string name="permdesc_clearAppCache" product="default" msgid="7740465694193671402">"Permite que una aplicación libere espacio de almacenamiento en el teléfono mediante la eliminación de archivos en el directorio de caché de la aplicación. El acceso al proceso del sistema suele estar muy restringido."</string>
     <string name="permlab_movePackage" msgid="728454979946503926">"Mover recursos de aplicaciones"</string>
     <string name="permdesc_movePackage" msgid="6323049291923925277">"Permite que una aplicación mueva los recursos de aplicaciones de un medio interno a otro externo y viceversa."</string>
     <string name="permlab_readLogs" msgid="6615778543198967614">"leer datos de registro personales"</string>
-    <string name="permdesc_readLogs" product="tablet" msgid="4077356893924755294">"Permite que una aplicación lea diversos archivos de registro del sistema. Con este permiso, la aplicación puede ver información general sobre las acciones que se realizan con la tableta (que puede incluir datos personales o privados)."</string>
+    <string name="permdesc_readLogs" product="tablet" msgid="4077356893924755294">"Permite que una aplicación lea diversos archivos de registro del sistema. Con este permiso, la aplicación puede ver información general sobre las acciones que se realizan con el tablet (que puede incluir datos personales o privados)."</string>
     <string name="permdesc_readLogs" product="default" msgid="8896449437464867766">"Permite que una aplicación lea distintos archivos de registro del sistema. Con este permiso, la aplicación puede ver información general sobre las acciones que realizas con el teléfono, que puede incluir datos personales o privados."</string>
     <string name="permlab_diagnostic" msgid="8076743953908000342">"leer/escribir en los recursos propiedad del grupo de diagnóstico"</string>
     <string name="permdesc_diagnostic" msgid="3121238373951637049">"Permite que una aplicación lea y escriba en cualquier recurso propiedad del grupo de diagnóstico como, por ejemplo, archivos in/dev. Este permiso podría afectar a la seguridad y estabilidad del sistema. SÓLO se debe utilizar para diagnósticos específicos de hardware realizados por el fabricante o el operador."</string>
     <string name="permlab_changeComponentState" msgid="79425198834329406">"habilitar o inhabilitar componentes de la aplicación"</string>
-    <string name="permdesc_changeComponentState" product="tablet" msgid="4647419365510068321">"Permite que una aplicación cambie si un componente de otra aplicación está habilitado o inhabilitado. Las aplicaciones malintencionadas pueden utilizar este permiso para inhabilitar funciones importantes de la tableta. Este permiso se debe utilizar con precaución, ya que es posible que los componentes se vuelvan inservibles, inconsistentes o inestables."</string>
+    <string name="permdesc_changeComponentState" product="tablet" msgid="4647419365510068321">"Permite que una aplicación cambie si un componente de otra aplicación está habilitado o inhabilitado. Las aplicaciones malintencionadas pueden utilizar este permiso para inhabilitar funciones importantes del tablet. Este permiso se debe utilizar con precaución, ya que es posible que los componentes se vuelvan inservibles, inconsistentes o inestables."</string>
     <string name="permdesc_changeComponentState" product="default" msgid="3443473726140080761">"Permite que una aplicación cambie si un componente de otra aplicación está habilitado o inhabilitado. Las aplicaciones malintencionadas pueden utilizar este permiso para inhabilitar funciones importantes del teléfono. Este permiso se debe utilizar con precaución, ya que es posible que los componentes se vuelvan inservibles, inconsistentes o inestables."</string>
     <string name="permlab_setPreferredApplications" msgid="3393305202145172005">"establecer aplicaciones preferidas"</string>
     <string name="permdesc_setPreferredApplications" msgid="760008293501937546">"Permite que una aplicación modifique las aplicaciones preferidas del usuario. De esta forma, las aplicaciones malintencionadas pueden cambiar de forma silenciosa las aplicaciones que se están ejecutando, falsificando las aplicaciones existentes para recopilar datos privados del usuario."</string>
@@ -297,19 +297,19 @@
     <string name="permlab_writeGservices" msgid="2149426664226152185">"modificar la asignación de servicios de Google"</string>
     <string name="permdesc_writeGservices" msgid="6602362746516676175">"Permite que una aplicación modifique la asignación de servicios de Google. No está destinado al uso por parte de aplicaciones normales."</string>
     <string name="permlab_receiveBootCompleted" msgid="7776779842866993377">"ejecutar automáticamente al iniciar"</string>
-    <string name="permdesc_receiveBootCompleted" product="tablet" msgid="7530977064379338199">"Permite que una aplicación se ejecute automáticamente en cuanto se haya terminado de iniciar el sistema. Esto puede hacer que la tableta tarde más en iniciarse y permite que la aplicación ralentice el funcionamiento global de la tableta al ejecutarse continuamente."</string>
+    <string name="permdesc_receiveBootCompleted" product="tablet" msgid="7530977064379338199">"Permite que una aplicación se ejecute automáticamente en cuanto se haya terminado de iniciar el sistema. Esto puede hacer que el tablet tarde más en iniciarse y permite que la aplicación ralentice el funcionamiento global del tablet al ejecutarse continuamente."</string>
     <string name="permdesc_receiveBootCompleted" product="default" msgid="698336728415008796">"Permite que una aplicación se ejecute automáticamente en cuanto se haya terminado de iniciar el sistema. Esto puede provocar que el teléfono tarde más en iniciarse y permite que la aplicación ralentice el funcionamiento global del teléfono al ejecutarse continuamente."</string>
     <string name="permlab_broadcastSticky" msgid="7919126372606881614">"enviar emisión persistente"</string>
-    <string name="permdesc_broadcastSticky" product="tablet" msgid="6322249605930062595">"Permite que una aplicación envíe emisiones persistentes que permanecen en el teléfono una vez que la emisión finaliza. Las aplicaciones malintencionadas pueden ralentizar la tableta o volverla inestable al hacer que emplee demasiada memoria."</string>
+    <string name="permdesc_broadcastSticky" product="tablet" msgid="6322249605930062595">"Permite que una aplicación envíe emisiones persistentes que permanecen en el tablet una vez que la emisión finaliza. Las aplicaciones malintencionadas pueden ralentizar el tablet o volverlo inestable al hacer que emplee demasiada memoria."</string>
     <string name="permdesc_broadcastSticky" product="default" msgid="1920045289234052219">"Permite que una aplicación envíe emisiones persistentes, que permanecen en el teléfono una vez que la emisión finaliza. Las aplicaciones malintencionadas pueden ralentizar el teléfono o volverlo inestable al hacer que emplee demasiada memoria."</string>
     <string name="permlab_readContacts" msgid="6219652189510218240">"leer los datos de contacto"</string>
-    <string name="permdesc_readContacts" product="tablet" msgid="7596158687301157686">"Permite que una aplicación lea todos los datos de contacto (direcciones) almacenados en la tableta. Las aplicaciones malintencionadas pueden utilizar este permiso para enviar tus datos a otras personas."</string>
+    <string name="permdesc_readContacts" product="tablet" msgid="7596158687301157686">"Permite que una aplicación lea todos los datos de contacto (direcciones) almacenados en el tablet. Las aplicaciones malintencionadas pueden utilizar este permiso para enviar tus datos a otras personas."</string>
     <string name="permdesc_readContacts" product="default" msgid="3371591512896545975">"Permite que una aplicación lea todos los datos de contacto (direcciones) almacenados en el teléfono. Las aplicaciones malintencionadas pueden utilizar este permiso para enviar tus datos a otras personas."</string>
     <string name="permlab_writeContacts" msgid="644616215860933284">"escribir datos de contacto"</string>
-    <string name="permdesc_writeContacts" product="tablet" msgid="7782689510038568495">"Permite que una aplicación modifique los datos de contacto (direcciones) almacenados en la tableta. Las aplicaciones malintencionadas pueden utilizar este permiso para borrar o modificar los datos de contacto."</string>
+    <string name="permdesc_writeContacts" product="tablet" msgid="7782689510038568495">"Permite que una aplicación modifique los datos de contacto (direcciones) almacenados en el tablet. Las aplicaciones malintencionadas pueden utilizar este permiso para borrar o modificar los datos de contacto."</string>
     <string name="permdesc_writeContacts" product="default" msgid="3924383579108183601">"Permite que una aplicación modifique los datos de contacto (direcciones) almacenados en el teléfono. Las aplicaciones malintencionadas pueden utilizar este permiso para borrar o modificar tus datos de contacto."</string>
     <string name="permlab_readCalendar" msgid="6898987798303840534">"leer eventos de calendario"</string>
-    <string name="permdesc_readCalendar" product="tablet" msgid="5905870265734599678">"Permite que una aplicación lea todos los eventos de calendario almacenados en la tableta. Las aplicaciones malintencionadas pueden utilizar este permiso para enviar tus eventos de calendario a otras personas."</string>
+    <string name="permdesc_readCalendar" product="tablet" msgid="5905870265734599678">"Permite que una aplicación lea todos los eventos de calendario almacenados en el tablet. Las aplicaciones malintencionadas pueden utilizar este permiso para enviar tus eventos de calendario a otras personas."</string>
     <string name="permdesc_readCalendar" product="default" msgid="5533029139652095734">"Permite que una aplicación lea todos los eventos de calendario almacenados en el teléfono. Las aplicaciones malintencionadas pueden utilizar este permiso para enviar tus eventos de calendario a otras personas."</string>
     <string name="permlab_writeCalendar" msgid="3894879352594904361">"añadir o modificar eventos de calendario y enviar mensajes de correo electrónico a los invitados"</string>
     <string name="permdesc_writeCalendar" msgid="2988871373544154221">"Permite que una aplicación añada o modifique los eventos de tu calendario, que puede enviar mensajes de correo electrónico a los invitados. Las aplicaciones malintencionadas pueden utilizar este permiso para borrar o modificar tus eventos de calendario o para enviar mensajes a los invitados."</string>
@@ -320,10 +320,10 @@
     <string name="permlab_installLocationProvider" msgid="6578101199825193873">"permiso para instalar un proveedor de ubicación"</string>
     <string name="permdesc_installLocationProvider" msgid="5449175116732002106">"Crear fuentes de origen simuladas para realizar pruebas. Las aplicaciones malintencionadas pueden utilizar este permiso para sobrescribir la ubicación o el estado devueltos por orígenes de ubicación reales, tales como los proveedores de red o GPS, o para controlar y notificar tu ubicación a una fuente externa."</string>
     <string name="permlab_accessFineLocation" msgid="8116127007541369477">"precisar la ubicación (GPS)"</string>
-    <string name="permdesc_accessFineLocation" product="tablet" msgid="243973693233359681">"Permite acceder a fuentes de ubicación precisas como, por ejemplo, el sistema de posicionamiento global, en la tableta, si hay alguna disponible. Las aplicaciones malintencionadas pueden utilizar este permiso para determinar la ubicación del usuario y pueden consumir batería adicional."</string>
+    <string name="permdesc_accessFineLocation" product="tablet" msgid="243973693233359681">"Permite acceder a fuentes de ubicación precisas como, por ejemplo, el sistema de posicionamiento global, en el tablet, si hay alguna disponible. Las aplicaciones malintencionadas pueden utilizar este permiso para determinar la ubicación del usuario y pueden consumir batería adicional."</string>
     <string name="permdesc_accessFineLocation" product="default" msgid="7411213317434337331">"Permite precisar las fuentes de ubicación como, por ejemplo, el sistema de posicionamiento global, en el teléfono, en los casos en que estén disponibles. Las aplicaciones malintencionadas pueden utilizar este permiso para determinar dónde se encuentra el usuario y pueden consumir batería adicional."</string>
     <string name="permlab_accessCoarseLocation" msgid="4642255009181975828">"ubicación común (basada en red)"</string>
-    <string name="permdesc_accessCoarseLocation" product="tablet" msgid="3704633168985466045">"Permite acceder a fuentes de ubicación comunes como, por ejemplo, la base de datos de la red de telefonía móvil, para determinar la ubicación aproximada de una tableta, si hay alguna disponible. Las aplicaciones malintencionadas pueden utilizar este permiso para determinar tu ubicación aproximada."</string>
+    <string name="permdesc_accessCoarseLocation" product="tablet" msgid="3704633168985466045">"Permite acceder a fuentes de ubicación comunes como, por ejemplo, la base de datos de la red de telefonía móvil, para determinar la ubicación aproximada de un tablet, si hay alguna disponible. Las aplicaciones malintencionadas pueden utilizar este permiso para determinar tu ubicación aproximada."</string>
     <string name="permdesc_accessCoarseLocation" product="default" msgid="8235655958070862293">"Acceder a fuentes de ubicación comunes como, por ejemplo, la base de datos de red de un teléfono móvil, para determinar una ubicación telefónica aproximada, en los casos en que esté disponible. Las aplicaciones malintencionadas pueden utilizar este permiso para determinar dónde te encuentras aproximadamente."</string>
     <string name="permlab_accessSurfaceFlinger" msgid="2363969641792388947">"acceder a SurfaceFlinger"</string>
     <string name="permdesc_accessSurfaceFlinger" msgid="6805241830020733025">"Permite que la aplicación utilice funciones de SurfaceFlinger de nivel inferior."</string>
@@ -335,13 +335,13 @@
     <string name="permdesc_recordAudio" msgid="6493228261176552356">"Permite que la aplicación acceda a la ruta de grabación de audio."</string>
     <string name="permlab_camera" msgid="3616391919559751192">"realizar fotografías y vídeos"</string>
     <string name="permdesc_camera" msgid="6004878235852154239">"Permite que la aplicación realice fotografías y vídeos con la cámara. De este modo, puede recopilar en cualquier momento las imágenes que ve la cámara."</string>
-    <string name="permlab_brick" product="tablet" msgid="2961292205764488304">"inhabilitar tableta de forma permanente"</string>
+    <string name="permlab_brick" product="tablet" msgid="2961292205764488304">"inhabilitar tablet de forma permanente"</string>
     <string name="permlab_brick" product="default" msgid="8337817093326370537">"inhabilitar el teléfono de forma permanente"</string>
-    <string name="permdesc_brick" product="tablet" msgid="7379164636920817963">"Permite que la aplicación inhabilite todas las funciones de la tableta de forma permanente. Este permiso es muy peligroso."</string>
+    <string name="permdesc_brick" product="tablet" msgid="7379164636920817963">"Permite que la aplicación inhabilite todas las funciones del tablet de forma permanente. Este permiso es muy peligroso."</string>
     <string name="permdesc_brick" product="default" msgid="5569526552607599221">"Permite que la aplicación inhabilite todas las funciones del teléfono de forma permanente. Este permiso es muy peligroso."</string>
-    <string name="permlab_reboot" product="tablet" msgid="3436634972561795002">"forzar reinicio de la tableta"</string>
+    <string name="permlab_reboot" product="tablet" msgid="3436634972561795002">"forzar reinicio del tablet"</string>
     <string name="permlab_reboot" product="default" msgid="2898560872462638242">"forzar reinicio del teléfono"</string>
-    <string name="permdesc_reboot" product="tablet" msgid="4555793623560701557">"Permite que la aplicación fuerce a la tableta a reiniciarse."</string>
+    <string name="permdesc_reboot" product="tablet" msgid="4555793623560701557">"Permite que la aplicación fuerce al tablet a reiniciarse."</string>
     <string name="permdesc_reboot" product="default" msgid="7914933292815491782">"Permite que la aplicación fuerce al teléfono a reiniciarse."</string>
     <string name="permlab_mount_unmount_filesystems" msgid="1761023272170956541">"activar y desactivar sistemas de archivos"</string>
     <string name="permdesc_mount_unmount_filesystems" msgid="6253263792535859767">"Permite que las aplicaciones activen y desactiven sistemas de archivos para un almacenamiento extraíble."</string>
@@ -371,7 +371,7 @@
     <string name="permdesc_callPhone" msgid="3369867353692722456">"Permite que la aplicación llame a números de teléfono sin la intervención del usuario. Las aplicaciones malintencionadas pueden originar llamadas inesperadas en la factura telefónica. Ten en cuenta que con este permiso la aplicación no puede realizar llamadas a números de emergencia."</string>
     <string name="permlab_callPrivileged" msgid="4198349211108497879">"llamar directamente a cualquier número de teléfono"</string>
     <string name="permdesc_callPrivileged" msgid="244405067160028452">"Permite que la aplicación llame a cualquier número de teléfono, incluidos los números de emergencia, sin que el usuario intervenga. Las aplicaciones malintencionadas pueden realizar llamadas innecesarias e ilícitas a los servicios de emergencias."</string>
-    <string name="permlab_performCdmaProvisioning" product="tablet" msgid="4842576994144604821">"iniciar directamente el método de acceso CDMA de la tableta"</string>
+    <string name="permlab_performCdmaProvisioning" product="tablet" msgid="4842576994144604821">"iniciar directamente el método de acceso CDMA del tablet"</string>
     <string name="permlab_performCdmaProvisioning" product="default" msgid="5604848095315421425">"iniciar directamente el método de acceso CDMA del teléfono"</string>
     <string name="permdesc_performCdmaProvisioning" msgid="6457447676108355905">"Permite que la aplicación inicie el método de acceso CDMA. Las aplicaciones malintencionadas pueden iniciar el método CDMA de forma innecesaria."</string>
     <string name="permlab_locationUpdates" msgid="7785408253364335740">"controlar las notificaciones de actualización de la ubicación"</string>
@@ -384,16 +384,16 @@
     <string name="permdesc_modifyPhoneState" msgid="3302284561346956587">"Permite que la aplicación controle las funciones de teléfono del dispositivo. Una aplicación con este permiso puede cambiar redes, activar y desactivar la señal móvil, etc., sin necesidad de notificar al usuario."</string>
     <string name="permlab_readPhoneState" msgid="2326172951448691631">"leer la identidad y el estado del teléfono"</string>
     <string name="permdesc_readPhoneState" msgid="188877305147626781">"Permite que la aplicación acceda a las funciones de teléfono del dispositivo. Una aplicación con este permiso puede determinar el número de teléfono y el número de serie de este teléfono, si una llamada está activa, el número al que está vinculada esa llamada, etc."</string>
-    <string name="permlab_wakeLock" product="tablet" msgid="1531731435011495015">"impedir que la tableta entre en modo de suspensión"</string>
+    <string name="permlab_wakeLock" product="tablet" msgid="1531731435011495015">"impedir que el tablet entre en modo de suspensión"</string>
     <string name="permlab_wakeLock" product="default" msgid="573480187941496130">"impedir que el teléfono entre en modo de suspensión"</string>
-    <string name="permdesc_wakeLock" product="tablet" msgid="4032181488045338551">"Permite que una aplicación impida que la tableta entre en modo de suspensión."</string>
+    <string name="permdesc_wakeLock" product="tablet" msgid="4032181488045338551">"Permite que una aplicación impida que el tablet entre en modo de suspensión."</string>
     <string name="permdesc_wakeLock" product="default" msgid="7584036471227467099">"Permite que una aplicación impida que el teléfono entre en modo de suspensión."</string>
-    <string name="permlab_devicePower" product="tablet" msgid="2787034722616350417">"encender o apagar la tableta"</string>
+    <string name="permlab_devicePower" product="tablet" msgid="2787034722616350417">"encender o apagar el tablet"</string>
     <string name="permlab_devicePower" product="default" msgid="4928622470980943206">"encender o apagar el teléfono"</string>
-    <string name="permdesc_devicePower" product="tablet" msgid="3853773100100451905">"Permite que la aplicación active o desactive la tableta."</string>
+    <string name="permdesc_devicePower" product="tablet" msgid="3853773100100451905">"Permite que la aplicación active o desactive el tablet."</string>
     <string name="permdesc_devicePower" product="default" msgid="4577331933252444818">"Permite que la aplicación active o desactive el teléfono."</string>
     <string name="permlab_factoryTest" msgid="3715225492696416187">"ejecutar en modo de prueba de fábrica"</string>
-    <string name="permdesc_factoryTest" product="tablet" msgid="3952059318359653091">"Permite la ejecución como prueba de fabricante de nivel inferior, lo que posibilita un acceso completo al hardware de la tableta. Sólo está disponible cuando una tableta se está ejecutando en modo de prueba."</string>
+    <string name="permdesc_factoryTest" product="tablet" msgid="3952059318359653091">"Permite la ejecución como prueba de fabricante de nivel inferior, lo que posibilita un acceso completo al hardware del tablet. Solo está disponible cuando un tablet se está ejecutando en modo de prueba."</string>
     <string name="permdesc_factoryTest" product="default" msgid="8136644990319244802">"Ejecutar como prueba de fabricante de nivel inferior, permitiendo un acceso íntegro al hardware del teléfono. Sólo está disponible cuando un teléfono se está ejecutando en modo de prueba."</string>
     <string name="permlab_setWallpaper" msgid="6627192333373465143">"establecer fondo de pantalla"</string>
     <string name="permdesc_setWallpaper" msgid="6417041752170585837">"Permite que la aplicación establezca el fondo de pantalla del sistema."</string>
@@ -402,15 +402,15 @@
     <string name="permlab_masterClear" msgid="2315750423139697397">"restablecer el sistema a los valores predeterminados de fábrica"</string>
     <string name="permdesc_masterClear" msgid="5033465107545174514">"Permite que una aplicación restablezca por completo el sistema a su configuración de fábrica, borrando todos los datos, la configuración y las aplicaciones instaladas."</string>
     <string name="permlab_setTime" msgid="2021614829591775646">"establecer hora"</string>
-    <string name="permdesc_setTime" product="tablet" msgid="209693136361006073">"Permite que una aplicación cambie la hora del reloj de la tableta."</string>
+    <string name="permdesc_setTime" product="tablet" msgid="209693136361006073">"Permite que una aplicación cambie la hora del reloj del tablet."</string>
     <string name="permdesc_setTime" product="default" msgid="667294309287080045">"Permite que una aplicación cambie la hora del reloj del teléfono."</string>
     <string name="permlab_setTimeZone" msgid="2945079801013077340">"establecer zona horaria"</string>
-    <string name="permdesc_setTimeZone" product="tablet" msgid="2522877107613885139">"Permite que una aplicación cambie la zona horaria de la tableta."</string>
+    <string name="permdesc_setTimeZone" product="tablet" msgid="2522877107613885139">"Permite que una aplicación cambie la zona horaria del tablet."</string>
     <string name="permdesc_setTimeZone" product="default" msgid="1902540227418179364">"Permite que una aplicación cambie la zona horaria del teléfono."</string>
     <string name="permlab_accountManagerService" msgid="4829262349691386986">"actuar como servicio de administrador de cuentas"</string>
     <string name="permdesc_accountManagerService" msgid="6056903274106394752">"Permite que una aplicación realice llamadas a los autenticadores de cuentas."</string>
     <string name="permlab_getAccounts" msgid="4549918644233460103">"ver cuentas reconocidas"</string>
-    <string name="permdesc_getAccounts" product="tablet" msgid="857622793935544694">"Permite que una aplicación obtenga una lista de cuentas reconocidas por la tableta."</string>
+    <string name="permdesc_getAccounts" product="tablet" msgid="857622793935544694">"Permite que una aplicación obtenga una lista de cuentas reconocidas por el tablet."</string>
     <string name="permdesc_getAccounts" product="default" msgid="6839262446413155394">"Permite que una aplicación obtenga una lista de cuentas reconocidas por el teléfono."</string>
     <string name="permlab_authenticateAccounts" msgid="3940505577982882450">"actuar como autenticador de cuentas"</string>
     <string name="permdesc_authenticateAccounts" msgid="4006839406474208874">"Permite que una aplicación utilice las funciones de autenticador de cuentas del administrador de cuentas, incluida la creación de cuentas y la obtención y el establecimiento de sus contraseñas."</string>
@@ -437,10 +437,10 @@
     <string name="permlab_changeWifiMulticastState" msgid="1368253871483254784">"permitir recepción multidifusión Wi-Fi"</string>
     <string name="permdesc_changeWifiMulticastState" msgid="8199464507656067553">"Permite que una aplicación reciba paquetes no dirigidos directamente a tu dispositivo. Esta función puede resultar útil para descubrir servicios cercanos. Utiliza más energía que el modo de no multidifusión."</string>
     <string name="permlab_bluetoothAdmin" msgid="1092209628459341292">"administración de Bluetooth"</string>
-    <string name="permdesc_bluetoothAdmin" product="tablet" msgid="3511795757324345837">"Permite que una aplicación configure la tableta Bluetooth local, vea dispositivos remotos y sincronice el teléfono con ellos."</string>
+    <string name="permdesc_bluetoothAdmin" product="tablet" msgid="3511795757324345837">"Permite que una aplicación configure el tablet Bluetooth local, vea dispositivos remotos y sincronice el tablet con ellos."</string>
     <string name="permdesc_bluetoothAdmin" product="default" msgid="7256289774667054555">"Permite que una aplicación configure el teléfono Bluetooth local, y vea dispositivos remotos y sincronice el teléfono con ellos."</string>
     <string name="permlab_bluetooth" msgid="8361038707857018732">"crear conexiones de Bluetooth"</string>
-    <string name="permdesc_bluetooth" product="tablet" msgid="4191941825910543803">"Permite que una aplicación vea la configuración de la tableta Bluetooth local, y cree y acepte conexiones con los dispositivos sincronizados."</string>
+    <string name="permdesc_bluetooth" product="tablet" msgid="4191941825910543803">"Permite que una aplicación vea la configuración del tablet Bluetooth local, y cree y acepte conexiones con los dispositivos sincronizados."</string>
     <string name="permdesc_bluetooth" product="default" msgid="762515380679392945">"Permite que una aplicación vea la configuración del teléfono Bluetooth local, y cree y acepte conexiones con los dispositivos sincronizados."</string>
     <string name="permlab_nfc" msgid="4423351274757876953">"controlar Comunicación de campo cercano (NFC)"</string>
     <string name="permdesc_nfc" msgid="9171401851954407226">"Permite que la aplicación se comunique con lectores, tarjetas y etiquetas de Comunicación de campo cercano (NFC)."</string>
@@ -473,14 +473,14 @@
     <string name="policylab_limitPassword" msgid="4497420728857585791">"Establecimiento de reglas de contraseña"</string>
     <string name="policydesc_limitPassword" msgid="9083400080861728056">"Control de la longitud y de los caracteres permitidos en las contraseñas de bloqueo de pantalla"</string>
     <string name="policylab_watchLogin" msgid="914130646942199503">"Control de intentos de bloqueo de pantalla"</string>
-    <string name="policydesc_watchLogin" product="tablet" msgid="933601759466308092">"Controla el número de contraseñas incorrectas introducidas al desbloquear la pantalla, bloquea la tableta o borra todos los datos de la tableta si se introducen demasiadas contraseñas incorrectas."</string>
+    <string name="policydesc_watchLogin" product="tablet" msgid="933601759466308092">"Controla el número de contraseñas incorrectas introducidas al desbloquear la pantalla, bloquea el tablet o borra todos los datos del tablet si se introducen demasiadas contraseñas incorrectas."</string>
     <string name="policydesc_watchLogin" product="default" msgid="7227578260165172673">"Control del número de contraseñas incorrectas introducidas al desbloquear la pantalla, así como bloqueo del teléfono o borrado de todos los datos si se introducen demasiadas contraseñas incorrectas"</string>
     <string name="policylab_resetPassword" msgid="2620077191242688955">"Modificación de contraseña de bloqueo de pantalla"</string>
     <string name="policydesc_resetPassword" msgid="5391240616981297361">"Modificación de contraseña de bloqueo de pantalla"</string>
     <string name="policylab_forceLock" msgid="2274085384704248431">"Bloqueo de pantalla"</string>
     <string name="policydesc_forceLock" msgid="5696964126226028442">"Control de la forma en que se bloquea la pantalla y del momento en que se bloquea"</string>
     <string name="policylab_wipeData" msgid="3910545446758639713">"Borrar todos los datos"</string>
-    <string name="policydesc_wipeData" product="tablet" msgid="314455232799486222">"Borrado de los datos de la tableta sin avisar restableciendo datos de fábrica"</string>
+    <string name="policydesc_wipeData" product="tablet" msgid="314455232799486222">"Borrado de los datos del tablet sin avisar restableciendo datos de fábrica"</string>
     <string name="policydesc_wipeData" product="default" msgid="7669895333814222586">"Borrado de los datos del teléfono sin avisar restableciendo datos de fábrica"</string>
     <string name="policylab_setGlobalProxy" msgid="2784828293747791446">"Definir el servidor proxy global"</string>
     <string name="policydesc_setGlobalProxy" msgid="6387497466660154931">"Define el servidor proxy global que se debe utilizar mientras la política esté habilitada. Solo el primer administrador de dispositivos define el servidor proxy global efectivo."</string>
@@ -623,7 +623,7 @@
     <string name="lockscreen_battery_short" msgid="3617549178603354656">"<xliff:g id="NUMBER">%d</xliff:g> <xliff:g id="PERCENT">%%</xliff:g>"</string>
     <string name="lockscreen_low_battery" msgid="1482873981919249740">"Conecta el cargador"</string>
     <string name="lockscreen_missing_sim_message_short" msgid="7381499217732227295">"Falta la tarjeta SIM"</string>
-    <string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"No se ha insertado ninguna tarjeta SIM en la tableta."</string>
+    <string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"No se ha insertado ninguna tarjeta SIM en el tablet."</string>
     <string name="lockscreen_missing_sim_message" product="default" msgid="2186920585695169078">"No se ha insertado ninguna tarjeta SIM en el teléfono."</string>
     <string name="lockscreen_missing_sim_instructions" msgid="8874620818937719067">"Inserta una tarjeta SIM"</string>
     <string name="emergency_calls_only" msgid="6733978304386365407">"Solo llamadas de emergencia"</string>
@@ -635,7 +635,7 @@
     <string name="lockscreen_too_many_failed_attempts_dialog_message" msgid="3514742106066877476">"Has realizado <xliff:g id="NUMBER_0">%d</xliff:g> intentos fallidos de creación de un patrón de desbloqueo. "\n\n"Inténtalo de nuevo dentro de <xliff:g id="NUMBER_1">%d</xliff:g> segundos."</string>
     <string name="lockscreen_too_many_failed_password_attempts_dialog_message" msgid="4906034376425175381">"Has introducido una contraseña incorrecta <xliff:g id="NUMBER_0">%d</xliff:g> veces. "\n\n"Inténtalo de nuevo dentro de <xliff:g id="NUMBER_1">%d</xliff:g> segundos."</string>
     <string name="lockscreen_too_many_failed_pin_attempts_dialog_message" msgid="6827749231465145590">"Has introducido un PIN incorrecto <xliff:g id="NUMBER_0">%d</xliff:g> veces. "\n\n"Inténtalo de nuevo dentro de <xliff:g id="NUMBER_1">%d</xliff:g> segundos."</string>
-    <string name="lockscreen_failed_attempts_almost_glogin" product="tablet" msgid="8687762517114904651">"Has realizado <xliff:g id="NUMBER_0">%d</xliff:g> intentos fallidos de creación del patrón de desbloqueo. Si realizas <xliff:g id="NUMBER_1">%d</xliff:g> intentos fallidos más, se te pedirá que desbloquees la tableta con tus credenciales de acceso de Google."\n\n" Espera <xliff:g id="NUMBER_2">%d</xliff:g> segundos e inténtalo de nuevo."</string>
+    <string name="lockscreen_failed_attempts_almost_glogin" product="tablet" msgid="8687762517114904651">"Has realizado <xliff:g id="NUMBER_0">%d</xliff:g> intentos fallidos de creación del patrón de desbloqueo. Si realizas <xliff:g id="NUMBER_1">%d</xliff:g> intentos fallidos más, se te pedirá que desbloquees el tablet con tus credenciales de acceso de Google."\n\n" Espera <xliff:g id="NUMBER_2">%d</xliff:g> segundos e inténtalo de nuevo."</string>
     <string name="lockscreen_failed_attempts_almost_glogin" product="default" msgid="3351013842320127827">"Has realizado <xliff:g id="NUMBER_0">%d</xliff:g> intentos fallidos de creación del patrón de desbloqueo. Si realizas <xliff:g id="NUMBER_1">%d</xliff:g> intentos fallidos más, se te pedirá que desbloquees el teléfono con tus credenciales de acceso de Google."\n\n" Espera <xliff:g id="NUMBER_2">%d</xliff:g> segundos e inténtalo de nuevo."</string>
     <string name="lockscreen_too_many_failed_attempts_countdown" msgid="6251480343394389665">"Espera <xliff:g id="NUMBER">%d</xliff:g> segundos y vuelve a intentarlo."</string>
     <string name="lockscreen_forgot_pattern_button_text" msgid="2626999449610695930">"¿Has olvidado el patrón?"</string>
@@ -674,7 +674,7 @@
     <string name="permlab_readHistoryBookmarks" msgid="1284843728203412135">"leer información de marcadores y del historial del navegador"</string>
     <string name="permdesc_readHistoryBookmarks" msgid="4981489815467617191">"Permite que la aplicación lea todas las URL que ha visitado el navegador y todos sus marcadores."</string>
     <string name="permlab_writeHistoryBookmarks" msgid="9009434109836280374">"escribir en marcadores y en el historial del navegador"</string>
-    <string name="permdesc_writeHistoryBookmarks" product="tablet" msgid="7193514090469945307">"Permite que una aplicación modifique la información de los marcadores o del historial del navegador almacenada en la tableta. Las aplicaciones malintencionadas pueden utilizar este permiso para borrar o modificar los datos del navegador."</string>
+    <string name="permdesc_writeHistoryBookmarks" product="tablet" msgid="7193514090469945307">"Permite que una aplicación modifique la información de los marcadores o del historial del navegador almacenada en el tablet. Las aplicaciones malintencionadas pueden utilizar este permiso para borrar o modificar los datos del navegador."</string>
     <string name="permdesc_writeHistoryBookmarks" product="default" msgid="945571990357114950">"Permite que una aplicación modifique la información de los marcadores o del historial del navegador almacenada en el teléfono. Las aplicaciones malintencionadas pueden utilizar este permiso para borrar o modificar los datos del navegador."</string>
     <string name="permlab_setAlarm" msgid="5924401328803615165">"establecer alarma en un reloj"</string>
     <string name="permdesc_setAlarm" msgid="5966966598149875082">"Permite a la aplicación establecer una alarma en una aplicación de reloj instalada. Es posible que algunas aplicaciones de reloj no incluyan esta función."</string>
@@ -800,7 +800,7 @@
     <string name="inputMethod" msgid="1653630062304567879">"Método de introducción de texto"</string>
     <string name="editTextMenuTitle" msgid="4909135564941815494">"Acciones de texto"</string>
     <string name="low_internal_storage_view_title" msgid="1399732408701697546">"Poco espacio"</string>
-    <string name="low_internal_storage_view_text" product="tablet" msgid="4231085657068852042">"Se está agotando el espacio de almacenamiento de la tableta."</string>
+    <string name="low_internal_storage_view_text" product="tablet" msgid="4231085657068852042">"Se está agotando el espacio de almacenamiento del tablet."</string>
     <string name="low_internal_storage_view_text" product="default" msgid="635106544616378836">"Se está agotando el espacio de almacenamiento del teléfono."</string>
     <string name="ok" msgid="5970060430562524910">"Aceptar"</string>
     <string name="cancel" msgid="6442560571259935130">"Cancelar"</string>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index 5d897e3..eb14169 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -130,7 +130,7 @@
     <string name="me" msgid="6545696007631404292">"Saya"</string>
     <string name="power_dialog" product="tablet" msgid="8545351420865202853">"Opsi tablet"</string>
     <string name="power_dialog" product="default" msgid="1319919075463988638">"Opsi telepon"</string>
-    <string name="silent_mode" msgid="7167703389802618663">"Mode senyap"</string>
+    <string name="silent_mode" msgid="7167703389802618663">"Modus senyap"</string>
     <string name="turn_on_radio" msgid="3912793092339962371">"Hidupkan nirkabel"</string>
     <string name="turn_off_radio" msgid="8198784949987062346">"Matikan nirkabel"</string>
     <string name="screen_lock" msgid="799094655496098153">"Kunci layar"</string>
@@ -683,7 +683,7 @@
     <string name="save_password_message" msgid="767344687139195790">"Apakah Anda ingin peramban menyimpan sandi ini?"</string>
     <string name="save_password_notnow" msgid="6389675316706699758">"Tidak sekarang"</string>
     <string name="save_password_remember" msgid="6491879678996749466">"Ingat"</string>
-    <string name="save_password_never" msgid="8274330296785855105">"Tidak pernah"</string>
+    <string name="save_password_never" msgid="8274330296785855105">"Jangan"</string>
     <string name="open_permission_deny" msgid="5661861460947222274">"Anda tidak memiliki izin untuk membuka laman ini."</string>
     <string name="text_copied" msgid="4985729524670131385">"Teks disalin ke clipboard."</string>
     <string name="more_item_label" msgid="4650918923083320495">"Lainnya"</string>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index e9acf14..7aa7b30 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -489,7 +489,7 @@
     <string name="policylab_encryptedStorage" msgid="8901326199909132915">"הגדר הצפנת אחסון"</string>
     <string name="policydesc_encryptedStorage" msgid="2504984732631479399">"דורש שנתוני היישום המאוחסנים יהיו מוצפנים"</string>
   <string-array name="phoneTypes">
-    <item msgid="8901098336658710359">"דף הבית"</item>
+    <item msgid="8901098336658710359">"בית"</item>
     <item msgid="869923650527136615">"נייד"</item>
     <item msgid="7897544654242874543">"עבודה"</item>
     <item msgid="1103601433382158155">"פקס בעבודה"</item>
@@ -499,19 +499,19 @@
     <item msgid="9192514806975898961">"מותאם אישית"</item>
   </string-array>
   <string-array name="emailAddressTypes">
-    <item msgid="8073994352956129127">"דף הבית"</item>
+    <item msgid="8073994352956129127">"בית"</item>
     <item msgid="7084237356602625604">"עבודה"</item>
     <item msgid="1112044410659011023">"אחר"</item>
     <item msgid="2374913952870110618">"מותאם אישית"</item>
   </string-array>
   <string-array name="postalAddressTypes">
-    <item msgid="6880257626740047286">"דף הבית"</item>
+    <item msgid="6880257626740047286">"בית"</item>
     <item msgid="5629153956045109251">"עבודה"</item>
     <item msgid="4966604264500343469">"אחר"</item>
     <item msgid="4932682847595299369">"מותאם אישית"</item>
   </string-array>
   <string-array name="imAddressTypes">
-    <item msgid="1738585194601476694">"דף הבית"</item>
+    <item msgid="1738585194601476694">"בית"</item>
     <item msgid="1359644565647383708">"עבודה"</item>
     <item msgid="7868549401053615677">"אחר"</item>
     <item msgid="3145118944639869809">"מותאם אישית"</item>
@@ -532,7 +532,7 @@
     <item msgid="1648797903785279353">"Jabber"</item>
   </string-array>
     <string name="phoneTypeCustom" msgid="1644738059053355820">"מותאם אישית"</string>
-    <string name="phoneTypeHome" msgid="2570923463033985887">"דף הבית"</string>
+    <string name="phoneTypeHome" msgid="2570923463033985887">"בית"</string>
     <string name="phoneTypeMobile" msgid="6501463557754751037">"נייד"</string>
     <string name="phoneTypeWork" msgid="8863939667059911633">"עבודה"</string>
     <string name="phoneTypeFaxWork" msgid="3517792160008890912">"פקס בעבודה"</string>
@@ -557,16 +557,16 @@
     <string name="eventTypeAnniversary" msgid="3876779744518284000">"יום השנה"</string>
     <string name="eventTypeOther" msgid="7388178939010143077">"אחר"</string>
     <string name="emailTypeCustom" msgid="8525960257804213846">"מותאם אישית"</string>
-    <string name="emailTypeHome" msgid="449227236140433919">"דף הבית"</string>
+    <string name="emailTypeHome" msgid="449227236140433919">"בית"</string>
     <string name="emailTypeWork" msgid="3548058059601149973">"עבודה"</string>
     <string name="emailTypeOther" msgid="2923008695272639549">"אחר"</string>
     <string name="emailTypeMobile" msgid="119919005321166205">"סלולרי"</string>
     <string name="postalTypeCustom" msgid="8903206903060479902">"מותאם אישית"</string>
-    <string name="postalTypeHome" msgid="8165756977184483097">"דף הבית"</string>
+    <string name="postalTypeHome" msgid="8165756977184483097">"בית"</string>
     <string name="postalTypeWork" msgid="5268172772387694495">"עבודה"</string>
     <string name="postalTypeOther" msgid="2726111966623584341">"אחר"</string>
     <string name="imTypeCustom" msgid="2074028755527826046">"מותאם אישית"</string>
-    <string name="imTypeHome" msgid="6241181032954263892">"דף הבית"</string>
+    <string name="imTypeHome" msgid="6241181032954263892">"בית"</string>
     <string name="imTypeWork" msgid="1371489290242433090">"עבודה"</string>
     <string name="imTypeOther" msgid="5377007495735915478">"אחר"</string>
     <string name="imProtocolCustom" msgid="6919453836618749992">"מותאם אישית"</string>
@@ -598,7 +598,7 @@
     <string name="relationTypeSister" msgid="1735983554479076481">"אחות"</string>
     <string name="relationTypeSpouse" msgid="394136939428698117">"בן/בת זוג"</string>
     <string name="sipAddressTypeCustom" msgid="2473580593111590945">"מותאם אישית"</string>
-    <string name="sipAddressTypeHome" msgid="6093598181069359295">"דף הבית"</string>
+    <string name="sipAddressTypeHome" msgid="6093598181069359295">"בית"</string>
     <string name="sipAddressTypeWork" msgid="6920725730797099047">"עבודה"</string>
     <string name="sipAddressTypeOther" msgid="4408436162950119849">"אחר"</string>
     <string name="keyguard_password_enter_pin_code" msgid="3731488827218876115">"הזן קוד PIN"</string>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index aa43fe9..1c234c2 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -823,7 +823,7 @@
     <string name="anr_activity_process" msgid="5420826626009561014">"Aktiviteten <xliff:g id="ACTIVITY">%1$s</xliff:g> (i processen <xliff:g id="PROCESS">%2$s</xliff:g>) svarar inte."</string>
     <string name="anr_application_process" msgid="4185842666452210193">"Programmet <xliff:g id="APPLICATION">%1$s</xliff:g> (i processen <xliff:g id="PROCESS">%2$s</xliff:g>) svarar inte."</string>
     <string name="anr_process" msgid="1246866008169975783">"Processen <xliff:g id="PROCESS">%1$s</xliff:g> svarar inte."</string>
-    <string name="force_close" msgid="3653416315450806396">"Tvinga fram en stängning"</string>
+    <string name="force_close" msgid="3653416315450806396">"Tvinga stängning"</string>
     <string name="report" msgid="4060218260984795706">"Rapportera"</string>
     <string name="wait" msgid="7147118217226317732">"Vänta"</string>
     <string name="launch_warning_title" msgid="8323761616052121936">"Programmet omdirigerades"</string>
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
index 7756135..e138200 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ConnectivityManagerTestActivity.java
@@ -21,30 +21,34 @@
 import android.content.BroadcastReceiver;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+import android.net.NetworkInfo.State;
+import android.net.wifi.WifiConfiguration;
+import android.net.wifi.WifiManager;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.ScanResult;
+import android.net.wifi.WifiConfiguration.KeyMgmt;
 import android.os.Bundle;
+import android.os.Handler;
 import android.os.IPowerManager;
+import android.os.Message;
 import android.os.PowerManager;
 import android.os.ServiceManager;
 import android.os.SystemClock;
 import android.provider.Settings;
 import android.util.Log;
 import android.view.KeyEvent;
+import android.widget.LinearLayout;
+
+import com.android.internal.util.AsyncChannel;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.List;
-import android.widget.LinearLayout;
-import android.net.ConnectivityManager;
-import android.net.NetworkInfo;
-import android.net.NetworkInfo.State;
 
-import android.net.wifi.WifiConfiguration;
-import android.net.wifi.WifiManager;
-import android.net.wifi.WifiInfo;
-import android.net.wifi.ScanResult;
-import android.net.wifi.WifiConfiguration.KeyMgmt;
 
 /**
  * An activity registered with connectivity manager broadcast
@@ -180,6 +184,24 @@
         }
     }
 
+    private class WifiServiceHandler extends Handler {
+        @Override
+        public void handleMessage(Message msg) {
+            switch (msg.what) {
+                case AsyncChannel.CMD_CHANNEL_HALF_CONNECTED:
+                    if (msg.arg1 == AsyncChannel.STATUS_SUCCESSFUL) {
+                        //AsyncChannel in msg.obj
+                    } else {
+                        log("Failed to establish AsyncChannel connection");
+                    }
+                    break;
+                default:
+                    //Ignore
+                    break;
+            }
+        }
+    }
+
     public ConnectivityManagerTestActivity() {
         mState = State.UNKNOWN;
         scanResultAvailable = false;
@@ -216,6 +238,8 @@
         mCM = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
         // Get an instance of WifiManager
         mWifiManager =(WifiManager)getSystemService(Context.WIFI_SERVICE);
+        mWifiManager.asyncConnect(this, new WifiServiceHandler());
+
         initializeNetworkStates();
 
         if (mWifiManager.isWifiEnabled()) {
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/WifiConnectionTest.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/WifiConnectionTest.java
index 9c72102..fe79e6c 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/WifiConnectionTest.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/WifiConnectionTest.java
@@ -34,12 +34,15 @@
 import android.net.DhcpInfo;
 import android.net.NetworkInfo;
 import android.net.NetworkInfo.State;
+import android.os.Handler;
+import android.os.Message;
 import android.provider.Settings;
-
 import android.test.suitebuilder.annotation.LargeTest;
 import android.test.ActivityInstrumentationTestCase2;
 import android.util.Log;
 
+import com.android.internal.util.AsyncChannel;
+
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
@@ -75,6 +78,7 @@
         enabledNetworks = getEnabledNetworks(mWifiManager.getConfiguredNetworks());
 
         mAct = getActivity();
+        mWifiManager.asyncConnect(mAct, new WifiServiceHandler());
         networks = mAct.loadNetworkConfigurations();
         if (DEBUG) {
             printNetworkConfigurations();
@@ -89,6 +93,24 @@
         assertTrue("wpa_supplicant is not started ", mAct.mWifiManager.pingSupplicant());
     }
 
+    private class WifiServiceHandler extends Handler {
+        @Override
+        public void handleMessage(Message msg) {
+            switch (msg.what) {
+                case AsyncChannel.CMD_CHANNEL_HALF_CONNECTED:
+                    if (msg.arg1 == AsyncChannel.STATUS_SUCCESSFUL) {
+                        //AsyncChannel in msg.obj
+                    } else {
+                        log("Failed to establish AsyncChannel connection");
+                    }
+                    break;
+                default:
+                    //Ignore
+                    break;
+            }
+        }
+    }
+
     private void printNetworkConfigurations() {
         log("==== print network configurations parsed from XML file ====");
         log("number of access points: " + networks.size());
diff --git a/core/tests/coretests/AndroidManifest.xml b/core/tests/coretests/AndroidManifest.xml
index 01734f2..4be6995 100644
--- a/core/tests/coretests/AndroidManifest.xml
+++ b/core/tests/coretests/AndroidManifest.xml
@@ -44,6 +44,7 @@
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
     <uses-permission android:name="android.permission.BLUETOOTH" />
     <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
+    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
     <uses-permission android:name="android.permission.BROADCAST_STICKY" />
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
     <uses-permission android:name="android.permission.CLEAR_APP_CACHE" />
diff --git a/core/tests/coretests/src/android/bluetooth/BluetoothStressTest.java b/core/tests/coretests/src/android/bluetooth/BluetoothStressTest.java
index 672f252..5dedd4a 100644
--- a/core/tests/coretests/src/android/bluetooth/BluetoothStressTest.java
+++ b/core/tests/coretests/src/android/bluetooth/BluetoothStressTest.java
@@ -316,4 +316,34 @@
         mTestUtils.disablePan(adapter);
         mTestUtils.disable(adapter);
     }
+
+    /**
+     * Stress test for verifying that AudioManager can open and close SCO connections.
+     * <p>
+     * In this test, a HSP connection is opened with an external headset and the SCO connection is
+     * repeatibly opened and closed.
+     */
+    public void testStartStopSco() {
+        int iterations = BluetoothTestRunner.sStartStopScoIterations;
+        if (iterations == 0) {
+            return;
+        }
+
+        BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+        BluetoothDevice device = adapter.getRemoteDevice(BluetoothTestRunner.sHeadsetAddress);
+        mTestUtils.enable(adapter);
+        mTestUtils.pair(adapter, device, BluetoothTestRunner.sPairPasskey,
+                BluetoothTestRunner.sPairPin);
+        mTestUtils.connectProfile(adapter, device, BluetoothProfile.HEADSET);
+
+        for (int i = 0; i < iterations; i++) {
+            mTestUtils.writeOutput("startStopSco iteration " + (i + 1) + " of " + iterations);
+            mTestUtils.startSco(adapter, device);
+            mTestUtils.stopSco(adapter, device);
+        }
+
+        mTestUtils.disconnectProfile(adapter, device, BluetoothProfile.HEADSET);
+        mTestUtils.unpair(adapter, device);
+        mTestUtils.disable(adapter);
+    }
 }
diff --git a/core/tests/coretests/src/android/bluetooth/BluetoothTestRunner.java b/core/tests/coretests/src/android/bluetooth/BluetoothTestRunner.java
index cede05a..1febc5c 100644
--- a/core/tests/coretests/src/android/bluetooth/BluetoothTestRunner.java
+++ b/core/tests/coretests/src/android/bluetooth/BluetoothTestRunner.java
@@ -39,6 +39,7 @@
  *     [-e connect_headset_iterations <iterations>] \
  *     [-e connect_input_iterations <iterations>] \
  *     [-e connect_pan_iterations <iterations>] \
+ *     [-e start_stop_sco_iterations <iterations>] \
  *     [-e pair_address <address>] \
  *     [-e headset_address <address>] \
  *     [-e a2dp_address <address>] \
@@ -62,6 +63,7 @@
     public static int sConnectA2dpIterations = 100;
     public static int sConnectInputIterations = 100;
     public static int sConnectPanIterations = 100;
+    public static int sStartStopScoIterations = 100;
 
     public static String sPairAddress = "";
     public static String sHeadsetAddress = "";
@@ -167,6 +169,14 @@
             }
         }
 
+        val = arguments.getString("start_stop_sco_iterations");
+        if (val != null) {
+            try {
+                sStartStopScoIterations = Integer.parseInt(val);
+            } catch (NumberFormatException e) {
+                // Invalid argument, fall back to default value
+            }
+        }
         val = arguments.getString("pair_address");
         if (val != null) {
             sPairAddress = val;
@@ -214,6 +224,7 @@
         Log.i(TAG, String.format("connect_headset_iterations=%d", sConnectHeadsetIterations));
         Log.i(TAG, String.format("connect_input_iterations=%d", sConnectInputIterations));
         Log.i(TAG, String.format("connect_pan_iterations=%d", sConnectPanIterations));
+        Log.i(TAG, String.format("start_stop_sco_iterations=%d", sStartStopScoIterations));
         Log.i(TAG, String.format("pair_address=%s", sPairAddress));
         Log.i(TAG, String.format("a2dp_address=%s", sA2dpAddress));
         Log.i(TAG, String.format("headset_address=%s", sHeadsetAddress));
diff --git a/core/tests/coretests/src/android/bluetooth/BluetoothTestUtils.java b/core/tests/coretests/src/android/bluetooth/BluetoothTestUtils.java
index 85c5eaa..1741119 100644
--- a/core/tests/coretests/src/android/bluetooth/BluetoothTestUtils.java
+++ b/core/tests/coretests/src/android/bluetooth/BluetoothTestUtils.java
@@ -22,6 +22,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.media.AudioManager;
 import android.os.Environment;
 import android.util.Log;
 
@@ -67,6 +68,11 @@
     private static final int CONNECT_PROXY_TIMEOUT = 5000;
 
     /**
+     * Timeout to start or stop a SCO channel in ms.
+     */
+    private static final int START_STOP_SCO_TIMEOUT = 10000;
+
+    /**
      * Time between polls in ms.
      */
     private static final int POLL_TIME = 100;
@@ -319,6 +325,32 @@
         }
     }
 
+    private class StartStopScoReceiver extends FlagReceiver {
+        private static final int STATE_CONNECTED_FLAG = 1;
+        private static final int STATE_DISCONNECTED_FLAG = 1 << 1;
+
+        public StartStopScoReceiver(int expectedFlags) {
+            super(expectedFlags);
+        }
+
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            if (AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED.equals(intent.getAction())) {
+                int state = intent.getIntExtra(AudioManager.EXTRA_SCO_AUDIO_STATE,
+                        AudioManager.SCO_AUDIO_STATE_ERROR);
+                assertNotSame(AudioManager.SCO_AUDIO_STATE_ERROR, state);
+                switch(state) {
+                    case AudioManager.SCO_AUDIO_STATE_CONNECTED:
+                        setFiredFlag(STATE_CONNECTED_FLAG);
+                        break;
+                    case AudioManager.SCO_AUDIO_STATE_DISCONNECTED:
+                        setFiredFlag(STATE_DISCONNECTED_FLAG);
+                        break;
+                }
+            }
+        }
+    }
+
     private BluetoothProfile.ServiceListener mServiceListener =
             new BluetoothProfile.ServiceListener() {
         public void onServiceConnected(int profile, BluetoothProfile proxy) {
@@ -1269,6 +1301,103 @@
     }
 
     /**
+     * Opens a SCO channel using {@link android.media.AudioManager#startBluetoothSco()} and checks
+     * to make sure that the channel is opened and that the correct actions were broadcast.
+     *
+     * @param adapter The BT adapter.
+     * @param device The remote device.
+     */
+    public void startSco(BluetoothAdapter adapter, BluetoothDevice device) {
+        startStopSco(adapter, device, true);
+    }
+
+    /**
+     * Closes a SCO channel using {@link android.media.AudioManager#stopBluetoothSco()} and checks
+     *  to make sure that the channel is closed and that the correct actions were broadcast.
+     *
+     * @param adapter The BT adapter.
+     * @param device The remote device.
+     */
+    public void stopSco(BluetoothAdapter adapter, BluetoothDevice device) {
+        startStopSco(adapter, device, false);
+    }
+    /**
+     * Helper method for {@link #startSco(BluetoothAdapter, BluetoothDevice)} and
+     * {@link #stopSco(BluetoothAdapter, BluetoothDevice)}.
+     *
+     * @param adapter The BT adapter.
+     * @param device The remote device.
+     * @param isStart Whether the SCO channel should be opened.
+     */
+    private void startStopSco(BluetoothAdapter adapter, BluetoothDevice device, boolean isStart) {
+        long start = -1;
+        int mask;
+        String methodName;
+
+        if (isStart) {
+            methodName = "startSco()";
+            mask = StartStopScoReceiver.STATE_CONNECTED_FLAG;
+        } else {
+            methodName = "stopSco()";
+            mask = StartStopScoReceiver.STATE_DISCONNECTED_FLAG;
+        }
+
+        if (!adapter.isEnabled()) {
+            fail(String.format("%s bluetooth not enabled: device=%s, start=%b", methodName, device,
+                    isStart));
+        }
+
+        if (!adapter.getBondedDevices().contains(device)) {
+            fail(String.format("%s device not paired: device=%s, start=%b", methodName, device,
+                    isStart));
+        }
+
+        AudioManager manager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
+        assertNotNull(manager);
+
+        if (!manager.isBluetoothScoAvailableOffCall()) {
+            fail(String.format("%s device does not support SCO: device=%s, start=%b", methodName,
+                    device, isStart));
+        }
+
+        boolean isScoOn = manager.isBluetoothScoOn();
+        if (isStart == isScoOn) {
+            return;
+        }
+
+        StartStopScoReceiver receiver = getStartStopScoReceiver(mask);
+        start = System.currentTimeMillis();
+        if (isStart) {
+            manager.startBluetoothSco();
+        } else {
+            manager.stopBluetoothSco();
+        }
+
+        long s = System.currentTimeMillis();
+        while (System.currentTimeMillis() - s < START_STOP_SCO_TIMEOUT) {
+            isScoOn = manager.isBluetoothScoOn();
+            if ((isStart == isScoOn) &&
+                    (receiver.getFiredFlags() & mask) == mask) {
+                long finish = receiver.getCompletedTime();
+                if (start != -1 && finish != -1) {
+                    writeOutput(String.format("%s completed in %d ms", methodName,
+                            (finish - start)));
+                } else {
+                    writeOutput(String.format("%s completed", methodName));
+                }
+                removeReceiver(receiver);
+                return;
+            }
+            sleep(POLL_TIME);
+        }
+
+        int firedFlags = receiver.getFiredFlags();
+        removeReceiver(receiver);
+        fail(String.format("%s timeout: start=%b (expected %b), flags=0x%x (expected 0x%x)",
+                methodName, isScoOn, isStart, firedFlags, mask));
+    }
+
+    /**
      * Writes a string to the logcat and a file if a file has been specified in the constructor.
      *
      * @param s The string to be written.
@@ -1336,6 +1465,13 @@
         return receiver;
     }
 
+    private StartStopScoReceiver getStartStopScoReceiver(int expectedFlags) {
+        String[] actions = {AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED};
+        StartStopScoReceiver receiver = new StartStopScoReceiver(expectedFlags);
+        addReceiver(receiver, actions);
+        return receiver;
+    }
+
     private void removeReceiver(BroadcastReceiver receiver) {
         mContext.unregisterReceiver(receiver);
         mReceivers.remove(receiver);
diff --git a/include/media/IOMX.h b/include/media/IOMX.h
index cb36bbb..16a9342 100644
--- a/include/media/IOMX.h
+++ b/include/media/IOMX.h
@@ -85,6 +85,9 @@
     virtual status_t enableGraphicBuffers(
             node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0;
 
+    virtual status_t getGraphicBufferUsage(
+            node_id node, OMX_U32 port_index, OMX_U32* usage) = 0;
+
     virtual status_t useBuffer(
             node_id node, OMX_U32 port_index, const sp<IMemory> &params,
             buffer_id *buffer) = 0;
diff --git a/include/media/stagefright/HardwareAPI.h b/include/media/stagefright/HardwareAPI.h
index 17908b4..d1ecaaf 100644
--- a/include/media/stagefright/HardwareAPI.h
+++ b/include/media/stagefright/HardwareAPI.h
@@ -87,6 +87,18 @@
     const sp<android_native_buffer_t>& nativeBuffer;
 };
 
+// A pointer to this struct is passed to OMX_GetParameter when the extension
+// index for the 'OMX.google.android.index.getAndroidNativeBufferUsage'
+// extension is given.  The usage bits returned from this query will be used to
+// allocate the Gralloc buffers that get passed to the useAndroidNativeBuffer
+// command.
+struct GetAndroidNativeBufferUsageParams {
+    OMX_U32 nSize;              // IN
+    OMX_VERSIONTYPE nVersion;   // IN
+    OMX_U32 nPortIndex;         // IN
+    OMX_U32 nUsage;             // OUT
+};
+
 }  // namespace android
 
 extern android::OMXPluginBase *createOMXPlugin();
diff --git a/media/libmedia/IOMX.cpp b/media/libmedia/IOMX.cpp
index af67175..d6a1757 100644
--- a/media/libmedia/IOMX.cpp
+++ b/media/libmedia/IOMX.cpp
@@ -33,6 +33,7 @@
     EMPTY_BUFFER,
     GET_EXTENSION_INDEX,
     OBSERVER_ON_MSG,
+    GET_GRAPHIC_BUFFER_USAGE,
 };
 
 class BpOMX : public BpInterface<IOMX> {
@@ -194,6 +195,19 @@
         return err;
     }
 
+    virtual status_t getGraphicBufferUsage(
+            node_id node, OMX_U32 port_index, OMX_U32* usage) {
+        Parcel data, reply;
+        data.writeInterfaceToken(IOMX::getInterfaceDescriptor());
+        data.writeIntPtr((intptr_t)node);
+        data.writeInt32(port_index);
+        remote()->transact(GET_GRAPHIC_BUFFER_USAGE, data, &reply);
+
+        status_t err = reply.readInt32();
+        *usage = reply.readInt32();
+        return err;
+    }
+
     virtual status_t useBuffer(
             node_id node, OMX_U32 port_index, const sp<IMemory> &params,
             buffer_id *buffer) {
@@ -508,6 +522,21 @@
             return NO_ERROR;
         }
 
+        case GET_GRAPHIC_BUFFER_USAGE:
+        {
+            CHECK_INTERFACE(IOMX, data, reply);
+
+            node_id node = (void*)data.readIntPtr();
+            OMX_U32 port_index = data.readInt32();
+
+            OMX_U32 usage = 0;
+            status_t err = getGraphicBufferUsage(node, port_index, &usage);
+            reply->writeInt32(err);
+            reply->writeInt32(usage);
+
+            return NO_ERROR;
+        }
+
         case USE_BUFFER:
         {
             CHECK_INTERFACE(IOMX, data, reply);
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index b0ae3d8..e43cdaa 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -440,10 +440,17 @@
     }
 
     // Set up the native window.
-    // XXX TODO: Get the gralloc usage flags from the OMX plugin!
+    OMX_U32 usage = 0;
+    err = mOMX->getGraphicBufferUsage(mNode, kPortIndexOutput, &usage);
+    if (err != 0) {
+        LOGW("querying usage flags from OMX IL component failed: %d", err);
+        // XXX: Currently this error is logged, but not fatal.
+        usage = 0;
+    }
+
     err = native_window_set_usage(
             mNativeWindow.get(),
-            GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
+            usage | GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
 
     if (err != 0) {
         LOGE("native_window_set_usage failed: %s (%d)", strerror(-err), -err);
@@ -459,16 +466,12 @@
         return err;
     }
 
-    // XXX TODO: Do something so the ANativeWindow knows that we'll need to get
-    // the same set of buffers.
-
     LOGV("[%s] Allocating %lu buffers from a native window of size %lu on "
          "output port",
          mComponentName.c_str(), def.nBufferCountActual, def.nBufferSize);
 
     // Dequeue buffers and send them to OMX
-    OMX_U32 i;
-    for (i = 0; i < def.nBufferCountActual; i++) {
+    for (OMX_U32 i = 0; i < def.nBufferCountActual; i++) {
         android_native_buffer_t *buf;
         err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf);
         if (err != 0) {
@@ -477,23 +480,26 @@
         }
 
         sp<GraphicBuffer> graphicBuffer(new GraphicBuffer(buf, false));
-        IOMX::buffer_id bufferId;
-        err = mOMX->useGraphicBuffer(mNode, kPortIndexOutput, graphicBuffer,
-                &bufferId);
-        if (err != 0) {
-            break;
-        }
-
-        LOGV("[%s] Registered graphic buffer with ID %p (pointer = %p)",
-             mComponentName.c_str(),
-             bufferId, graphicBuffer.get());
-
         BufferInfo info;
-        info.mBufferID = bufferId;
         info.mStatus = BufferInfo::OWNED_BY_US;
         info.mData = new ABuffer(0);
         info.mGraphicBuffer = graphicBuffer;
         mBuffers[kPortIndexOutput].push(info);
+
+        IOMX::buffer_id bufferId;
+        err = mOMX->useGraphicBuffer(mNode, kPortIndexOutput, graphicBuffer,
+                &bufferId);
+        if (err != 0) {
+            LOGE("registering GraphicBuffer %lu with OMX IL component failed: "
+                 "%d", i, err);
+            break;
+        }
+
+        mBuffers[kPortIndexOutput].editItemAt(i).mBufferID = bufferId;
+
+        LOGV("[%s] Registered graphic buffer with ID %p (pointer = %p)",
+             mComponentName.c_str(),
+             bufferId, graphicBuffer.get());
     }
 
     OMX_U32 cancelStart;
@@ -503,7 +509,7 @@
         // If an error occurred while dequeuing we need to cancel any buffers
         // that were dequeued.
         cancelStart = 0;
-        cancelEnd = i;
+        cancelEnd = mBuffers[kPortIndexOutput].size();
     } else {
         // Return the last two buffers to the native window.
         // XXX TODO: The number of buffers the native window owns should
@@ -2286,4 +2292,3 @@
 }
 
 }  // namespace android
-
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 5d502e7..5f40893 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -1753,9 +1753,16 @@
     }
 
     // Set up the native window.
-    // XXX TODO: Get the gralloc usage flags from the OMX plugin!
+    OMX_U32 usage = 0;
+    err = mOMX->getGraphicBufferUsage(mNode, kPortIndexOutput, &usage);
+    if (err != 0) {
+        LOGW("querying usage flags from OMX IL component failed: %d", err);
+        // XXX: Currently this error is logged, but not fatal.
+        usage = 0;
+    }
+
     err = native_window_set_usage(
-            mNativeWindow.get(), GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
+            mNativeWindow.get(), usage | GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
     if (err != 0) {
         LOGE("native_window_set_usage failed: %s (%d)", strerror(-err), -err);
         return err;
@@ -1769,15 +1776,11 @@
         return err;
     }
 
-    // XXX TODO: Do something so the ANativeWindow knows that we'll need to get
-    // the same set of buffers.
-
     CODEC_LOGI("allocating %lu buffers from a native window of size %lu on "
             "output port", def.nBufferCountActual, def.nBufferSize);
 
     // Dequeue buffers and send them to OMX
-    OMX_U32 i;
-    for (i = 0; i < def.nBufferCountActual; i++) {
+    for (OMX_U32 i = 0; i < def.nBufferCountActual; i++) {
         android_native_buffer_t* buf;
         err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf);
         if (err != 0) {
@@ -1786,36 +1789,37 @@
         }
 
         sp<GraphicBuffer> graphicBuffer(new GraphicBuffer(buf, false));
-        IOMX::buffer_id bufferId;
-        err = mOMX->useGraphicBuffer(mNode, kPortIndexOutput, graphicBuffer,
-                &bufferId);
-        if (err != 0) {
-            break;
-        }
-
-        CODEC_LOGV("registered graphic buffer with ID %p (pointer = %p)",
-                bufferId, graphicBuffer.get());
-
         BufferInfo info;
         info.mData = NULL;
         info.mSize = def.nBufferSize;
-        info.mBuffer = bufferId;
         info.mStatus = OWNED_BY_US;
         info.mMem = NULL;
         info.mMediaBuffer = new MediaBuffer(graphicBuffer);
         info.mMediaBuffer->setObserver(this);
-
         mPortBuffers[kPortIndexOutput].push(info);
+
+        IOMX::buffer_id bufferId;
+        err = mOMX->useGraphicBuffer(mNode, kPortIndexOutput, graphicBuffer,
+                &bufferId);
+        if (err != 0) {
+            CODEC_LOGE("registering GraphicBuffer with OMX IL component "
+                    "failed: %d", err);
+            break;
+        }
+
+        mPortBuffers[kPortIndexOutput].editItemAt(i).mBuffer = bufferId;
+
+        CODEC_LOGV("registered graphic buffer with ID %p (pointer = %p)",
+                bufferId, graphicBuffer.get());
     }
 
     OMX_U32 cancelStart;
     OMX_U32 cancelEnd;
-
     if (err != 0) {
         // If an error occurred while dequeuing we need to cancel any buffers
         // that were dequeued.
         cancelStart = 0;
-        cancelEnd = i;
+        cancelEnd = mPortBuffers[kPortIndexOutput].size();
     } else {
         // Return the last two buffers to the native window.
         // XXX TODO: The number of buffers the native window owns should probably be
diff --git a/media/libstagefright/include/OMX.h b/media/libstagefright/include/OMX.h
index 5fed98a..ec3e5fa 100644
--- a/media/libstagefright/include/OMX.h
+++ b/media/libstagefright/include/OMX.h
@@ -62,6 +62,9 @@
     virtual status_t enableGraphicBuffers(
             node_id node, OMX_U32 port_index, OMX_BOOL enable);
 
+    virtual status_t getGraphicBufferUsage(
+            node_id node, OMX_U32 port_index, OMX_U32* usage);
+
     virtual status_t storeMetaDataInBuffers(
             node_id node, OMX_U32 port_index, OMX_BOOL enable);
 
diff --git a/media/libstagefright/include/OMXNodeInstance.h b/media/libstagefright/include/OMXNodeInstance.h
index 86c102c..ca2578f 100644
--- a/media/libstagefright/include/OMXNodeInstance.h
+++ b/media/libstagefright/include/OMXNodeInstance.h
@@ -50,6 +50,9 @@
     status_t setConfig(OMX_INDEXTYPE index, const void *params, size_t size);
 
     status_t enableGraphicBuffers(OMX_U32 portIndex, OMX_BOOL enable);
+
+    status_t getGraphicBufferUsage(OMX_U32 portIndex, OMX_U32* usage);
+
     status_t storeMetaDataInBuffers(OMX_U32 portIndex, OMX_BOOL enable);
 
     status_t useBuffer(
diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp
index 3638f41..4b1c3a7 100644
--- a/media/libstagefright/omx/OMX.cpp
+++ b/media/libstagefright/omx/OMX.cpp
@@ -297,6 +297,11 @@
     return findInstance(node)->enableGraphicBuffers(port_index, enable);
 }
 
+status_t OMX::getGraphicBufferUsage(
+        node_id node, OMX_U32 port_index, OMX_U32* usage) {
+    return findInstance(node)->getGraphicBufferUsage(port_index, usage);
+}
+
 status_t OMX::storeMetaDataInBuffers(
         node_id node, OMX_U32 port_index, OMX_BOOL enable) {
     return findInstance(node)->storeMetaDataInBuffers(port_index, enable);
diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp
index c7c1409..6cbd599 100644
--- a/media/libstagefright/omx/OMXNodeInstance.cpp
+++ b/media/libstagefright/omx/OMXNodeInstance.cpp
@@ -302,6 +302,45 @@
     return OK;
 }
 
+status_t OMXNodeInstance::getGraphicBufferUsage(
+        OMX_U32 portIndex, OMX_U32* usage) {
+    Mutex::Autolock autoLock(mLock);
+
+    OMX_INDEXTYPE index;
+    OMX_ERRORTYPE err = OMX_GetExtensionIndex(
+            mHandle,
+            const_cast<OMX_STRING>(
+                    "OMX.google.android.index.getAndroidNativeBufferUsage"),
+            &index);
+
+    if (err != OMX_ErrorNone) {
+        LOGE("OMX_GetExtensionIndex failed");
+
+        return StatusFromOMXError(err);
+    }
+
+    OMX_VERSIONTYPE ver;
+    ver.s.nVersionMajor = 1;
+    ver.s.nVersionMinor = 0;
+    ver.s.nRevision = 0;
+    ver.s.nStep = 0;
+    GetAndroidNativeBufferUsageParams params = {
+        sizeof(GetAndroidNativeBufferUsageParams), ver, portIndex, 0,
+    };
+
+    err = OMX_GetParameter(mHandle, index, &params);
+
+    if (err != OMX_ErrorNone) {
+        LOGE("OMX_GetAndroidNativeBufferUsage failed with error %d (0x%08x)",
+                err, err);
+        return UNKNOWN_ERROR;
+    }
+
+    *usage = params.nUsage;
+
+    return OK;
+}
+
 status_t OMXNodeInstance::storeMetaDataInBuffers(
         OMX_U32 portIndex,
         OMX_BOOL enable) {
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 704da72..a07ebfc 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1629,6 +1629,7 @@
                     track->mState = TrackBase::ACTIVE;
                     param = AudioMixer::RAMP_VOLUME;
                 }
+                mAudioMixer->setParameter(AudioMixer::RESAMPLE, AudioMixer::RESET, NULL);
             } else if (cblk->server != 0) {
                 // If the track is stopped before the first frame was mixed,
                 // do not apply ramp
@@ -3855,9 +3856,12 @@
             mActiveTrack.clear();
             return status;
         }
-        mActiveTrack->mState = TrackBase::RESUMING;
         mRsmpInIndex = mFrameCount;
         mBytesRead = 0;
+        if (mResampler != NULL) {
+            mResampler->reset();
+        }
+        mActiveTrack->mState = TrackBase::RESUMING;
         // signal thread to start
         LOGV("Signal record thread");
         mWaitWorkCV.signal();
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index 433f1f7..50dcda7 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -220,6 +220,12 @@
                 return NO_ERROR;
             }
         }
+        if (name == RESET) {
+            track_t& track = mState.tracks[ mActiveTrack ];
+            track.resetResampler();
+            invalidateState(1<<mActiveTrack);
+            return NO_ERROR;
+        }
         break;
     case RAMP_VOLUME:
     case VOLUME:
@@ -289,6 +295,13 @@
     return resampler != 0;
 }
 
+void AudioMixer::track_t::resetResampler()
+{
+    if (resampler != 0) {
+        resampler->reset();
+    }
+}
+
 inline
 void AudioMixer::track_t::adjustVolumeRamp(bool aux)
 {
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h
index aee3e17..88408a7 100644
--- a/services/audioflinger/AudioMixer.h
+++ b/services/audioflinger/AudioMixer.h
@@ -67,6 +67,7 @@
         AUX_BUFFER      = 0x4003,
         // for TARGET RESAMPLE
         SAMPLE_RATE     = 0x4100,
+        RESET           = 0x4101,
         // for TARGET VOLUME (8 channels max)
         VOLUME0         = 0x4200,
         VOLUME1         = 0x4201,
@@ -163,6 +164,7 @@
 
         bool        setResampler(uint32_t sampleRate, uint32_t devSampleRate);
         bool        doesResample() const;
+        void        resetResampler();
         void        adjustVolumeRamp(bool aux);
     };
 
diff --git a/services/audioflinger/AudioResampler.cpp b/services/audioflinger/AudioResampler.cpp
index 5dabacb..5c3b43fc 100644
--- a/services/audioflinger/AudioResampler.cpp
+++ b/services/audioflinger/AudioResampler.cpp
@@ -148,6 +148,12 @@
     mVolume[1] = right;
 }
 
+void AudioResampler::reset() {
+    mInputIndex = 0;
+    mPhaseFraction = 0;
+    mBuffer.frameCount = 0;
+}
+
 // ----------------------------------------------------------------------------
 
 void AudioResamplerOrder1::resample(int32_t* out, size_t outFrameCount,
diff --git a/services/audioflinger/AudioResampler.h b/services/audioflinger/AudioResampler.h
index 2dfac76..9f06c1c 100644
--- a/services/audioflinger/AudioResampler.h
+++ b/services/audioflinger/AudioResampler.h
@@ -53,6 +53,8 @@
     virtual void resample(int32_t* out, size_t outFrameCount,
             AudioBufferProvider* provider) = 0;
 
+    virtual void reset();
+
 protected:
     // number of bits for phase fraction - 30 bits allows nearly 2x downsampling
     static const int kNumPhaseBits = 30;
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java
index f9b94a3..adc49ae 100644
--- a/services/java/com/android/server/WifiService.java
+++ b/services/java/com/android/server/WifiService.java
@@ -144,9 +144,6 @@
     private static final String ACTION_DEVICE_IDLE =
             "com.android.server.WifiManager.action.DEVICE_IDLE";
 
-    private static final int CMD_ENABLE_TRAFFIC_STATS_POLL = 1;
-    private static final int CMD_TRAFFIC_STATS_POLL        = 2;
-
     private boolean mIsReceiverRegistered = false;
 
 
@@ -237,24 +234,45 @@
                     ac.connect(mContext, this, msg.replyTo);
                     break;
                 }
-                case CMD_ENABLE_TRAFFIC_STATS_POLL: {
+                case WifiManager.CMD_ENABLE_TRAFFIC_STATS_POLL: {
                     mEnableTrafficStatsPoll = (msg.arg1 == 1);
                     mTrafficStatsPollToken++;
                     if (mEnableTrafficStatsPoll) {
                         notifyOnDataActivity();
-                        sendMessageDelayed(Message.obtain(this, CMD_TRAFFIC_STATS_POLL,
+                        sendMessageDelayed(Message.obtain(this, WifiManager.CMD_TRAFFIC_STATS_POLL,
                                 mTrafficStatsPollToken, 0), POLL_TRAFFIC_STATS_INTERVAL_MSECS);
                     }
                     break;
                 }
-                case CMD_TRAFFIC_STATS_POLL: {
+                case WifiManager.CMD_TRAFFIC_STATS_POLL: {
                     if (msg.arg1 == mTrafficStatsPollToken) {
                         notifyOnDataActivity();
-                        sendMessageDelayed(Message.obtain(this, CMD_TRAFFIC_STATS_POLL,
+                        sendMessageDelayed(Message.obtain(this, WifiManager.CMD_TRAFFIC_STATS_POLL,
                                 mTrafficStatsPollToken, 0), POLL_TRAFFIC_STATS_INTERVAL_MSECS);
                     }
                     break;
                 }
+                case WifiManager.CMD_CONNECT_NETWORK: {
+                    if (msg.obj != null) {
+                        mWifiStateMachine.connectNetwork((WifiConfiguration)msg.obj);
+                    } else {
+                        mWifiStateMachine.connectNetwork(msg.arg1);
+                    }
+                    break;
+                }
+                case WifiManager.CMD_SAVE_NETWORK: {
+                    mWifiStateMachine.saveNetwork((WifiConfiguration)msg.obj);
+                    break;
+                }
+                case WifiManager.CMD_FORGET_NETWORK: {
+                    mWifiStateMachine.forgetNetwork(msg.arg1);
+                    break;
+                }
+                case WifiManager.CMD_START_WPS: {
+                    //replyTo has the original source
+                    mWifiStateMachine.startWps(msg.replyTo, (WpsConfiguration)msg.obj);
+                    break;
+                }
                 default: {
                     Slog.d(TAG, "WifiServicehandler.handleMessage ignoring msg=" + msg);
                     break;
@@ -844,42 +862,19 @@
         mWifiStateMachine.clearBlacklist();
     }
 
-    public void connectNetworkWithId(int networkId) {
-        enforceChangePermission();
-        mWifiStateMachine.connectNetwork(networkId);
-    }
 
-    public void connectNetworkWithConfig(WifiConfiguration config) {
-        enforceChangePermission();
-        mWifiStateMachine.connectNetwork(config);
-    }
-
-    public void saveNetwork(WifiConfiguration config) {
-        enforceChangePermission();
-        mWifiStateMachine.saveNetwork(config);
-    }
-
-    public void forgetNetwork(int netId) {
-        enforceChangePermission();
-        mWifiStateMachine.forgetNetwork(netId);
-    }
-
-    public WpsResult startWps(WpsConfiguration config) {
-        enforceChangePermission();
-        if (mWifiStateMachineChannel != null) {
-            return mWifiStateMachine.startWps(mWifiStateMachineChannel, config);
-        } else {
-            Slog.e(TAG, "mWifiStateMachineChannel is not initialized");
-            return new WpsResult(WpsResult.Status.FAILURE);
-        }
-    }
 
     /**
      * Get a reference to handler. This is used by a client to establish
      * an AsyncChannel communication with WifiService
      */
     public Messenger getMessenger() {
+        /* Enforce the highest permissions
+           TODO: when we consider exposing the asynchronous API, think about
+                 how to provide both access and change permissions seperately
+         */
         enforceAccessPermission();
+        enforceChangePermission();
         return new Messenger(mAsyncServiceHandler);
     }
 
@@ -1530,9 +1525,11 @@
     private void evaluateTrafficStatsPolling() {
         Message msg;
         if (mNetworkInfo.getDetailedState() == DetailedState.CONNECTED && !mScreenOff) {
-            msg = Message.obtain(mAsyncServiceHandler, CMD_ENABLE_TRAFFIC_STATS_POLL, 1, 0);
+            msg = Message.obtain(mAsyncServiceHandler,
+                    WifiManager.CMD_ENABLE_TRAFFIC_STATS_POLL, 1, 0);
         } else {
-            msg = Message.obtain(mAsyncServiceHandler, CMD_ENABLE_TRAFFIC_STATS_POLL, 0, 0);
+            msg = Message.obtain(mAsyncServiceHandler,
+                    WifiManager.CMD_ENABLE_TRAFFIC_STATS_POLL, 0, 0);
         }
         msg.sendToTarget();
     }
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index 7a9276d..1d115b1 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -103,16 +103,6 @@
 
     void clearBlacklist();
 
-    void connectNetworkWithConfig(in WifiConfiguration wifiConfig);
-
-    void connectNetworkWithId(int networkId);
-
-    void saveNetwork(in WifiConfiguration wifiConfig);
-
-    void forgetNetwork(int networkId);
-
-    WpsResult startWps(in WpsConfiguration config);
-
     Messenger getMessenger();
 }
 
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index 0807a24..5238899 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -18,6 +18,7 @@
 
 import android.annotation.SdkConstant;
 import android.annotation.SdkConstant.SdkConstantType;
+import android.content.Context;
 import android.net.DhcpInfo;
 import android.os.Binder;
 import android.os.IBinder;
@@ -26,6 +27,8 @@
 import android.os.WorkSource;
 import android.os.Messenger;
 
+import com.android.internal.util.AsyncChannel;
+
 import java.util.List;
 
 /**
@@ -447,6 +450,9 @@
     /* Number of currently active WifiLocks and MulticastLocks */
     private int mActiveLockCount;
 
+    /* For communication with WifiService */
+    private AsyncChannel mAsyncChannel = new AsyncChannel();
+
     /**
      * Create a new WifiManager instance.
      * Applications will almost always want to use
@@ -1032,6 +1038,37 @@
     }
 
     /* TODO: deprecate synchronous API and open up the following API */
+
+    /* Commands to WifiService */
+    /** @hide */
+    public static final int CMD_CONNECT_NETWORK             = 1;
+    /** @hide */
+    public static final int CMD_FORGET_NETWORK              = 2;
+    /** @hide */
+    public static final int CMD_SAVE_NETWORK                = 3;
+    /** @hide */
+    public static final int CMD_START_WPS                   = 4;
+
+    /* Events from WifiService */
+    /** @hide */
+    public static final int CMD_WPS_COMPLETED               = 11;
+
+    /* For system use only */
+    /** @hide */
+    public static final int CMD_ENABLE_TRAFFIC_STATS_POLL   = 21;
+    /** @hide */
+    public static final int CMD_TRAFFIC_STATS_POLL          = 22;
+
+    /**
+     * Initiate an asynchronous channel connection setup
+     * @param srcContext is the context of the source
+     * @param srcHandler is the handler on which the source receives messages
+     * @hide
+     */
+     public void asyncConnect(Context srcContext, Handler srcHandler) {
+        mAsyncChannel.connect(srcContext, srcHandler, getMessenger());
+     }
+
     /**
      * Connect to a network with the given configuration. The network also
      * gets added to the supplicant configuration.
@@ -1048,9 +1085,7 @@
         if (config == null) {
             return;
         }
-        try {
-            mService.connectNetworkWithConfig(config);
-        } catch (RemoteException e) { }
+        mAsyncChannel.sendMessage(CMD_CONNECT_NETWORK, config);
     }
 
     /**
@@ -1067,9 +1102,7 @@
         if (networkId < 0) {
             return;
         }
-        try {
-            mService.connectNetworkWithId(networkId);
-        } catch (RemoteException e) { }
+        mAsyncChannel.sendMessage(CMD_CONNECT_NETWORK, networkId);
     }
 
     /**
@@ -1091,9 +1124,8 @@
         if (config == null) {
             return;
         }
-        try {
-            mService.saveNetwork(config);
-        } catch (RemoteException e) { }
+
+        mAsyncChannel.sendMessage(CMD_SAVE_NETWORK, config);
     }
 
     /**
@@ -1110,25 +1142,22 @@
         if (netId < 0) {
             return;
         }
-        try {
-            mService.forgetNetwork(netId);
-        } catch (RemoteException e) { }
+
+        mAsyncChannel.sendMessage(CMD_FORGET_NETWORK, netId);
     }
 
     /**
      * Start Wi-fi Protected Setup
      *
      * @param config WPS configuration
-     * @return WpsResult containing pin and status
      * @hide
-     * TODO: with use of AsyncChannel, return value should go away
      */
-    public WpsResult startWps(WpsConfiguration config) {
-        try {
-            return mService.startWps(config);
-        } catch (RemoteException e) {
-            return new WpsResult(WpsResult.Status.FAILURE);
+    public void startWps(WpsConfiguration config) {
+        if (config == null) {
+            return;
         }
+
+        mAsyncChannel.sendMessage(CMD_START_WPS, config);
     }
 
     /**
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java
index f9d2772..d6f8e51 100644
--- a/wifi/java/android/net/wifi/WifiStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiStateMachine.java
@@ -59,6 +59,7 @@
 import android.os.IBinder;
 import android.os.INetworkManagementService;
 import android.os.Message;
+import android.os.Messenger;
 import android.os.PowerManager;
 import android.os.Process;
 import android.os.RemoteException;
@@ -805,22 +806,10 @@
         sendMessage(obtainMessage(CMD_FORGET_NETWORK, netId, 0));
     }
 
-    public WpsResult startWps(AsyncChannel channel, WpsConfiguration config) {
-        WpsResult result;
-        switch (config.setup) {
-            case PIN_FROM_DEVICE:
-            case PBC:
-            case PIN_FROM_ACCESS_POINT:
-                //TODO: will go away with AsyncChannel use from settings
-                Message resultMsg = channel.sendMessageSynchronously(CMD_START_WPS, config);
-                result = (WpsResult) resultMsg.obj;
-                resultMsg.recycle();
-                break;
-            default:
-                result = new WpsResult(Status.FAILURE);
-                break;
-        }
-        return result;
+    public void startWps(Messenger replyTo, WpsConfiguration config) {
+        Message msg = obtainMessage(CMD_START_WPS, config);
+        msg.replyTo = replyTo;
+        sendMessage(msg);
     }
 
     public void enableRssiPolling(boolean enabled) {
@@ -1588,7 +1577,7 @@
                     break;
                 case CMD_START_WPS:
                     /* Return failure when the state machine cannot handle WPS initiation*/
-                    mReplyChannel.replyToMessage(message, message.what,
+                    mReplyChannel.replyToMessage(message, WifiManager.CMD_WPS_COMPLETED,
                                 new WpsResult(Status.FAILURE));
                     break;
                 default:
diff --git a/wifi/java/android/net/wifi/WpsStateMachine.java b/wifi/java/android/net/wifi/WpsStateMachine.java
index 92f9f57..32d77a1 100644
--- a/wifi/java/android/net/wifi/WpsStateMachine.java
+++ b/wifi/java/android/net/wifi/WpsStateMachine.java
@@ -110,7 +110,7 @@
                             Log.e(TAG, "Invalid setup for WPS");
                             break;
                     }
-                    mReplyChannel.replyToMessage(message, message.what, result);
+                    mReplyChannel.replyToMessage(message, WifiManager.CMD_WPS_COMPLETED, result);
                     if (result.status == Status.SUCCESS) {
                         transitionTo(mActiveState);
                     } else {
@@ -172,7 +172,7 @@
                     break;
                 case WifiStateMachine.CMD_START_WPS:
                     /* Ignore request and send an in progress message */
-                    mReplyChannel.replyToMessage(message, message.what,
+                    mReplyChannel.replyToMessage(message, WifiManager.CMD_WPS_COMPLETED,
                                 new WpsResult(Status.IN_PROGRESS));
                     break;
                 default: