Merge "Dynamically togglable accessibility features improperly handled." into jb-mr2-dev
diff --git a/core/java/android/hardware/location/GeofenceHardwareImpl.java b/core/java/android/hardware/location/GeofenceHardwareImpl.java
index e3362a7..9823c49 100644
--- a/core/java/android/hardware/location/GeofenceHardwareImpl.java
+++ b/core/java/android/hardware/location/GeofenceHardwareImpl.java
@@ -470,11 +470,12 @@
                     synchronized (mGeofences) {
                         callback = mGeofences.get(geofenceId);
                     }
-                    if (callback == null) return;
 
-                    try {
-                        callback.onGeofenceAdd(geofenceId, msg.arg2);
-                    } catch (RemoteException e) {Log.i(TAG, "Remote Exception:" + e);}
+                    if (callback != null) {
+                        try {
+                            callback.onGeofenceAdd(geofenceId, msg.arg2);
+                        } catch (RemoteException e) {Log.i(TAG, "Remote Exception:" + e);}
+                    }
                     releaseWakeLock();
                     break;
                 case REMOVE_GEOFENCE_CALLBACK:
@@ -482,13 +483,14 @@
                     synchronized (mGeofences) {
                         callback = mGeofences.get(geofenceId);
                     }
-                    if (callback == null) return;
 
-                    try {
-                        callback.onGeofenceRemove(geofenceId, msg.arg2);
-                    } catch (RemoteException e) {}
-                    synchronized (mGeofences) {
-                        mGeofences.remove(geofenceId);
+                    if (callback != null) {
+                        try {
+                            callback.onGeofenceRemove(geofenceId, msg.arg2);
+                        } catch (RemoteException e) {}
+                        synchronized (mGeofences) {
+                            mGeofences.remove(geofenceId);
+                        }
                     }
                     releaseWakeLock();
                     break;
@@ -498,11 +500,12 @@
                     synchronized (mGeofences) {
                         callback = mGeofences.get(geofenceId);
                     }
-                    if (callback == null) return;
 
-                    try {
-                        callback.onGeofencePause(geofenceId, msg.arg2);
-                    } catch (RemoteException e) {}
+                    if (callback != null) {
+                        try {
+                            callback.onGeofencePause(geofenceId, msg.arg2);
+                        } catch (RemoteException e) {}
+                    }
                     releaseWakeLock();
                     break;
 
@@ -511,11 +514,12 @@
                     synchronized (mGeofences) {
                         callback = mGeofences.get(geofenceId);
                     }
-                    if (callback == null) return;
 
-                    try {
-                        callback.onGeofenceResume(geofenceId, msg.arg2);
-                    } catch (RemoteException e) {}
+                    if (callback != null) {
+                        try {
+                            callback.onGeofenceResume(geofenceId, msg.arg2);
+                        } catch (RemoteException e) {}
+                    }
                     releaseWakeLock();
                     break;
 
@@ -530,12 +534,14 @@
                             " Transition: " + geofenceTransition.mTransition +
                             " Location: " + geofenceTransition.mLocation + ":" + mGeofences);
 
-                    try {
-                        callback.onGeofenceTransition(
-                                geofenceTransition.mGeofenceId, geofenceTransition.mTransition,
-                                geofenceTransition.mLocation, geofenceTransition.mTimestamp,
-                                GeofenceHardware.MONITORING_TYPE_GPS_HARDWARE);
-                    } catch (RemoteException e) {}
+                    if (callback != null) {
+                        try {
+                            callback.onGeofenceTransition(
+                                    geofenceTransition.mGeofenceId, geofenceTransition.mTransition,
+                                    geofenceTransition.mLocation, geofenceTransition.mTimestamp,
+                                    GeofenceHardware.MONITORING_TYPE_GPS_HARDWARE);
+                        } catch (RemoteException e) {}
+                    }
                     releaseWakeLock();
                     break;
                 case GEOFENCE_CALLBACK_BINDER_DIED:
@@ -572,16 +578,16 @@
                     available = (val == GeofenceHardware.MONITOR_CURRENTLY_AVAILABLE ?
                             true : false);
                     callbackList = mCallbacks[GeofenceHardware.MONITORING_TYPE_GPS_HARDWARE];
-                    if (callbackList == null) return;
+                    if (callbackList != null) {
+                        if (DEBUG) Log.d(TAG, "MonitoringSystemChangeCallback: GPS : " + available);
 
-                    if (DEBUG) Log.d(TAG, "MonitoringSystemChangeCallback: GPS : " + available);
-
-                    for (IGeofenceHardwareMonitorCallback c: callbackList) {
-                        try {
-                            c.onMonitoringSystemChange(
-                                    GeofenceHardware.MONITORING_TYPE_GPS_HARDWARE, available,
-                                    location);
-                        } catch (RemoteException e) {}
+                        for (IGeofenceHardwareMonitorCallback c: callbackList) {
+                            try {
+                                c.onMonitoringSystemChange(
+                                        GeofenceHardware.MONITORING_TYPE_GPS_HARDWARE, available,
+                                        location);
+                            } catch (RemoteException e) {}
+                        }
                     }
                     releaseWakeLock();
                     break;
diff --git a/core/java/android/os/Trace.java b/core/java/android/os/Trace.java
index 3307a8c..e53cb5e 100644
--- a/core/java/android/os/Trace.java
+++ b/core/java/android/os/Trace.java
@@ -65,6 +65,8 @@
     public static final long TRACE_TAG_APP = 1L << 12;
     /** @hide */
     public static final long TRACE_TAG_RESOURCES = 1L << 13;
+    /** @hide */
+    public static final long TRACE_TAG_DALVIK = 1L << 14;
 
     private static final long TRACE_TAG_NOT_READY = 1L << 63;
     private static final int MAX_SECTION_NAME_LEN = 127;
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 4de5933..38fb51b 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -4076,6 +4076,13 @@
         public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
 
         /**
+         * Whether or not to enable the dial pad autocomplete functionality.
+         *
+         * @hide
+         */
+        public static final String DIALPAD_AUTOCOMPLETE = "dialpad_autocomplete";
+
+        /**
          * This are the settings to be backed up.
          *
          * NOTE: Settings are backed up and restored in the order they appear
@@ -4115,7 +4122,8 @@
             MOUNT_UMS_AUTOSTART,
             MOUNT_UMS_PROMPT,
             MOUNT_UMS_NOTIFY_ENABLED,
-            UI_NIGHT_MODE
+            UI_NIGHT_MODE,
+            DIALPAD_AUTOCOMPLETE
         };
 
         /**
@@ -5473,7 +5481,6 @@
             WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
             WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
             WIFI_WATCHDOG_POOR_NETWORK_TEST_ENABLED,
-            WIFI_SCAN_ALWAYS_AVAILABLE,
             WIFI_NUM_OPEN_NETWORKS_KEPT,
             EMERGENCY_TONE,
             CALL_AUTO_RETRY,
diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java
index 73d400e..578a86e 100644
--- a/core/java/android/speech/tts/TextToSpeech.java
+++ b/core/java/android/speech/tts/TextToSpeech.java
@@ -42,6 +42,7 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.MissingResourceException;
 import java.util.Set;
 
 /**
@@ -1128,9 +1129,23 @@
                 if (loc == null) {
                     return LANG_NOT_SUPPORTED;
                 }
-                String language = loc.getISO3Language();
-                String country = loc.getISO3Country();
+                String language = null, country = null;
+                try {
+                    language = loc.getISO3Language();
+                } catch (MissingResourceException e) {
+                    Log.w(TAG, "Couldn't retrieve ISO 639-2/T language code for locale: " + loc, e);
+                    return LANG_NOT_SUPPORTED;
+                }
+
+                try {
+                    country = loc.getISO3Country();
+                } catch (MissingResourceException e) {
+                    Log.w(TAG, "Couldn't retrieve ISO 3166 country code for locale: " + loc, e);
+                    return LANG_NOT_SUPPORTED;
+                }
+
                 String variant = loc.getVariant();
+
                 // Check if the language, country, variant are available, and cache
                 // the available parts.
                 // Note that the language is not actually set here, instead it is cached so it
@@ -1195,8 +1210,23 @@
         return runAction(new Action<Integer>() {
             @Override
             public Integer run(ITextToSpeechService service) throws RemoteException {
-                return service.isLanguageAvailable(loc.getISO3Language(),
-                        loc.getISO3Country(), loc.getVariant());
+                String language = null, country = null;
+
+                try {
+                    language = loc.getISO3Language();
+                } catch (MissingResourceException e) {
+                    Log.w(TAG, "Couldn't retrieve ISO 639-2/T language code for locale: " + loc, e);
+                    return LANG_NOT_SUPPORTED;
+                }
+
+                try {
+                    country = loc.getISO3Country();
+                } catch (MissingResourceException e) {
+                    Log.w(TAG, "Couldn't retrieve ISO 3166 country code for locale: " + loc, e);
+                    return LANG_NOT_SUPPORTED;
+                }
+
+                return service.isLanguageAvailable(language, country, loc.getVariant());
             }
         }, LANG_NOT_SUPPORTED, "isLanguageAvailable");
     }
diff --git a/core/java/android/view/FocusFinder.java b/core/java/android/view/FocusFinder.java
index b2988ed..c2c247e 100644
--- a/core/java/android/view/FocusFinder.java
+++ b/core/java/android/view/FocusFinder.java
@@ -172,6 +172,7 @@
         try {
             // Note: This sort is stable.
             mSequentialFocusComparator.setRoot(root);
+            mSequentialFocusComparator.setIsLayoutRtl(root.isLayoutRtl());
             Collections.sort(focusables, mSequentialFocusComparator);
         } finally {
             mSequentialFocusComparator.recycle();
@@ -180,9 +181,9 @@
         final int count = focusables.size();
         switch (direction) {
             case View.FOCUS_FORWARD:
-                return getForwardFocusable(root, focused, focusables, count);
+                return getNextFocusable(focused, focusables, count);
             case View.FOCUS_BACKWARD:
-                return getBackwardFocusable(root, focused, focusables, count);
+                return getPreviousFocusable(focused, focusables, count);
         }
         return focusables.get(count - 1);
     }
@@ -239,13 +240,6 @@
         return closest;
     }
 
-    private static View getForwardFocusable(ViewGroup root, View focused,
-                                            ArrayList<View> focusables, int count) {
-        return (root.isLayoutRtl()) ?
-                getPreviousFocusable(focused, focusables, count) :
-                getNextFocusable(focused, focusables, count);
-    }
-
     private static View getNextFocusable(View focused, ArrayList<View> focusables, int count) {
         if (focused != null) {
             int position = focusables.lastIndexOf(focused);
@@ -259,13 +253,6 @@
         return null;
     }
 
-    private static View getBackwardFocusable(ViewGroup root, View focused,
-                                             ArrayList<View> focusables, int count) {
-        return (root.isLayoutRtl()) ?
-                getNextFocusable(focused, focusables, count) :
-                getPreviousFocusable(focused, focusables, count);
-    }
-
     private static View getPreviousFocusable(View focused, ArrayList<View> focusables, int count) {
         if (focused != null) {
             int position = focusables.indexOf(focused);
@@ -619,6 +606,7 @@
         private final Rect mFirstRect = new Rect();
         private final Rect mSecondRect = new Rect();
         private ViewGroup mRoot;
+        private boolean mIsLayoutRtl;
 
         public void recycle() {
             mRoot = null;
@@ -628,6 +616,10 @@
             mRoot = root;
         }
 
+        public void setIsLayoutRtl(boolean b) {
+            mIsLayoutRtl = b;
+        }
+
         public int compare(View first, View second) {
             if (first == second) {
                 return 0;
@@ -641,17 +633,17 @@
             } else if (mFirstRect.top > mSecondRect.top) {
                 return 1;
             } else if (mFirstRect.left < mSecondRect.left) {
-                return -1;
+                return mIsLayoutRtl ? 1 : -1;
             } else if (mFirstRect.left > mSecondRect.left) {
-                return 1;
+                return mIsLayoutRtl ? -1 : 1;
             } else if (mFirstRect.bottom < mSecondRect.bottom) {
                 return -1;
             } else if (mFirstRect.bottom > mSecondRect.bottom) {
                 return 1;
             } else if (mFirstRect.right < mSecondRect.right) {
-                return -1;
+                return mIsLayoutRtl ? 1 : -1;
             } else if (mFirstRect.right > mSecondRect.right) {
-                return 1;
+                return mIsLayoutRtl ? -1 : 1;
             } else {
                 // The view are distinct but completely coincident so we consider
                 // them equal for our purposes.  Since the sort is stable, this
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 7ecb52e..b63ccab 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -211,6 +211,7 @@
     boolean mHasHadWindowFocus;
     boolean mLastWasImTarget;
     boolean mWindowsAnimating;
+    boolean mDrawDuringWindowsAnimating;
     boolean mIsDrawing;
     int mLastSystemUiVisibility;
     int mClientWindowLayoutFlags;
@@ -1396,8 +1397,10 @@
 
                 final int surfaceGenerationId = mSurface.getGenerationId();
                 relayoutResult = relayoutWindow(params, viewVisibility, insetsPending);
-                mWindowsAnimating |=
-                        (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_ANIMATING) != 0;
+                if (!mDrawDuringWindowsAnimating) {
+                    mWindowsAnimating |=
+                            (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_ANIMATING) != 0;
+                }
 
                 if (DEBUG_LAYOUT) Log.v(TAG, "relayout: frame=" + frame.toShortString()
                         + " overscan=" + mPendingOverscanInsets.toShortString()
@@ -2572,6 +2575,16 @@
         displayLists.clear();
     }
 
+    /**
+     * @hide
+     */
+    public void setDrawDuringWindowsAnimating(boolean value) {
+        mDrawDuringWindowsAnimating = value;
+        if (value) {
+            handleDispatchDoneAnimating();
+        }
+    }
+
     boolean scrollToRectOrFocus(Rect rectangle, boolean immediate) {
         final View.AttachInfo attachInfo = mAttachInfo;
         final Rect ci = attachInfo.mContentInsets;
@@ -2709,7 +2722,6 @@
 
             AccessibilityNodeInfo focusNode = mAccessibilityFocusedVirtualView;
             View focusHost = mAccessibilityFocusedHost;
-            focusHost.clearAccessibilityFocusNoCallbacks();
 
             // Wipe the state of the current accessibility focus since
             // the call into the provider to clear accessibility focus
@@ -2719,6 +2731,10 @@
             mAccessibilityFocusedHost = null;
             mAccessibilityFocusedVirtualView = null;
 
+            // Clear accessibility focus on the host after clearing state since
+            // this method may be reentrant.
+            focusHost.clearAccessibilityFocusNoCallbacks();
+
             AccessibilityNodeProvider provider = focusHost.getAccessibilityNodeProvider();
             if (provider != null) {
                 // Invalidate the area of the cleared accessibility focus.
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index e14a36c..ad4776d 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -1172,7 +1172,7 @@
     <string name="sms_short_code_confirm_never_allow" msgid="446992765774269673">"No permitir nunca"</string>
     <string name="sim_removed_title" msgid="6227712319223226185">"Tarjeta SIM eliminada"</string>
     <string name="sim_removed_message" msgid="2333164559970958645">"La red para celulares no estará disponible hasta que reinicies, luego de insertar una tarjeta SIM válida."</string>
-    <string name="sim_done_button" msgid="827949989369963775">"Finalizado"</string>
+    <string name="sim_done_button" msgid="827949989369963775">"Finalizar"</string>
     <string name="sim_added_title" msgid="3719670512889674693">"Tarjeta SIM agregada"</string>
     <string name="sim_added_message" msgid="6599945301141050216">"Reinicia el dispositivo para acceder a la red móvil."</string>
     <string name="sim_restart_button" msgid="4722407842815232347">"Reiniciar"</string>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index 31e9a95..a69e588 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -468,10 +468,8 @@
     <string name="permdesc_recordAudio" msgid="4906839301087980680">"Permite que o aplicativo grave áudio com o microfone. Esta permissão autoriza o aplicativo a gravar áudio a qualquer momento, sem sua confirmação."</string>
     <string name="permlab_camera" msgid="3616391919559751192">"tirar fotos e gravar vídeos"</string>
     <string name="permdesc_camera" msgid="8497216524735535009">"Permite que o aplicativo tire fotos e filme vídeos com a câmera. Esta permissão autoriza o aplicativo a usar a câmera a qualquer momento sem sua confirmação."</string>
-    <!-- no translation found for permlab_cameraDisableTransmitLed (2651072630501126222) -->
-    <skip />
-    <!-- no translation found for permdesc_cameraDisableTransmitLed (4764585465480295341) -->
-    <skip />
+    <string name="permlab_cameraDisableTransmitLed" msgid="2651072630501126222">"desativar a transmissão do LED indicador quando a câmera estiver em uso"</string>
+    <string name="permdesc_cameraDisableTransmitLed" msgid="4764585465480295341">"Permite que um aplicativo do sistema pré-instalado desative o LED indicador de uso da câmera."</string>
     <string name="permlab_brick" product="tablet" msgid="2961292205764488304">"desativar permanentemente o tablet"</string>
     <string name="permlab_brick" product="default" msgid="8337817093326370537">"desativar permanentemente o telefone"</string>
     <string name="permdesc_brick" product="tablet" msgid="4334818808001699530">"Permite que o aplicativo desative todo o tablet permanentemente. Isso é muito perigoso."</string>
@@ -1493,8 +1491,7 @@
     <string name="user_switched" msgid="3768006783166984410">"Usuário atual <xliff:g id="NAME">%1$s</xliff:g>."</string>
     <string name="owner_name" msgid="2716755460376028154">"Proprietário"</string>
     <string name="error_message_title" msgid="4510373083082500195">"Erro"</string>
-    <!-- no translation found for app_no_restricted_accounts (4011285085817350390) -->
-    <skip />
+    <string name="app_no_restricted_accounts" msgid="4011285085817350390">"Este aplicativo não suporta contas para perfis restritos"</string>
     <string name="app_not_found" msgid="3429141853498927379">"Nenhum aplicativo encontrado para executar a ação"</string>
     <string name="revoke" msgid="5404479185228271586">"Revogar"</string>
 </resources>
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index ba73837..ff35d2e 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -521,9 +521,6 @@
           <li><a href="<?cs var:toroot ?>guide/practices/screen-compat-mode.html">
             <span class="en">Screen Compatibility Mode</span>
           </a></li>
-          <!--<li><a href="<?cs var:toroot ?>guide/practices/screens-support-1.5.html">
-            <span class="en">Strategies for Android 1.5</span>
-          </a></li> -->
         </ul>
       </li>
       <li><a href="<?cs var:toroot ?>guide/practices/tablets-and-handsets.html">
diff --git a/docs/html/guide/topics/appwidgets/index.jd b/docs/html/guide/topics/appwidgets/index.jd
index cdbf827..774c66a 100644
--- a/docs/html/guide/topics/appwidgets/index.jd
+++ b/docs/html/guide/topics/appwidgets/index.jd
@@ -1,5 +1,5 @@
 page.title=App Widgets
-page.tags="home"
+page.tags="home","AppWidgetProvider"
 @jd:body
 
 <div id="qv-wrapper">
@@ -466,19 +466,6 @@
     methods as appropriate.</dd> 
 </dl>
 
-<p class="warning"><strong>Note:</strong> In Android 1.5, there is a known issue
-in which the
-<code>onDeleted()</code> method will not be called when it should be. To work
-around this issue, 
-you can implement {@link
-android.appwidget.AppWidgetProvider#onReceive(Context,Intent)
-onReceive()} as described in this 
-<a
-href="http://groups.google.com/group/android-developers/msg/e405ca19df2170e2">
-Group post</a>
-to receive the <code>onDeleted()</code> callback.
-</p>
-
 <p>The most important AppWidgetProvider callback is 
 {@link android.appwidget.AppWidgetProvider#onUpdate(android.content.Context, android.appwidget.AppWidgetManager, int[]) onUpdate()} 
 because it is called when
diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd
index 5097cc4..aec7fa7 100644
--- a/docs/html/guide/topics/resources/providing-resources.jd
+++ b/docs/html/guide/topics/resources/providing-resources.jd
@@ -21,14 +21,8 @@
         <li><a href="#AliasResources">Creating alias resources</a></li>
       </ol>
     </li>
-    <li><a href="#Compatibility">Providing the Best Device Compatibility with Resources</a>
-      <ol>
-        <li><a href="#ScreenCompatibility">Providing screen resource compatibility for Android
-1.5</a></li>
-      </ol>
-    </li>
+    <li><a href="#Compatibility">Providing the Best Device Compatibility with Resources</a></li>
     <li><a href="#BestMatch">How Android Finds the Best-matching Resource</a></li>
-    <li><a href="#KnownIssues">Known Issues</a></li>
   </ol>
 
   <h2>See also</h2>
@@ -783,9 +777,6 @@
 1.6 or higher). See the <a
 href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">Android API levels</a> document for more information
 about these values.</p>
-        <p class="caution"><strong>Caution:</strong> Android 1.5 and 1.6 only match resources
-with this qualifier when it exactly matches the platform version. See the section below about <a
-href="#KnownIssues">Known Issues</a> for more information.</p>
       </td>
     </tr>
 </table>
@@ -970,70 +961,7 @@
 resources with the <a href="#DensityQualifier">screen density</a> qualifier. Even without default
 drawable resources, Android can find the best match among the alternative screen densities and scale
 the bitmaps as necessary. However, for the best experience on all types of devices, you should
-provide alternative drawables for all three types of density. If your <a
-href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> is
-<em>less than</em> 4 (Android 1.5 or lower), be aware that the screen size, density, and aspect
-qualifiers are not supported on Android 1.5 or lower, so you might need to perform additional
-compatibility for these versions.</p>
-
-
-<h3 id="ScreenCompatibility">Providing screen resource compatibility for Android 1.5</h3>
-
-<p>Android 1.5 (and lower) does not support the following configuration qualifers:</p>
-<dl>
-  <dt><a href="#DensityQualifier">Density</a></dt>
-    <dd>{@code ldpi}, {@code mdpi}, {@code ldpi}, and {@code nodpi}</dd>
-  <dt><a href="#ScreenSizeQualifier">Screen size</a></dt>
-    <dd>{@code small}, {@code normal}, and {@code large}</dd>
-  <dt><a href="#ScreenAspectQualifier">Screen aspect</a></dt>
-    <dd>{@code long} and {@code notlong}</dd>
-</dl>
-
-<p>These configuration qualifiers were introduced in Android 1.6, so Android 1.5 (API level 3) and
-lower does not support them. If you use these configuration qualifiers and do not provide
-corresponding default resources, then an Android 1.5 device might use any one of the resource
-directories named with the above screen configuration qualifiers, because it ignores these
-qualifiers and uses whichever otherwise-matching drawable resource it finds first.</p>
-
-<p>For example, if your application supports Android 1.5 and includes drawable resources for
-each density type ({@code drawable-ldpi/}, {@code drawable-mdpi/}, and {@code drawable-ldpi/}),
-and does <em>not</em> include default drawable resources ({@code drawable/}), then
-an Android 1.5 will use drawables from any one of the alternative resource directories, which
-can result in a user interface that's less than ideal.<p>
-
-<p>So, to provide compatibility with Android 1.5 (and lower) when using the screen configuration
-qualifiers:</p>
-<ol>
-  <li>Provide default resources that are for medium-density, normal, and notlong screens.
-
-    <p>Because all Android 1.5 devices have medium-density, normal, not-long screens, you can
-place these kinds of resources in the corresponding default resource directory. For example, put all
-medium density drawable resources in {@code drawable/} (instead of {@code drawable-mdpi/}),
-put {@code normal} size resources in the corresponding default resource directory, and {@code
-notlong} resources in the corresponding default resource directory.</p>
-  </li>
-
-  <li>Ensure that your <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools</a> version
-is r6 or greater.
-
-    <p>You need SDK Tools, Revision 6 (or greater), because it includes a new packaging tool that
-automatically applies an appropriate <a href="#VersionQualifier">version qualifier</a> to any
-resource directory named with a qualifier that does not exist in Android 1.0. For example, because
-the density qualifier was introduced in Android 1.6 (API level 4), when the packaging tool
-encounters a resource directory using the density qualifier, it adds {@code v4} to the directory
-name to ensure that older versions do not use those resources (only API level 4 and higher support
-that qualifier). Thus, by putting your medium-density resources in a directory <em>without</em> the
-{@code mdpi} qualifier, they are still accessible by Android 1.5, and any device that supports the
-density qualifer and has a medium-density screen also uses the default resources (which are mdpi)
-because they are the best match for the device (instead of using the {@code ldpi} or {@code hdpi}
-resources).</p>
-</li>
-</ol>
-
-<p class="note"><strong>Note:</strong> Later versions of Android, such as API level 8,
-introduce other configuration qualifiers that older version do not support. To provide the best
-compatibility, you should always include a set of default resources for each type of resource
-that your application uses, as discussed above to provide the best device compatibility.</p>
+provide alternative drawables for all three types of density.</p>
 
 
 
@@ -1162,29 +1090,3 @@
 
 <p>To learn more about how to use resources in your application, continue to <a
 href="accessing-resources.html">Accessing Resources</a>.</p>
-
-
-
-
-<h2 id="KnownIssues">Known Issues</h2>
-
-<h3>Android 1.5 and 1.6: Version qualifier performs exact match, instead of best match</h3>
-
-<p>The correct behavior is for the system to match resources marked with a <a
-href="#VersionQualifier">version qualifier</a> equal
-to or less than the platform version on the device, but on Android 1.5 and 1.6, (API level 3 and 4),
-there is a bug that causes the system to match resources marked with the version qualifier
-only when it exactly matches the version on the device.</p>
-
-<p><b>The workaround:</b> To provide version-specific resources, abide by this behavior. However,
-because this bug is fixed in versions of Android available after 1.6, if
-you need to differentiate resources between Android 1.5, 1.6, and later versions, then you only need
-to apply the version qualifier to the 1.6 resources and one to match all later versions. Thus, this
-is effectively a non-issue.</p>
-
-<p>For example, if you want drawable resources that are different on each Android 1.5, 1.6,
-and 2.0.1 (and later), create three drawable directories: {@code drawable/} (for 1.5 and lower),
-{@code drawable-v4} (for 1.6), and {@code drawable-v6} (for 2.0.1 and later&mdash;version 2.0, v5,
-is no longer available).</p>
-
-
diff --git a/docs/html/guide/topics/ui/actionbar.jd b/docs/html/guide/topics/ui/actionbar.jd
index db09e7d..c5bbdbc 100644
--- a/docs/html/guide/topics/ui/actionbar.jd
+++ b/docs/html/guide/topics/ui/actionbar.jd
@@ -1,5 +1,5 @@
 page.title=Action Bar
-page.tags="action bar","menu"
+page.tags="actionbar","menu"
 parent.title=User Interface
 parent.link=index.html
 @jd:body
diff --git a/docs/html/tools/building/building-cmdline.jd b/docs/html/tools/building/building-cmdline.jd
index e0d0d3f..b65fc78 100644
--- a/docs/html/tools/building/building-cmdline.jd
+++ b/docs/html/tools/building/building-cmdline.jd
@@ -244,8 +244,8 @@
 
   <p>Be certain to create multiple AVDs upon which to test your application. You should have one
   AVD for each platform and screen type with which your application is compatible. For instance, if
-  your application compiles against the Android 1.5 (API Level 3) platform, you should create an
-  AVD for each platform equal to and greater than 1.5 and an AVD for each <a href=
+  your application compiles against the Android 4.0 (API Level 14) platform, you should create an
+  AVD for each platform equal to and greater than 4.0 and an AVD for each <a href=
   "{@docRoot}guide/practices/screens_support.html">screen type</a> you support, then test your
   application on each one.</p>
 
diff --git a/docs/html/tools/building/building-eclipse.jd b/docs/html/tools/building/building-eclipse.jd
index 304aa7e..7a4367a 100644
--- a/docs/html/tools/building/building-eclipse.jd
+++ b/docs/html/tools/building/building-eclipse.jd
@@ -69,8 +69,8 @@
 
   <p>Be certain to create multiple AVDs upon which to test your application. You should have one
   AVD for each platform and screen type with which your application is compatible. For instance, if
-  your application compiles against the Android 1.5 (API Level 3) platform, you should create an
-  AVD for each platform equal to and greater than 1.5 and an AVD for each <a href=
+  your application compiles against the Android 4.0 (API Level 14) platform, you should create an
+  AVD for each platform equal to and greater than 4.0 and an AVD for each <a href=
   "{@docRoot}guide/practices/screens_support.html">screen type</a> you support, then test your
   application on each one.</p>
 
diff --git a/docs/html/tools/debugging/ddms.jd b/docs/html/tools/debugging/ddms.jd
index f641aad..d2fb47a 100644
--- a/docs/html/tools/debugging/ddms.jd
+++ b/docs/html/tools/debugging/ddms.jd
@@ -192,7 +192,6 @@
   
   <p>Before you start method profiling in DDMS, be aware of the following restrictions:</p>
     <ul>
-      <li>Android 1.5 devices are not supported.</li>
       <li>Android 2.1 and earlier devices must
       have an SD card present and your application must have permission to write to the SD card.
       <li>Android 2.2 and later devices do not need an SD card. The trace log files are 
diff --git a/docs/html/tools/debugging/debugging-tracing.jd b/docs/html/tools/debugging/debugging-tracing.jd
index 7d750cf..8653da6 100644
--- a/docs/html/tools/debugging/debugging-tracing.jd
+++ b/docs/html/tools/debugging/debugging-tracing.jd
@@ -107,7 +107,6 @@
   <ul>
     <li>If you are using the {@link android.os.Debug} class, your device or emulator must have an SD card
      and your application must have permission to write to the SD card. </li>
-    <li>If you are using DDMS, Android 1.5 devices are not supported.</li>
     <li>If you are using DDMS, Android 2.1 and earlier devices must
     have an SD card present and your application must have permission to write to the SD card.
     <li>If you are using DDMS, Android 2.2 and later devices do not need an SD card. The trace log files are 
diff --git a/docs/html/tools/testing/activity_test.jd b/docs/html/tools/testing/activity_test.jd
index 096aea5..2d1a5bf 100644
--- a/docs/html/tools/testing/activity_test.jd
+++ b/docs/html/tools/testing/activity_test.jd
@@ -149,18 +149,6 @@
         find instructions for setting up and running the test application in the
         <a href="#EditorCommandLine">appendix</a> of this document.
     </li>
-    <li>
-        Android 1.5 platform (API Level 3) or higher. You must have the Android 1.5 platform
-        (API Level 3) or higher installed in your SDK, because this tutorial uses APIs that
-        were introduced in that version.
-        <p>
-            If you are not sure which platforms are installed in your SDK,
-            open the Android SDK and AVD Manager and check in the
-            <strong>Installed Packages</strong> panel.
-            If aren't sure how to download a platform into your SDK,
-            read <a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a>.
-        </p>
-    </li>
   </ul>
 <h2 id="DownloadCode">Installing the Tutorial Sample Code</h2>
 <p>
diff --git a/media/java/android/media/MediaDrm.java b/media/java/android/media/MediaDrm.java
index be2d9bc..7677d8a1 100644
--- a/media/java/android/media/MediaDrm.java
+++ b/media/java/android/media/MediaDrm.java
@@ -363,11 +363,16 @@
 
     /**
      * A key response is received from the license server by the app, then it is
-     * provided to the DRM engine plugin using provideKeyResponse. The byte array
-     * returned is a keySetId that can be used to later restore the keys to a new
-     * session with the method {@link #restoreKeys}, enabling offline key use.
+     * provided to the DRM engine plugin using provideKeyResponse.  When the
+     * response is for an offline key request, a keySetId is returned that can be
+     * used to later restore the keys to a new session with the method
+     * {@link #restoreKeys}.
+     * When the response is for a streaming or release request, null is returned.
      *
-     * @param sessionId the session ID for the DRM session
+     * @param scope may be a sessionId or keySetId depending on the type of the
+     * response.  Scope should be set to the sessionId when the response is for either
+     * streaming or offline key requests.  Scope should be set to the keySetId when
+     * the response is for a release request.
      * @param response the byte array response from the server
      *
      * @throws NotProvisionedException if the response indicates that
@@ -375,7 +380,7 @@
      * @throws DeniedByServerException if the response indicates that the
      * server rejected the request
      */
-    public native byte[] provideKeyResponse(byte[] sessionId, byte[] response)
+    public native byte[] provideKeyResponse(byte[] scope, byte[] response)
         throws NotProvisionedException, DeniedByServerException;
 
 
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
index 32759de..c64b954 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
@@ -46,6 +46,7 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewPropertyAnimator;
+import android.view.ViewRootImpl;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.animation.AnimationUtils;
 import android.view.animation.DecelerateInterpolator;
@@ -365,6 +366,14 @@
         }
     }
 
+    protected void onAttachedToWindow () {
+        super.onAttachedToWindow();
+        final ViewRootImpl root = getViewRootImpl();
+        if (root != null) {
+            root.setDrawDuringWindowsAnimating(true);
+        }
+    }
+
     public void onUiHidden() {
         mCallUiHiddenBeforeNextReload = false;
         if (!mShowing && mRecentTaskDescriptions != null) {
@@ -562,7 +571,7 @@
                 !mRecentTasksLoader.isFirstScreenful()) {
             int timeSinceWindowAnimation =
                     (int) (System.currentTimeMillis() - mWindowAnimationStartTime);
-            final int minStartDelay = 125;
+            final int minStartDelay = 150;
             final int startDelay = Math.max(0, Math.min(
                     minStartDelay - timeSinceWindowAnimation, minStartDelay));
             final int duration = 250;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
index baaefab..46916f7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
@@ -143,14 +143,39 @@
         return super.dispatchPopulateAccessibilityEvent(event);
     }
 
+    @Override
+    public void onRtlPropertiesChanged(int layoutDirection) {
+        super.onRtlPropertiesChanged(layoutDirection);
+
+        if (mWifi != null) {
+            mWifi.setImageDrawable(null);
+        }
+        if (mWifiActivity != null) {
+            mWifiActivity.setImageDrawable(null);
+        }
+
+        if (mMobile != null) {
+            mMobile.setImageDrawable(null);
+        }
+        if (mMobileActivity != null) {
+            mMobileActivity.setImageDrawable(null);
+        }
+        if (mMobileType != null) {
+            mMobileType.setImageDrawable(null);
+        }
+
+        if(mAirplane != null) {
+            mAirplane.setImageDrawable(null);
+        }
+
+        apply();
+    }
+
     // Run after each indicator change.
     private void apply() {
         if (mWifiGroup == null) return;
 
         if (mWifiVisible) {
-            mWifi.setImageDrawable(null);
-            mWifiActivity.setImageDrawable(null);
-
             mWifi.setImageResource(mWifiStrengthId);
             mWifiActivity.setImageResource(mWifiActivityId);
 
@@ -166,10 +191,6 @@
                     mWifiStrengthId, mWifiActivityId));
 
         if (mMobileVisible && !mIsAirplaneMode) {
-            mMobile.setImageDrawable(null);
-            mMobileActivity.setImageDrawable(null);
-            mMobileType.setImageDrawable(null);
-
             mMobile.setImageResource(mMobileStrengthId);
             mMobileActivity.setImageResource(mMobileActivityId);
             mMobileType.setImageResource(mMobileTypeId);
@@ -181,7 +202,6 @@
         }
 
         if (mIsAirplaneMode) {
-            mAirplane.setImageDrawable(null);
             mAirplane.setImageResource(mAirplaneIconId);
             mAirplane.setVisibility(View.VISIBLE);
         } else {
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java
index 2675309..142357d 100644
--- a/services/java/com/android/server/LocationManagerService.java
+++ b/services/java/com/android/server/LocationManagerService.java
@@ -1798,7 +1798,7 @@
             boolean receiverDead = false;
 
             int receiverUserId = UserHandle.getUserId(receiver.mUid);
-            if (receiverUserId != mCurrentUserId) {
+            if (receiverUserId != mCurrentUserId && !isUidALocationProvider(receiver.mUid)) {
                 if (D) {
                     Log.d(TAG, "skipping loc update for background user " + receiverUserId +
                             " (current user: " + mCurrentUserId + ", app: " +
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java
index 788d514..e53a721 100644
--- a/services/java/com/android/server/wm/WindowState.java
+++ b/services/java/com/android/server/wm/WindowState.java
@@ -522,12 +522,8 @@
         // Now make sure the window fits in the overall display.
         Gravity.applyDisplay(mAttrs.gravity, df, frame);
 
-        // Make sure the overscan, content and visible frames are inside of the
+        // Make sure the content and visible frames are inside of the
         // final window frame.
-        if (overscan.left < frame.left) overscan.left = frame.left;
-        if (overscan.top < frame.top) overscan.top = frame.top;
-        if (overscan.right > frame.right) overscan.right = frame.right;
-        if (overscan.bottom > frame.bottom) overscan.bottom = frame.bottom;
         if (content.left < frame.left) content.left = frame.left;
         if (content.top < frame.top) content.top = frame.top;
         if (content.right > frame.right) content.right = frame.right;