Merge "New honeycomb sound set" into honeycomb
diff --git a/api/current.xml b/api/current.xml
index ebfcdaf..bd59694 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -1885,6 +1885,28 @@
  visibility="public"
 >
 </field>
+<field name="actionMenuTextAppearance"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843616"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="actionMenuTextColor"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843617"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="actionModeBackground"
  type="int"
  transient="false"
@@ -94279,6 +94301,17 @@
  visibility="public"
 >
 </constructor>
+<method name="getBackDisposition"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
 <method name="getCandidatesHiddenVisibility"
  return="int"
  abstract="false"
@@ -95004,6 +95037,19 @@
 <parameter name="charCode" type="char">
 </parameter>
 </method>
+<method name="setBackDisposition"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="disposition" type="int">
+</parameter>
+</method>
 <method name="setCandidatesView"
  return="void"
  abstract="false"
@@ -95130,6 +95176,39 @@
  visibility="public"
 >
 </method>
+<field name="BACK_DISPOSITION_DEFAULT"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="0"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="BACK_DISPOSITION_WILL_DISMISS"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="2"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="BACK_DISPOSITION_WILL_NOT_DISMISS"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="1"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 </class>
 <class name="InputMethodService.InputMethodImpl"
  extends="android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodImpl"
diff --git a/core/java/android/animation/LayoutTransition.java b/core/java/android/animation/LayoutTransition.java
index f13d940..d3e10f3 100644
--- a/core/java/android/animation/LayoutTransition.java
+++ b/core/java/android/animation/LayoutTransition.java
@@ -166,6 +166,7 @@
      * we cache all of the current animations in this map for possible cancellation on
      * another layout event.
      */
+    private final HashMap<View, Animator> pendingAnimations = new HashMap<View, Animator>();
     private final HashMap<View, Animator> currentChangingAnimations = new HashMap<View, Animator>();
     private final HashMap<View, Animator> currentVisibilityAnimations =
             new HashMap<View, Animator>();
@@ -542,6 +543,8 @@
 
         // reset the inter-animation delay, in case we use it later
         staggerDelay = 0;
+        final long duration = (changeReason == APPEARING) ?
+                mChangingAppearingDuration : mChangingDisappearingDuration;
 
         final ViewTreeObserver observer = parent.getViewTreeObserver(); // used for later cleanup
         if (!observer.isAlive()) {
@@ -556,12 +559,6 @@
             // only animate the views not being added or removed
             if (child != newView) {
 
-                // If there's an animation running on this view already, cancel it
-                Animator currentAnimation = currentChangingAnimations.get(child);
-                if (currentAnimation != null) {
-                    currentAnimation.cancel();
-                    currentChangingAnimations.remove(child);
-                }
 
                 // Make a copy of the appropriate animation
                 final Animator anim = baseAnimator.clone();
@@ -573,6 +570,30 @@
                 // its target object
                 anim.setupStartValues();
 
+                // If there's an animation running on this view already, cancel it
+                Animator currentAnimation = pendingAnimations.get(child);
+                if (currentAnimation != null) {
+                    currentAnimation.cancel();
+                    pendingAnimations.remove(child);
+                }
+                // Cache the animation in case we need to cancel it later
+                pendingAnimations.put(child, anim);
+
+                // For the animations which don't get started, we have to have a means of
+                // removing them from the cache, lest we leak them and their target objects.
+                // We run an animator for the default duration+100 (an arbitrary time, but one
+                // which should far surpass the delay between setting them up here and
+                // handling layout events which start them.
+                ValueAnimator pendingAnimRemover = ValueAnimator.ofFloat(0f, 1f).
+                        setDuration(duration+100);
+                pendingAnimRemover.addListener(new AnimatorListenerAdapter() {
+                    @Override
+                    public void onAnimationEnd(Animator animation) {
+                        pendingAnimations.remove(child);
+                    }
+                });
+                pendingAnimRemover.start();
+
                 // Add a listener to track layout changes on this view. If we don't get a callback,
                 // then there's nothing to animate.
                 final View.OnLayoutChangeListener listener = new View.OnLayoutChangeListener() {
@@ -583,19 +604,25 @@
                         anim.setupEndValues();
 
                         long startDelay;
-                        long duration;
                         if (changeReason == APPEARING) {
                             startDelay = mChangingAppearingDelay + staggerDelay;
                             staggerDelay += mChangingAppearingStagger;
-                            duration = mChangingAppearingDuration;
                         } else {
                             startDelay = mChangingDisappearingDelay + staggerDelay;
                             staggerDelay += mChangingDisappearingStagger;
-                            duration = mChangingDisappearingDuration;
                         }
                         anim.setStartDelay(startDelay);
                         anim.setDuration(duration);
 
+                        Animator prevAnimation = currentChangingAnimations.get(child);
+                        if (prevAnimation != null) {
+                            prevAnimation.cancel();
+                            currentChangingAnimations.remove(child);
+                        }
+                        Animator pendingAnimation = pendingAnimations.get(child);
+                        if (pendingAnimation != null) {
+                            pendingAnimations.remove(child);
+                        }
                         // Cache the animation in case we need to cancel it later
                         currentChangingAnimations.put(child, anim);
 
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 055984f..3c45080 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -4268,7 +4268,7 @@
         
         mWindow = PolicyManager.makeNewWindow(this);
         mWindow.setCallback(this);
-        mWindow.getLayoutInflater().setFactory2(this);
+        mWindow.getLayoutInflater().setPrivateFactory(this);
         if (info.softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED) {
             mWindow.setSoftInputMode(info.softInputMode);
         }
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index de84c56..5049e19 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -927,9 +927,8 @@
             if (mContentInfo != null) {
                 contentView.setTextViewText(R.id.info, mContentInfo);
             } else if (mNumber > 0) {
-                if (mNumber > 100) {
-                    contentView.setTextViewText(R.id.info, mContext.getString(
-                                R.string.status_bar_notification_info_overflow));
+                if (mNumber > 999) {
+                    contentView.setTextViewText(R.id.info, "999+");
                 } else {
                     NumberFormat f = NumberFormat.getIntegerInstance();
                     contentView.setTextViewText(R.id.info, f.format(mNumber));
diff --git a/core/java/android/app/StatusBarManager.java b/core/java/android/app/StatusBarManager.java
index 97e6931..1af0983 100644
--- a/core/java/android/app/StatusBarManager.java
+++ b/core/java/android/app/StatusBarManager.java
@@ -22,6 +22,7 @@
 import android.os.RemoteException;
 import android.os.IBinder;
 import android.os.ServiceManager;
+import android.view.View;
 
 import com.android.internal.statusbar.IStatusBarService;
 
@@ -31,52 +32,24 @@
  * @hide
  */
 public class StatusBarManager {
-    /**
-     * Flag for {@link #disable} to make the status bar not expandable.  Unless you also
-     * set {@link #DISABLE_NOTIFICATION_ICONS}, new notifications will continue to show.
-     */
-    public static final int DISABLE_EXPAND = 0x00000001;
 
-    /**
-     * Flag for {@link #disable} to hide notification icons and scrolling ticker text.
-     */
-    public static final int DISABLE_NOTIFICATION_ICONS = 0x00000002;
+    public static final int DISABLE_EXPAND = View.STATUS_BAR_DISABLE_EXPAND;
+    public static final int DISABLE_NOTIFICATION_ICONS = View.STATUS_BAR_DISABLE_NOTIFICATION_ICONS;
+    public static final int DISABLE_NOTIFICATION_ALERTS
+            = View.STATUS_BAR_DISABLE_NOTIFICATION_ALERTS;
+    public static final int DISABLE_NOTIFICATION_TICKER
+            = View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER;
+    public static final int DISABLE_SYSTEM_INFO = View.STATUS_BAR_DISABLE_SYSTEM_INFO;
+    public static final int DISABLE_NAVIGATION = View.STATUS_BAR_DISABLE_NAVIGATION;
+    public static final int DISABLE_BACK = View.STATUS_BAR_DISABLE_BACK;
+    public static final int DISABLE_CLOCK = View.STATUS_BAR_DISABLE_CLOCK;
 
-    /**
-     * Flag for {@link #disable} to disable incoming notification alerts.  This will not block
-     * icons, but it will block sound, vibrating and other visual or aural notifications.
-     */
-    public static final int DISABLE_NOTIFICATION_ALERTS = 0x00000004;
-
-    /**
-     * Flag for {@link #disable} to hide only the scrolling ticker.  Note that
-     * {@link #DISABLE_NOTIFICATION_ICONS} implies {@link #DISABLE_NOTIFICATION_TICKER}.
-     */
-    public static final int DISABLE_NOTIFICATION_TICKER = 0x00000008;
-
-    /**
-     * Flag for {@link #disable} to hide the center system info area.
-     */
-    public static final int DISABLE_SYSTEM_INFO = 0x00000010;
-
-    /**
-     * Flag for {@link #disable} to hide only the navigation buttons.  Don't use this
-     * unless you're a special part of the system UI (i.e., setup wizard, keyguard).
-     */
-    public static final int DISABLE_NAVIGATION = 0x00000020;
-
-    /**
-     * Flag for {@link #disable} to hide only the clock.  You might use this if your activity has
-     * its own clock making the status bar's clock redundant.
-     */
-    public static final int DISABLE_CLOCK = 0x00000040;
-
-
-    /**
-     * Re-enable all of the status bar features that you've disabled.
-     */
     public static final int DISABLE_NONE = 0x00000000;
 
+    public static final int DISABLE_MASK = DISABLE_EXPAND | DISABLE_NOTIFICATION_ICONS
+            | DISABLE_NOTIFICATION_ALERTS | DISABLE_NOTIFICATION_TICKER
+            | DISABLE_SYSTEM_INFO| DISABLE_NAVIGATION | DISABLE_BACK | DISABLE_CLOCK;
+
     private Context mContext;
     private IStatusBarService mService;
     private IBinder mToken = new Binder();
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 255eb6c..a99256f 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -219,7 +219,34 @@
 public class InputMethodService extends AbstractInputMethodService {
     static final String TAG = "InputMethodService";
     static final boolean DEBUG = false;
-    
+
+    /**
+     * The back button will close the input window.
+     */
+    public static final int BACK_DISPOSITION_DEFAULT = 0;  // based on window
+
+    /**
+     * This input method will not consume the back key.
+     */
+    public static final int BACK_DISPOSITION_WILL_NOT_DISMISS = 1; // back
+
+    /**
+     * This input method will consume the back key.
+     */
+    public static final int BACK_DISPOSITION_WILL_DISMISS = 2; // down
+
+    /**
+     * @hide
+     * The IME is active.  It may or may not be visible.
+     */
+    public static final int IME_ACTIVE = 0x1;
+
+    /**
+     * @hide
+     * The IME is visible.
+     */
+    public static final int IME_VISIBLE = 0x2;
+
     InputMethodManager mImm;
     
     int mTheme = 0;
@@ -271,6 +298,7 @@
     boolean mIsInputViewShown;
     
     int mStatusIcon;
+    int mBackDisposition;
 
     final Insets mTmpInsets = new Insets();
     final int[] mTmpLocation = new int[2];
@@ -394,9 +422,9 @@
                 showWindow(true);
             }
             // If user uses hard keyboard, IME button should always be shown.
-            if (!onEvaluateInputViewShown()) {
-                mImm.setIMEButtonVisible(mToken, true);
-            }
+            boolean showing = onEvaluateInputViewShown();
+            mImm.setImeWindowStatus(mToken, IME_ACTIVE | (showing ? IME_VISIBLE : 0),
+                    mBackDisposition);
             if (resultReceiver != null) {
                 resultReceiver.send(wasVis != isInputViewShown()
                         ? InputMethodManager.RESULT_SHOWN
@@ -704,9 +732,9 @@
                 hideWindow();
             }
             // If user uses hard keyboard, IME button should always be shown.
-            if (!onEvaluateInputViewShown()) {
-                mImm.setIMEButtonVisible(mToken, true);
-            }
+            boolean showing = onEvaluateInputViewShown();
+            mImm.setImeWindowStatus(mToken, IME_ACTIVE | (showing ? IME_VISIBLE : 0),
+                    mBackDisposition);
         }
     }
 
@@ -736,6 +764,14 @@
         return mWindow;
     }
     
+    public void setBackDisposition(int disposition) {
+        mBackDisposition = disposition;
+    }
+
+    public int getBackDisposition() {
+        return mBackDisposition;
+    }
+
     /**
      * Return the maximum width, in pixels, available the input method.
      * Input methods are positioned at the bottom of the screen and, unless
@@ -1378,7 +1414,7 @@
 
         if (!wasVisible) {
             if (DEBUG) Log.v(TAG, "showWindow: showing!");
-            mImm.setIMEButtonVisible(mToken, true);
+            mImm.setImeWindowStatus(mToken, IME_ACTIVE, mBackDisposition);
             onWindowShown();
             mWindow.show();
         }
@@ -1394,7 +1430,7 @@
         }
         mInputViewStarted = false;
         mCandidatesViewStarted = false;
-        mImm.setIMEButtonVisible(mToken, false);
+        mImm.setImeWindowStatus(mToken, 0, mBackDisposition);
         if (mWindowVisible) {
             mWindow.hide();
             mWindowVisible = false;
diff --git a/core/java/android/text/TextUtils.java b/core/java/android/text/TextUtils.java
index 7748265..d5010c6 100644
--- a/core/java/android/text/TextUtils.java
+++ b/core/java/android/text/TextUtils.java
@@ -1142,7 +1142,7 @@
 
                     // XXX this is probably ok, but need to look at it more
                     tempMt.setPara(format, 0, format.length(), request);
-                    float moreWid = mt.addStyleRun(p, mt.mLen, null);
+                    float moreWid = tempMt.addStyleRun(p, tempMt.mLen, null);
 
                     if (w + moreWid <= avail) {
                         ok = i + 1;
diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java
index d24af52..a17ed9d 100644
--- a/core/java/android/view/LayoutInflater.java
+++ b/core/java/android/view/LayoutInflater.java
@@ -68,6 +68,7 @@
     private boolean mFactorySet;
     private Factory mFactory;
     private Factory2 mFactory2;
+    private Factory2 mPrivateFactory;
     private Filter mFilter;
 
     private final Object[] mConstructorArgs = new Object[2];
@@ -193,6 +194,7 @@
         mContext = newContext;
         mFactory = original.mFactory;
         mFactory2 = original.mFactory2;
+        mPrivateFactory = original.mPrivateFactory;
         mFilter = original.mFilter;
     }
     
@@ -300,6 +302,13 @@
     }
 
     /**
+     * @hide for use by framework
+     */
+    public void setPrivateFactory(Factory2 factory) {
+        mPrivateFactory = factory;
+    }
+
+    /**
      * @return The {@link Filter} currently used by this LayoutInflater to restrict the set of Views
      * that are allowed to be inflated.
      */
@@ -651,6 +660,10 @@
             else if (mFactory != null) view = mFactory.onCreateView(name, mContext, attrs);
             else view = null;
 
+            if (view == null && mPrivateFactory != null) {
+                view = mPrivateFactory.onCreateView(parent, name, mContext, attrs);
+            }
+            
             if (view == null) {
                 if (-1 == name.indexOf('.')) {
                     view = onCreateView(parent, name, attrs);
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index 966bd8d..87b3d79 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -174,6 +174,7 @@
                     return true;
                 }
             };
+    private boolean mGlobalListenersAdded;
 
     public SurfaceView(Context context) {
         super(context);
@@ -212,9 +213,13 @@
         mLayout.token = getWindowToken();
         mLayout.setTitle("SurfaceView");
         mViewVisibility = getVisibility() == VISIBLE;
-        ViewTreeObserver observer = getViewTreeObserver();
-        observer.addOnScrollChangedListener(mScrollChangedListener);
-        observer.addOnPreDrawListener(mDrawListener);
+
+        if (!mGlobalListenersAdded) {
+            ViewTreeObserver observer = getViewTreeObserver();
+            observer.addOnScrollChangedListener(mScrollChangedListener);
+            observer.addOnPreDrawListener(mDrawListener);
+            mGlobalListenersAdded = true;
+        }
     }
 
     @Override
@@ -275,9 +280,13 @@
     
     @Override
     protected void onDetachedFromWindow() {
-        ViewTreeObserver observer = getViewTreeObserver();
-        observer.removeOnScrollChangedListener(mScrollChangedListener);
-        observer.removeOnPreDrawListener(mDrawListener);
+        if (mGlobalListenersAdded) {
+            ViewTreeObserver observer = getViewTreeObserver();
+            observer.removeOnScrollChangedListener(mScrollChangedListener);
+            observer.removeOnPreDrawListener(mDrawListener);
+            mGlobalListenersAdded = false;
+        }
+
         mRequestedVisible = false;
         updateWindow(false, false);
         mHaveFrame = false;
@@ -285,6 +294,7 @@
             try {
                 mSession.remove(mWindow);
             } catch (RemoteException ex) {
+                // Not much we can do here...
             }
             mWindow = null;
         }
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index d0b150b..86e557d 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -1732,6 +1732,102 @@
     public static final int STATUS_BAR_HIDDEN = 0x00000001;
 
     /**
+     * @hide
+     *
+     * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked
+     * out of the public fields to keep the undefined bits out of the developer's way.
+     *
+     * Flag to make the status bar not expandable.  Unless you also
+     * set {@link #STATUS_BAR_DISABLE_NOTIFICATION_ICONS}, new notifications will continue to show.
+     */
+    public static final int STATUS_BAR_DISABLE_EXPAND = 0x00010000;
+
+    /**
+     * @hide
+     *
+     * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked
+     * out of the public fields to keep the undefined bits out of the developer's way.
+     *
+     * Flag to hide notification icons and scrolling ticker text.
+     */
+    public static final int STATUS_BAR_DISABLE_NOTIFICATION_ICONS = 0x00020000;
+
+    /**
+     * @hide
+     *
+     * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked
+     * out of the public fields to keep the undefined bits out of the developer's way.
+     *
+     * Flag to disable incoming notification alerts.  This will not block
+     * icons, but it will block sound, vibrating and other visual or aural notifications.
+     */
+    public static final int STATUS_BAR_DISABLE_NOTIFICATION_ALERTS = 0x00040000;
+
+    /**
+     * @hide
+     *
+     * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked
+     * out of the public fields to keep the undefined bits out of the developer's way.
+     *
+     * Flag to hide only the scrolling ticker.  Note that
+     * {@link #STATUS_BAR_DISABLE_NOTIFICATION_ICONS} implies
+     * {@link #STATUS_BAR_DISABLE_NOTIFICATION_TICKER}.
+     */
+    public static final int STATUS_BAR_DISABLE_NOTIFICATION_TICKER = 0x00080000;
+
+    /**
+     * @hide
+     *
+     * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked
+     * out of the public fields to keep the undefined bits out of the developer's way.
+     *
+     * Flag to hide the center system info area.
+     */
+    public static final int STATUS_BAR_DISABLE_SYSTEM_INFO = 0x00100000;
+
+    /**
+     * @hide
+     *
+     * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked
+     * out of the public fields to keep the undefined bits out of the developer's way.
+     *
+     * Flag to hide only the navigation buttons.  Don't use this
+     * unless you're a special part of the system UI (i.e., setup wizard, keyguard).
+     *
+     * THIS DOES NOT DISABLE THE BACK BUTTON
+     */
+    public static final int STATUS_BAR_DISABLE_NAVIGATION = 0x00200000;
+
+    /**
+     * @hide
+     *
+     * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked
+     * out of the public fields to keep the undefined bits out of the developer's way.
+     *
+     * Flag to hide only the back button.  Don't use this
+     * unless you're a special part of the system UI (i.e., setup wizard, keyguard).
+     */
+    public static final int STATUS_BAR_DISABLE_BACK = 0x00400000;
+
+    /**
+     * @hide
+     *
+     * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked
+     * out of the public fields to keep the undefined bits out of the developer's way.
+     *
+     * Flag to hide only the clock.  You might use this if your activity has
+     * its own clock making the status bar's clock redundant.
+     */
+    public static final int STATUS_BAR_DISABLE_CLOCK = 0x00800000;
+
+
+    /**
+     * @hide
+     */
+    public static final int PUBLIC_STATUS_BAR_VISIBILITY_MASK = STATUS_BAR_HIDDEN;
+    
+
+    /**
      * Controls the over-scroll mode for this view.
      * See {@link #overScrollBy(int, int, int, int, int, int, int, int, boolean)},
      * {@link #OVER_SCROLL_ALWAYS}, {@link #OVER_SCROLL_IF_CONTENT_SCROLLS},
@@ -7801,7 +7897,6 @@
     }
 
     void dispatchDetachedFromWindow() {
-        //System.out.println("Detached! " + this);
         AttachInfo info = mAttachInfo;
         if (info != null) {
             int vis = info.mWindowVisibility;
@@ -7811,10 +7906,12 @@
         }
 
         onDetachedFromWindow();
-        if ((mPrivateFlags&SCROLL_CONTAINER_ADDED) != 0) {
+
+        if ((mPrivateFlags & SCROLL_CONTAINER_ADDED) != 0) {
             mAttachInfo.mScrollContainers.remove(this);
             mPrivateFlags &= ~SCROLL_CONTAINER_ADDED;
         }
+
         mAttachInfo = null;
     }
 
@@ -10837,9 +10934,9 @@
     /**
      */
     public void dispatchSystemUiVisibilityChanged(int visibility) {
-        mSystemUiVisibility = visibility;
         if (mOnSystemUiVisibilityChangeListener != null) {
-            mOnSystemUiVisibilityChangeListener.onSystemUiVisibilityChange(visibility);
+            mOnSystemUiVisibilityChangeListener.onSystemUiVisibilityChange(
+                    visibility & ~PUBLIC_STATUS_BAR_VISIBILITY_MASK);
         }
     }
 
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index 7edfd7b..cb67b78 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -531,9 +531,9 @@
     }
 
     /** @hide */
-    public void setIMEButtonVisible(IBinder imeToken, boolean visible) {
+    public void setImeWindowStatus(IBinder imeToken, int vis, int backDisposition) {
         try {
-            mService.setIMEButtonVisible(imeToken, visible);
+            mService.setImeWindowStatus(imeToken, vis, backDisposition);
         } catch (RemoteException e) {
             throw new RuntimeException(e);
         }
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index e26fd6f..790a040 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -350,6 +350,7 @@
     private ZoomManager mZoomManager;
 
     private Rect mGLRectViewport = new Rect();
+    private boolean mGLViewportEmpty = false;
 
     /**
      *  Transportation object for returning WebView across thread boundaries.
@@ -4075,7 +4076,8 @@
         }
 
         if (canvas.isHardwareAccelerated()) {
-            int functor = nativeGetDrawGLFunction(mGLRectViewport, getScale(), extras);
+            int functor = nativeGetDrawGLFunction(mGLViewportEmpty ? null : mGLRectViewport,
+                    getScale(), extras);
             ((HardwareCanvas) canvas).callDrawGLFunction(functor);
         } else {
             DrawFilter df = null;
@@ -5159,16 +5161,21 @@
 
     void setGLRectViewport() {
         // Use the getGlobalVisibleRect() to get the intersection among the parents
-        getGlobalVisibleRect(mGLRectViewport);
-
-        // Then need to invert the Y axis, just for GL
-        View rootView = getRootView();
-        int rootViewHeight = rootView.getHeight();
-        int savedWebViewBottom = mGLRectViewport.bottom;
-        mGLRectViewport.bottom = rootViewHeight - mGLRectViewport.top - getVisibleTitleHeight();
-        mGLRectViewport.top = rootViewHeight - savedWebViewBottom;
-
-        nativeUpdateDrawGLFunction(mGLRectViewport);
+        // visible == false means we're clipped - send a null rect down to indicate that
+        // we should not draw
+        boolean visible = getGlobalVisibleRect(mGLRectViewport);
+        if (visible) {
+            // Then need to invert the Y axis, just for GL
+            View rootView = getRootView();
+            int rootViewHeight = rootView.getHeight();
+            int savedWebViewBottom = mGLRectViewport.bottom;
+            mGLRectViewport.bottom = rootViewHeight - mGLRectViewport.top - getVisibleTitleHeight();
+            mGLRectViewport.top = rootViewHeight - savedWebViewBottom;
+            mGLViewportEmpty = false;
+        } else {
+            mGLViewportEmpty = true;
+        }
+        nativeUpdateDrawGLFunction(mGLViewportEmpty ? null : mGLRectViewport);
     }
 
     /**
@@ -6828,7 +6835,7 @@
                     previouslyFocusedRect);
         } else {
             result = super.requestFocus(direction, previouslyFocusedRect);
-            if (mWebViewCore.getSettings().getNeedInitialFocus()) {
+            if (mWebViewCore.getSettings().getNeedInitialFocus() && !isInTouchMode()) {
                 // For cases such as GMail, where we gain focus from a direction,
                 // we want to move to the first available link.
                 // FIXME: If there are no visible links, we may not want to
diff --git a/core/java/android/widget/TabWidget.java b/core/java/android/widget/TabWidget.java
index 51ece33..1a4ff29 100644
--- a/core/java/android/widget/TabWidget.java
+++ b/core/java/android/widget/TabWidget.java
@@ -132,7 +132,17 @@
                 mRightStrip = resources.getDrawable(
                         com.android.internal.R.drawable.tab_bottom_right_v4);
             }
-        }
+        } else {
+            // Use modern color scheme for Eclair and beyond
+            if (mLeftStrip == null) {
+                mLeftStrip = resources.getDrawable(
+                        com.android.internal.R.drawable.tab_bottom_left);
+            }
+            if (mRightStrip == null) {
+                mRightStrip = resources.getDrawable(
+                        com.android.internal.R.drawable.tab_bottom_right);
+            }
+         }
 
         // Deal with focus, as we don't want the focus to go by default
         // to a tab other than the current tab
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index b217052..10ec6ca 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -4608,9 +4608,7 @@
                 mInput.onKeyDown(this, (Editable)mText, keyCode, down);
                 mInput.onKeyUp(this, (Editable)mText, keyCode, up);
             }
-            if (mError != null && !mErrorWasChanged) {
-                setError(null, null);
-            }
+            hideErrorIfUnchanged();
 
         } else if (which == 2) {
             mMovement.onKeyUp(this, (Spannable)mText, keyCode, up);
@@ -4731,13 +4729,7 @@
         }
 
         if (mInput != null) {
-            /*
-             * Keep track of what the error was before doing the input
-             * so that if an input filter changed the error, we leave
-             * that error showing.  Otherwise, we take down whatever
-             * error was showing when the user types something.
-             */
-            mErrorWasChanged = false;
+            resetErrorChangedFlag();
 
             boolean doDown = true;
             if (otherEvent != null) {
@@ -4745,9 +4737,7 @@
                     beginBatchEdit();
                     boolean handled = mInput.onKeyOther(this, (Editable) mText,
                             otherEvent);
-                    if (mError != null && !mErrorWasChanged) {
-                        setError(null, null);
-                    }
+                    hideErrorIfUnchanged();
                     doDown = false;
                     if (handled) {
                         return -1;
@@ -4764,9 +4754,7 @@
                 beginBatchEdit();
                 if (mInput.onKeyDown(this, (Editable) mText, keyCode, event)) {
                     endBatchEdit();
-                    if (mError != null && !mErrorWasChanged) {
-                        setError(null, null);
-                    }
+                    hideErrorIfUnchanged();
                     return 1;
                 }
                 endBatchEdit();
@@ -4800,6 +4788,30 @@
         return 0;
     }
 
+    /**
+     * Resets the mErrorWasChanged flag, so that future calls to {@link #setError(CharSequence)}
+     * can be recorded.
+     * @hide
+     */
+    public void resetErrorChangedFlag() {
+        /*
+         * Keep track of what the error was before doing the input
+         * so that if an input filter changed the error, we leave
+         * that error showing.  Otherwise, we take down whatever
+         * error was showing when the user types something.
+         */
+        mErrorWasChanged = false;
+    }
+
+    /**
+     * @hide
+     */
+    public void hideErrorIfUnchanged() {
+        if (mError != null && !mErrorWasChanged) {
+            setError(null, null);
+        }
+    }
+
     @Override
     public boolean onKeyUp(int keyCode, KeyEvent event) {
         if (!isEnabled()) {
diff --git a/core/java/com/android/internal/statusbar/IStatusBar.aidl b/core/java/com/android/internal/statusbar/IStatusBar.aidl
index 1cc068f..5fcd0c2 100644
--- a/core/java/com/android/internal/statusbar/IStatusBar.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBar.aidl
@@ -32,6 +32,6 @@
     void animateCollapse();
     void setLightsOn(boolean on);
     void setMenuKeyVisible(boolean visible);
-    void setIMEButtonVisible(in IBinder token, boolean visible);
+    void setImeWindowStatus(in IBinder token, int vis, int backDisposition);
 }
 
diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
index d1ea52e..c62aeb0 100644
--- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
@@ -31,7 +31,7 @@
     void setIconVisibility(String slot, boolean visible);
     void removeIcon(String slot);
     void setMenuKeyVisible(boolean visible);
-    void setIMEButtonVisible(in IBinder token, boolean visible);
+    void setImeWindowStatus(in IBinder token, int vis, int backDisposition);
 
     // ---- Methods below are for use by the status bar policy services ----
     // You need the STATUS_BAR_SERVICE permission
diff --git a/core/java/com/android/internal/view/IInputMethodManager.aidl b/core/java/com/android/internal/view/IInputMethodManager.aidl
index b2fbd3a7..611d987 100644
--- a/core/java/com/android/internal/view/IInputMethodManager.aidl
+++ b/core/java/com/android/internal/view/IInputMethodManager.aidl
@@ -59,7 +59,7 @@
     void hideMySoftInput(in IBinder token, int flags);
     void showMySoftInput(in IBinder token, int flags);
     void updateStatusIcon(in IBinder token, String packageName, int iconId);
-    void setIMEButtonVisible(in IBinder token, boolean visible);
+    void setImeWindowStatus(in IBinder token, int vis, int backDisposition);
     InputMethodSubtype getCurrentInputMethodSubtype();
     boolean setCurrentInputMethodSubtype(in InputMethodSubtype subtype);
     boolean switchToLastInputMethod(in IBinder token);
diff --git a/core/java/com/android/internal/widget/EditableInputConnection.java b/core/java/com/android/internal/widget/EditableInputConnection.java
index e992e7c..9f9f020 100644
--- a/core/java/com/android/internal/widget/EditableInputConnection.java
+++ b/core/java/com/android/internal/widget/EditableInputConnection.java
@@ -138,9 +138,9 @@
             return super.commitText(text, newCursorPosition);
         }
 
-        CharSequence errorBefore = mTextView.getError();
+        mTextView.resetErrorChangedFlag();
         boolean success = super.commitText(text, newCursorPosition);
-        CharSequence errorAfter = mTextView.getError();
+        mTextView.hideErrorIfUnchanged();
 
         return success;
     }
diff --git a/core/res/res/drawable-hdpi/stat_notify_chat.png b/core/res/res/drawable-hdpi/stat_notify_chat.png
index b2e65c6..9c713c8 100644
--- a/core/res/res/drawable-hdpi/stat_notify_chat.png
+++ b/core/res/res/drawable-hdpi/stat_notify_chat.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/stat_notify_chat.png b/core/res/res/drawable-mdpi/stat_notify_chat.png
index f98b032..91b4290 100644
--- a/core/res/res/drawable-mdpi/stat_notify_chat.png
+++ b/core/res/res/drawable-mdpi/stat_notify_chat.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png
index e936fac..8cc5535 100644
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png
+++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png
index eb626df..4441ba2 100644
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png
+++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png
index d6bc7d3..73891a3 100644
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png
+++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png
index 8c8f25d..db68eea 100644
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png
+++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png
index 661cc2f..7af6921 100644
--- a/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png
+++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png
index b2d7186..22adc67 100644
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png
+++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png
index 36ab1ff..c434d12 100644
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png
+++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png
index a14b3c7..daf3b84 100644
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png
+++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png
index 81a66c1..7b097b1 100644
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png
+++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png
Binary files differ
diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png
index a286ac6..8daef7c 100644
--- a/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png
+++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png
Binary files differ
diff --git a/core/res/res/layout-xlarge/status_bar_latest_event_content.xml b/core/res/res/layout-xlarge/status_bar_latest_event_content.xml
index 1a3ee82..676c38b 100644
--- a/core/res/res/layout-xlarge/status_bar_latest_event_content.xml
+++ b/core/res/res/layout-xlarge/status_bar_latest_event_content.xml
@@ -23,14 +23,14 @@
             android:singleLine="true"
             android:ellipsize="marquee"
             android:fadingEdge="horizontal"
-            android:layout_marginBottom="-4dp"
+            android:layout_marginBottom="-3dp"
             />
         <TextView android:id="@+id/text"
             android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_weight="1"
-            android:layout_marginTop="-4dp"
+            android:layout_marginTop="-2dp"
             android:singleLine="true"
             android:ellipsize="marquee"
             android:fadingEdge="horizontal"
diff --git a/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml b/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml
index e9b106d..ebdaaa3 100644
--- a/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml
+++ b/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml
@@ -17,40 +17,34 @@
             android:singleLine="true"
             android:ellipsize="marquee"
             android:fadingEdge="horizontal"
-            android:layout_marginBottom="-4dp"
+            android:layout_marginBottom="-3dp"
             />
         <TextView android:id="@+id/text"
             android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_weight="1"
-            android:layout_marginTop="-4dp"
+            android:layout_marginTop="-2dp"
             android:singleLine="true"
             android:ellipsize="marquee"
             android:fadingEdge="horizontal"
             />
     </LinearLayout>
-    <RelativeLayout
+    <TextView android:id="@+id/info"
+        android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info"
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
-        >
-        <TextView android:id="@+id/info"
-            android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:singleLine="true"
-            android:gravity="center_vertical"
-            android:layout_alignParentLeft="true"
-            android:paddingLeft="8dp"
-            />
-        <ImageView android:id="@+id/icon"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentBottom="true"
-            android:layout_alignRight="@id/info"
-            android:layout_marginBottom="8dip"
-            android:scaleType="center"
-            />
-    </RelativeLayout>
+        android:singleLine="true"
+        android:gravity="center_vertical"
+        android:paddingLeft="4dp"
+        android:paddingRight="4dp"
+        />
+    <ImageView android:id="@+id/icon"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="bottom"
+        android:layout_marginBottom="13dip"
+        android:scaleType="center"
+        />
 </LinearLayout>
 
diff --git a/core/res/res/layout-xlarge/status_bar_latest_event_ticker_large_icon.xml b/core/res/res/layout-xlarge/status_bar_latest_event_ticker_large_icon.xml
index b382c55..ff0f7d4 100644
--- a/core/res/res/layout-xlarge/status_bar_latest_event_ticker_large_icon.xml
+++ b/core/res/res/layout-xlarge/status_bar_latest_event_ticker_large_icon.xml
@@ -37,11 +37,13 @@
         android:layout_marginTop="-10dp"
         />
     <ImageView android:id="@+id/icon"
-        android:layout_width="48dp"
-        android:layout_height="32dp"
-        android:layout_gravity="top"
-        android:layout_marginTop="6dp"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="bottom"
+        android:layout_marginBottom="13dip"
         android:scaleType="center"
+        android:layout_marginRight="4dip"
+        android:layout_marginLeft="16dip"
         />
 </LinearLayout>
 
diff --git a/core/res/res/layout/action_menu_item_layout.xml b/core/res/res/layout/action_menu_item_layout.xml
index 4477df7..15dfea3 100644
--- a/core/res/res/layout/action_menu_item_layout.xml
+++ b/core/res/res/layout/action_menu_item_layout.xml
@@ -40,9 +40,9 @@
             android:layout_height="wrap_content"
             android:layout_gravity="center"
             android:visibility="gone"
-            android:textAppearance="?attr/textAppearanceMedium"
+            android:textAppearance="?attr/actionMenuTextAppearance"
             style="?attr/buttonStyleSmall"
-            android:textColor="?attr/textColorPrimary"
+            android:textColor="?attr/actionMenuTextColor"
             android:background="@null"
             android:paddingLeft="4dip"
             android:paddingRight="4dip" />
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index 0dea8f4..7c20a06 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index 7c88a05..58becbb 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index fe1692a..5a5e5ed 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index a6cc5cd..de34732 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index 62ff434..d14de34 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index 5b29408..db8c751 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -146,13 +146,12 @@
     <string name="global_action_lock" msgid="2844945191792119712">"Display-Sperre"</string>
     <string name="global_action_power_off" msgid="4471879440839879722">"Ausschalten"</string>
     <string name="global_action_toggle_silent_mode" msgid="8219525344246810925">"Lautlos"</string>
-    <string name="global_action_silent_mode_on_status" msgid="3289841937003758806">"Ton ist aus"</string>
-    <string name="global_action_silent_mode_off_status" msgid="1506046579177066419">"Ton ist AN"</string>
+    <string name="global_action_silent_mode_on_status" msgid="3289841937003758806">"Ton ist AUS."</string>
+    <string name="global_action_silent_mode_off_status" msgid="1506046579177066419">"Ton ist AN."</string>
     <string name="global_actions_toggle_airplane_mode" msgid="5884330306926307456">"Flugmodus"</string>
-    <string name="global_actions_airplane_mode_on_status" msgid="2719557982608919750">"Flugmodus ist AN"</string>
-    <string name="global_actions_airplane_mode_off_status" msgid="5075070442854490296">"Flugmodus ist aus"</string>
-    <!-- no translation found for status_bar_notification_info_overflow (5833510281787786290) -->
-    <skip />
+    <string name="global_actions_airplane_mode_on_status" msgid="2719557982608919750">"Flugmodus ist AN."</string>
+    <string name="global_actions_airplane_mode_off_status" msgid="5075070442854490296">"Flugmodus ist AUS."</string>
+    <string name="status_bar_notification_info_overflow" msgid="5833510281787786290">"100 +"</string>
     <string name="safeMode" msgid="2788228061547930246">"Abgesicherter Modus"</string>
     <string name="android_system_label" msgid="6577375335728551336">"Android System"</string>
     <string name="permgrouplab_costMoney" msgid="5429808217861460401">"Kostenpflichtige Dienste"</string>
@@ -469,8 +468,8 @@
     <string name="permlab_sdcardWrite" product="default" msgid="8079403759001777291">"SD-Karten-Inhalt ändern/löschen"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6594393334785738252">"Ermöglicht der Anwendung Schreiben in USB-Speicher"</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="6643963204976471878">"Ermöglicht einer Anwendung, auf die SD-Karte zu schreiben"</string>
-    <!-- outdated translation 5585262071354704256 -->     <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"Inhalt des internen Medienspeichers ändern/löschen"</string>
-    <!-- outdated translation 2372999661142345443 -->     <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"Ermöglicht einer Anwendung, den Inhalt des internen Medienspeichers zu verändern"</string>
+    <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"Intern. Mediensp. änd./löschen"</string>
+    <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"Ermöglicht es einer Anwendung, den Inhalt des internen Medienspeichers zu ändern"</string>
     <string name="permlab_cache_filesystem" msgid="5656487264819669824">"Zugriff auf das Cache-Dateisystem"</string>
     <string name="permdesc_cache_filesystem" msgid="1624734528435659906">"Gewährt einer Anwendung Lese- und Schreibzugriff auf das Cache-Dateisystem."</string>
     <string name="permlab_use_sip" msgid="5986952362795870502">"Internetanrufe tätigen/annehmen"</string>
@@ -879,14 +878,14 @@
     <string name="sms_control_no" msgid="1715320703137199869">"Abbrechen"</string>
     <string name="time_picker_dialog_title" msgid="8349362623068819295">"Uhrzeit festlegen"</string>
     <string name="date_picker_dialog_title" msgid="5879450659453782278">"Datum festlegen"</string>
-    <string name="date_time_set" msgid="5777075614321087758">"Einstellen"</string>
+    <string name="date_time_set" msgid="5777075614321087758">"Speichern"</string>
     <string name="default_permission_group" msgid="2690160991405646128">"Standard"</string>
     <string name="no_permissions" msgid="7283357728219338112">"Keine Berechtigungen erforderlich"</string>
     <string name="perms_hide" msgid="7283915391320676226"><b>"Ausblenden"</b></string>
     <string name="perms_show_all" msgid="2671791163933091180"><b>"Alle anzeigen"</b></string>
     <string name="usb_storage_activity_title" msgid="2399289999608900443">"USB-Massenspeicher"</string>
     <string name="usb_storage_title" msgid="5901459041398751495">"USB-Verbindung"</string>
-    <string name="usb_storage_message" product="nosdcard" msgid="6631094834151575841">"Sie haben Ihr Telefon über USB mit Ihrem Computer verbunden. Berühren Sie die Schaltfläche unten, wenn Sie Dateien von Ihrem Computer in den USB-Speicher Ihres Android-Geräts und umgekehrt kopieren möchten."</string>
+    <string name="usb_storage_message" product="nosdcard" msgid="6631094834151575841">"Sie haben eine USB-Verbindung mit Ihrem Computer hergestellt. Berühren Sie die Schaltfläche unten, wenn Sie Dateien von Ihrem Computer in den USB-Speicher Ihres Android-Geräts und umgekehrt kopieren möchten."</string>
     <string name="usb_storage_message" product="default" msgid="4510858346516069238">"Sie haben Ihr Telefon über USB mit Ihrem Computer verbunden. Berühren Sie die Schaltfläche unten, wenn Sie Dateien von Ihrem Computer auf die SD-Karte Ihres Android-Geräts und umgekehrt kopieren möchten."</string>
     <string name="usb_storage_button_mount" msgid="1052259930369508235">"USB-Speicher aktivieren"</string>
     <string name="usb_storage_error_message" product="nosdcard" msgid="3276413764430468454">"Bei der Verwendung Ihres USB-Speichers als USB-Massenspeicher ist ein Problem aufgetreten."</string>
@@ -1033,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index 8aa892d..4561351 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index 571c25a..988bf96 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index 23cf74e..00af9c6 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -1027,4 +1027,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index a60e4da..16fbaa2f 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index 033287f..c4347fb 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index 899bf42..c27984d 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index 976834b..d7c4a13 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -151,8 +151,7 @@
     <string name="global_actions_toggle_airplane_mode" msgid="5884330306926307456">"Mode Avion"</string>
     <string name="global_actions_airplane_mode_on_status" msgid="2719557982608919750">"Le mode Avion est activé."</string>
     <string name="global_actions_airplane_mode_off_status" msgid="5075070442854490296">"Le mode Avion est désactivé."</string>
-    <!-- no translation found for status_bar_notification_info_overflow (5833510281787786290) -->
-    <skip />
+    <string name="status_bar_notification_info_overflow" msgid="5833510281787786290">"100 +"</string>
     <string name="safeMode" msgid="2788228061547930246">"Mode sécurisé"</string>
     <string name="android_system_label" msgid="6577375335728551336">"Système Android"</string>
     <string name="permgrouplab_costMoney" msgid="5429808217861460401">"Services payants"</string>
@@ -469,8 +468,8 @@
     <string name="permlab_sdcardWrite" product="default" msgid="8079403759001777291">"Modifier/supprimer le contenu de la carte SD"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6594393334785738252">"Autorise une application à écrire sur la mémoire USB."</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="6643963204976471878">"Autorise une application à écrire sur la carte SD."</string>
-    <!-- outdated translation 5585262071354704256 -->     <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"modifier/supprimer le contenu des mémoires de stockage internes"</string>
-    <!-- outdated translation 2372999661142345443 -->     <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"Permet à une application de modifier le contenu de la mémoire de stockage interne."</string>
+    <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"modif./suppr. contenu mémoire interne support"</string>
+    <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"Permet à une application de modifier le contenu de la mémoire de stockage interne du support."</string>
     <string name="permlab_cache_filesystem" msgid="5656487264819669824">"accéder au système de fichiers en cache"</string>
     <string name="permdesc_cache_filesystem" msgid="1624734528435659906">"Permet à une application de lire et d\'écrire dans le système de fichiers en cache."</string>
     <string name="permlab_use_sip" msgid="5986952362795870502">"effectuer/recevoir des appels Internet"</string>
@@ -1033,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index edf7bf7..b8f1e75 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -151,8 +151,7 @@
     <string name="global_actions_toggle_airplane_mode" msgid="5884330306926307456">"Način rada u zrakoplovu"</string>
     <string name="global_actions_airplane_mode_on_status" msgid="2719557982608919750">"Uključen je način rada u zrakoplovu"</string>
     <string name="global_actions_airplane_mode_off_status" msgid="5075070442854490296">"Isključen je način rada u zrakoplovu"</string>
-    <!-- no translation found for status_bar_notification_info_overflow (5833510281787786290) -->
-    <skip />
+    <string name="status_bar_notification_info_overflow" msgid="5833510281787786290">"100+"</string>
     <string name="safeMode" msgid="2788228061547930246">"Siguran način rada"</string>
     <string name="android_system_label" msgid="6577375335728551336">"Sustav Android"</string>
     <string name="permgrouplab_costMoney" msgid="5429808217861460401">"Usluge koje se plaćaju"</string>
@@ -469,8 +468,8 @@
     <string name="permlab_sdcardWrite" product="default" msgid="8079403759001777291">"izmjena/brisanje sadržaja SD kartice"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6594393334785738252">"Omog. pisanje na USB memoriju."</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="6643963204976471878">"Aplikaciji omogućuje pisanje na SD karticu."</string>
-    <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"izmijeni/briši sadržaje unutarnjih medija pohrane"</string>
-    <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"Omogućuje aplikaciji izmjenu sadržaja pohrane unutarnjih medija."</string>
+    <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"izmijeni/izbriši sadržaj pohranjen na internim medijima"</string>
+    <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"Aplikaciji omogućuje izmjenu sadržaja pohranjenog na internim medijima."</string>
     <string name="permlab_cache_filesystem" msgid="5656487264819669824">"pristup sustavu datoteka predmemorije"</string>
     <string name="permdesc_cache_filesystem" msgid="1624734528435659906">"Aplikaciji omogućuje čitanje i pisanje u sustav datoteka predmemorije."</string>
     <string name="permlab_use_sip" msgid="5986952362795870502">"zovi/primaj internetske pozive"</string>
@@ -1033,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index 7502e0a..541945b 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index d80a2a4..97fa660 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index cf577f9..12caad4 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index 9ba56ba..14f8ba3 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index d4daf90..8cf168d 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -151,8 +151,7 @@
     <string name="global_actions_toggle_airplane_mode" msgid="5884330306926307456">"機内モード"</string>
     <string name="global_actions_airplane_mode_on_status" msgid="2719557982608919750">"機内モードON"</string>
     <string name="global_actions_airplane_mode_off_status" msgid="5075070442854490296">"機内モードOFF"</string>
-    <!-- no translation found for status_bar_notification_info_overflow (5833510281787786290) -->
-    <skip />
+    <string name="status_bar_notification_info_overflow" msgid="5833510281787786290">"100超"</string>
     <string name="safeMode" msgid="2788228061547930246">"セーフモード"</string>
     <string name="android_system_label" msgid="6577375335728551336">"Androidシステム"</string>
     <string name="permgrouplab_costMoney" msgid="5429808217861460401">"料金の発生するサービス"</string>
@@ -469,8 +468,8 @@
     <string name="permlab_sdcardWrite" product="default" msgid="8079403759001777291">"SDカードのコンテンツを修正/削除する"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6594393334785738252">"USBストレージへの書き込みをアプリケーションに許可します。"</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="6643963204976471878">"SDカードへの書き込みをアプリケーションに許可します。"</string>
-    <!-- outdated translation 5585262071354704256 -->     <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"内部メディアストレージのコンテンツの変更/削除"</string>
-    <!-- outdated translation 2372999661142345443 -->     <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"内部メディアストレージのコンテンツの変更をアプリケーションに許可します。"</string>
+    <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"USBストレージの内容の変更/削除"</string>
+    <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"内部メディアストレージの内容の変更をアプリケーションに許可します。"</string>
     <string name="permlab_cache_filesystem" msgid="5656487264819669824">"キャッシュファイルシステムにアクセス"</string>
     <string name="permdesc_cache_filesystem" msgid="1624734528435659906">"キャッシュファイルシステムへの読み書きをアプリケーションに許可します。"</string>
     <string name="permlab_use_sip" msgid="5986952362795870502">"インターネット通話の発着信"</string>
@@ -1033,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index f0d0418..5926677 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -403,7 +403,7 @@
     <string name="permdesc_setWallpaper" msgid="6417041752170585837">"애플리케이션이 시스템 배경화면을 설정할 수 있도록 합니다."</string>
     <string name="permlab_setWallpaperHints" msgid="3600721069353106851">"배경화면 크기 힌트 설정"</string>
     <string name="permdesc_setWallpaperHints" msgid="6019479164008079626">"애플리케이션이 시스템 배경화면 크기 힌트를 설정할 수 있도록 합니다."</string>
-    <string name="permlab_masterClear" msgid="2315750423139697397">"시스템을 기본값으로 재설정"</string>
+    <string name="permlab_masterClear" msgid="2315750423139697397">"시스템 초기화"</string>
     <string name="permdesc_masterClear" msgid="5033465107545174514">"애플리케이션이 모든 데이터, 구성 및 설치된 애플리케이션을 지워서 시스템을 완전히 초기화할 수 있도록 합니다."</string>
     <string name="permlab_setTime" msgid="2021614829591775646">"시간 설정"</string>
     <string name="permdesc_setTime" product="tablet" msgid="209693136361006073">"애플리케이션이 태블릿 시계의 시간을 변경할 수 있도록 합니다."</string>
@@ -975,7 +975,7 @@
     <string name="l2tp_ipsec_crt_vpn_description" msgid="5382714073103653577">"인증서 기반 L2TP/IPSec VPN"</string>
     <string name="upload_file" msgid="2897957172366730416">"파일 선택"</string>
     <string name="no_file_chosen" msgid="6363648562170759465">"파일을 선택하지 않았습니다."</string>
-    <string name="reset" msgid="2448168080964209908">"재설정"</string>
+    <string name="reset" msgid="2448168080964209908">"초기화"</string>
     <string name="submit" msgid="1602335572089911941">"제출"</string>
     <string name="car_mode_disable_notification_title" msgid="3164768212003864316">"운전모드 사용"</string>
     <string name="car_mode_disable_notification_message" msgid="668663626721675614">"운전모드를 종료하려면 선택하세요."</string>
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index 4fbe3e5..2059300 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index c587a64..4f5af05 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index e965688..b68014a 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index 48f5bb4..4bf059c 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index 91b02ac..8a1541d 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -979,7 +979,7 @@
     <string name="submit" msgid="1602335572089911941">"Prześlij"</string>
     <string name="car_mode_disable_notification_title" msgid="3164768212003864316">"Tryb samochodowy włączony"</string>
     <string name="car_mode_disable_notification_message" msgid="668663626721675614">"Wybierz, aby zakończyć tryb samochodowy."</string>
-    <string name="tethered_notification_title" msgid="3146694234398202601">"Jest aktywne powiązanie lub punkt dostępu"</string>
+    <string name="tethered_notification_title" msgid="3146694234398202601">"Aktywny tethering lub punkt dostępu"</string>
     <string name="tethered_notification_message" msgid="3067108323903048927">"Dotknij, aby skonfigurować"</string>
     <string name="back_button_label" msgid="2300470004503343439">"Wróć"</string>
     <string name="next_button_label" msgid="1080555104677992408">"Dalej"</string>
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index d555fb4..509c8b1 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index 9f44c78..0a2581e 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -151,8 +151,7 @@
     <string name="global_actions_toggle_airplane_mode" msgid="5884330306926307456">"Modo de avião"</string>
     <string name="global_actions_airplane_mode_on_status" msgid="2719557982608919750">"Modo de avião ATIVADO"</string>
     <string name="global_actions_airplane_mode_off_status" msgid="5075070442854490296">"Modo de avião DESATIVADO"</string>
-    <!-- no translation found for status_bar_notification_info_overflow (5833510281787786290) -->
-    <skip />
+    <string name="status_bar_notification_info_overflow" msgid="5833510281787786290">"100 +"</string>
     <string name="safeMode" msgid="2788228061547930246">"Modo de segurança"</string>
     <string name="android_system_label" msgid="6577375335728551336">"Sistema Android"</string>
     <string name="permgrouplab_costMoney" msgid="5429808217861460401">"Serviços que geram gastos"</string>
@@ -469,8 +468,8 @@
     <string name="permlab_sdcardWrite" product="default" msgid="8079403759001777291">"modificar/excluir conteúdo do cartão SD"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6594393334785738252">"Perm. aplic. grave arm. USB."</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="6643963204976471878">"Permite que um aplicativo grave no cartão SD."</string>
-    <!-- outdated translation 5585262071354704256 -->     <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"modificar/excluir o conteúdo de armazenamento de mídia interno"</string>
-    <!-- outdated translation 2372999661142345443 -->     <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"Permite que um aplicativo modifique o conteúdo do armazenamento de mídia interno."</string>
+    <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"modificar/excluir conteúdos de armazenamento de mídia internos"</string>
+    <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"Permite que um aplicativo modifique os conteúdos de armazenamento de mídia internos."</string>
     <string name="permlab_cache_filesystem" msgid="5656487264819669824">"acessar o sistema de arquivos de cache"</string>
     <string name="permdesc_cache_filesystem" msgid="1624734528435659906">"Permite que um aplicativo leia e grave no sistema de arquivos de cache."</string>
     <string name="permlab_use_sip" msgid="5986952362795870502">"fazer/receber chamadas pela internet"</string>
@@ -820,7 +819,7 @@
     <string name="capital_on" msgid="1544682755514494298">"ATIVADO"</string>
     <string name="capital_off" msgid="6815870386972805832">"DESATIVADO"</string>
     <string name="whichApplication" msgid="4533185947064773386">"Complete a ação usando"</string>
-    <string name="alwaysUse" msgid="4583018368000610438">"Use o como padrão para esta ação."</string>
+    <string name="alwaysUse" msgid="4583018368000610438">"Usar como padrão para esta ação."</string>
     <string name="clearDefaultHintMsg" msgid="4815455344600932173">"Limpar o padrão em Configurações da página inicial &gt; Aplicativos &gt; Gerenciar aplicativos."</string>
     <string name="chooseActivity" msgid="1009246475582238425">"Selecionar uma ação"</string>
     <string name="noApplications" msgid="1691104391758345586">"Nenhum aplicativo pode realizar esta ação."</string>
@@ -1033,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-rm/strings.xml b/core/res/res/values-rm/strings.xml
index 54fb39e..e28b304 100644
--- a/core/res/res/values-rm/strings.xml
+++ b/core/res/res/values-rm/strings.xml
@@ -1105,4 +1105,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index a06b86d..f1dc60d 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index bfe9c8f..40e29cf 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index 04567d0..0e4331f 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index f53adc8..8608525 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index 5da258c..11e6247 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index 51311a9..dcb10a7 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index 27e699e..a3f1900 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index 1a8e2c1..5c97ea9 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index a1aef7c..811142e 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index 7203298..8c676dd 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index 6dd2506..6488871 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-xlarge/styles.xml b/core/res/res/values-xlarge/styles.xml
index ed05cb1..dd78920 100644
--- a/core/res/res/values-xlarge/styles.xml
+++ b/core/res/res/values-xlarge/styles.xml
@@ -30,6 +30,7 @@
     </style>
     <style name="TextAppearance.StatusBar.EventContent">
         <item name="android:textColor">#ff999999</item>
+        <item name="android:textSize">14sp</item>
     </style>
     <style name="TextAppearance.StatusBar.EventContent.Title">
         <item name="android:textColor">?android:attr/textColorPrimary</item>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index c57ca62..7489de7 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -151,8 +151,7 @@
     <string name="global_actions_toggle_airplane_mode" msgid="5884330306926307456">"飞行模式"</string>
     <string name="global_actions_airplane_mode_on_status" msgid="2719557982608919750">"已开启飞行模式"</string>
     <string name="global_actions_airplane_mode_off_status" msgid="5075070442854490296">"已关闭飞行模式"</string>
-    <!-- no translation found for status_bar_notification_info_overflow (5833510281787786290) -->
-    <skip />
+    <string name="status_bar_notification_info_overflow" msgid="5833510281787786290">"100+"</string>
     <string name="safeMode" msgid="2788228061547930246">"安全模式"</string>
     <string name="android_system_label" msgid="6577375335728551336">"Android 系统"</string>
     <string name="permgrouplab_costMoney" msgid="5429808217861460401">"需要您付费的服务"</string>
@@ -469,8 +468,8 @@
     <string name="permlab_sdcardWrite" product="default" msgid="8079403759001777291">"修改/删除 SD 卡中的内容"</string>
     <string name="permdesc_sdcardWrite" product="nosdcard" msgid="6594393334785738252">"允许应用程序写入 USB 存储设备。"</string>
     <string name="permdesc_sdcardWrite" product="default" msgid="6643963204976471878">"允许应用程序写入 SD 卡。"</string>
-    <!-- outdated translation 5585262071354704256 -->     <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"修改/删除内部媒体存储设备内容"</string>
-    <!-- outdated translation 2372999661142345443 -->     <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"允许应用程序修改内部媒体存储设备中的内容。"</string>
+    <string name="permlab_mediaStorageWrite" product="default" msgid="6859839199706879015">"修改/删除内部媒体存储设备的内容"</string>
+    <string name="permdesc_mediaStorageWrite" product="default" msgid="8232008512478316233">"允许应用程序修改内部媒体存储设备的内容。"</string>
     <string name="permlab_cache_filesystem" msgid="5656487264819669824">"访问缓存文件系统"</string>
     <string name="permdesc_cache_filesystem" msgid="1624734528435659906">"允许应用程序读取和写入缓存文件系统。"</string>
     <string name="permlab_use_sip" msgid="5986952362795870502">"拨打/接听互联网通话"</string>
@@ -1033,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index 37afec8..194932c 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -1032,4 +1032,8 @@
     <skip />
     <!-- no translation found for choose_account_label (4191313562041125787) -->
     <skip />
+    <!-- no translation found for number_picker_increment_button (4830170763103463443) -->
+    <skip />
+    <!-- no translation found for number_picker_decrement_button (2576606679160067262) -->
+    <skip />
 </resources>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 4a56532..f980970 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -587,7 +587,11 @@
         <attr name="actionBarSize" format="dimension" >
             <enum name="wrap_content" value="0" />
         </attr>
-
+        <!-- TextAppearance style that will be applied to text that
+             appears within action menu items. -->
+        <attr name="actionMenuTextAppearance" format="reference" />
+        <!-- Color for text that appears within action menu items. -->
+        <attr name="actionMenuTextColor" format="color|reference" />
 
         <!-- =================== -->
         <!-- Action mode styles  -->
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 957707d..02b42d0 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1430,6 +1430,8 @@
   <public type="attr" name="calendarViewStyle" />
   <public type="attr" name="textEditSidePasteWindowLayout" />
   <public type="attr" name="textEditSideNoPasteWindowLayout" />
+  <public type="attr" name="actionMenuTextAppearance" />
+  <public type="attr" name="actionMenuTextColor" />
 
   <!-- A simple fade-in animation. -->
   <public type="animator" name="fade_in" id="0x010b0000" />
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index b828318..f54f8cc 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -224,7 +224,7 @@
         <item name="android:textStyle">bold</item>
     </style>
     <style name="TextAppearance.StatusBar.EventContent">
-        <item name="android:textSize">10sp</item>
+        <item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
         <item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
     </style>
     <style name="TextAppearance.StatusBar.EventContent.Title">
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index c5ae77f..38b068e 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -270,6 +270,8 @@
         <item name="actionBarStyle">@android:style/Widget.ActionBar</item>
         <item name="actionBarSize">56dip</item>
         <item name="actionModePopupWindowStyle">?android:attr/popupWindowStyle</item>
+        <item name="actionMenuTextAppearance">?android:attr/textAppearanceMedium</item>
+        <item name="actionMenuTextColor">?android:attr/textColorPrimary</item>
 
         <item name="dividerVertical">@drawable/divider_vertical_dark</item>
         <item name="dividerHorizontal">@drawable/divider_vertical_dark</item>
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index b739d83..d8a7f9d 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -1690,7 +1690,7 @@
         int contextLen = contextEnd - contextStart;
         char[] buf = TemporaryBuffer.obtain(contextLen);
         TextUtils.getChars(text, contextStart, contextEnd, buf, 0);
-        int result = getTextRunCursor(buf, 0, contextLen, flags, offset, cursorOpt);
+        int result = getTextRunCursor(buf, 0, contextLen, flags, offset - contextStart, cursorOpt);
         TemporaryBuffer.recycle(buf);
         return result;
     }
diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java
index 64c209a..4c659d4 100644
--- a/graphics/java/android/graphics/SurfaceTexture.java
+++ b/graphics/java/android/graphics/SurfaceTexture.java
@@ -24,9 +24,9 @@
 /**
  * Captures frames from an image stream as an OpenGL ES texture.
  *
- * <p>The image stream may come from either video playback or camera preview.  A SurfaceTexture may
- * be used in place of a SurfaceHolder when specifying the output destination of a MediaPlayer or
- * Camera object.  This will cause all the frames from that image stream to be sent to the
+ * <p>The image stream may come from either camera preview.  A SurfaceTexture may be used in place
+ * of a SurfaceHolder when specifying the output destination of a {@link android.hardware.Camera}
+ * object.  Doing so will cause all the frames from the image stream to be sent to the
  * SurfaceTexture object rather than to the device's display.  When {@link #updateTexImage} is
  * called, the contents of the texture object specified when the SurfaceTexture was created is
  * updated to contain the most recent image from the image stream.  This may cause some frames of
@@ -34,6 +34,11 @@
  *
  * <p>The texture object uses the GL_TEXTURE_EXTERNAL_OES texture target, which is defined by the
  * OES_EGL_image_external OpenGL ES extension.  This limits how the texture may be used.
+ *
+ * <p>SurfaceTexture objects may be created on any thread.  {@link #updateTexImage} may only be
+ * called on the thread with the OpenGL ES context that contains the texture object.  The
+ * frame-available callback is called on an arbitrary thread, so unless special care is taken {@link
+ * #updateTexImage} should not be called directly from the callback.
  */
 public class SurfaceTexture {
 
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp
index 0ed8be5..c0e4e0f 100644
--- a/libs/gui/SurfaceTextureClient.cpp
+++ b/libs/gui/SurfaceTextureClient.cpp
@@ -88,7 +88,7 @@
     int buf = -1;
     status_t err = mSurfaceTexture->dequeueBuffer(&buf);
     if (err < 0) {
-        LOGE("dequeueBuffer: ISurfaceTexture::dequeueBuffer failed: %d", err);
+        LOGV("dequeueBuffer: ISurfaceTexture::dequeueBuffer failed: %d", err);
         return err;
     }
     sp<GraphicBuffer>& gbuf(mSlots[buf]);
diff --git a/libs/rs/java/ModelViewer/src/com/android/modelviewer/scenegraph.rs b/libs/rs/java/ModelViewer/src/com/android/modelviewer/scenegraph.rs
index 3bee8d6..3679068 100644
--- a/libs/rs/java/ModelViewer/src/com/android/modelviewer/scenegraph.rs
+++ b/libs/rs/java/ModelViewer/src/com/android/modelviewer/scenegraph.rs
@@ -81,7 +81,7 @@
     rsgProgramVertexLoadModelMatrix(&robot2Ptr->globalMat);
     rsgDrawMesh(gTestMesh);
 
-    color(0.3f, 0.3f, 0.3f, 1.0f);
+    //color(0.3f, 0.3f, 0.3f, 1.0f);
     rsgDrawText("Renderscript transform test", 30, 695);
 
     rsgBindFont(gItalic);
diff --git a/libs/rs/java/Samples/src/com/android/samples/rslist.rs b/libs/rs/java/Samples/src/com/android/samples/rslist.rs
index 0baccb8..b79f4fc 100644
--- a/libs/rs/java/Samples/src/com/android/samples/rslist.rs
+++ b/libs/rs/java/Samples/src/com/android/samples/rslist.rs
@@ -44,7 +44,6 @@
 
     rsgFontColor(0.9f, 0.9f, 0.9f, 1.0f);
     rsgBindFont(gItalic);
-    color(0.2, 0.2, 0.2, 0);
 
     rs_allocation listAlloc;
     rsSetObject(&listAlloc, rsGetAllocation(gList));
diff --git a/libs/rs/java/Samples/src/com/android/samples/rsrenderstates.rs b/libs/rs/java/Samples/src/com/android/samples/rsrenderstates.rs
index a973167..42be4d8 100644
--- a/libs/rs/java/Samples/src/com/android/samples/rsrenderstates.rs
+++ b/libs/rs/java/Samples/src/com/android/samples/rsrenderstates.rs
@@ -407,7 +407,7 @@
     gVSConstants->light1_Diffuse = 1.0f;
     gVSConstants->light1_Specular = 0.7f;
     gVSConstants->light1_CosinePower = 25.0f;
-    rsAllocationMarkDirty(rsGetAllocation(gVSConstants));
+    rsgAllocationSyncAll(rsGetAllocation(gVSConstants));
 
     gVSConstants2->light_Posision[0] = light0Pos;
     gVSConstants2->light_Diffuse[0] = 1.0f;
@@ -417,7 +417,7 @@
     gVSConstants2->light_Diffuse[1] = 1.0f;
     gVSConstants2->light_Specular[1] = 0.7f;
     gVSConstants2->light_CosinePower[1] = 25.0f;
-    rsAllocationMarkDirty(rsGetAllocation(gVSConstants2));
+    rsgAllocationSyncAll(rsGetAllocation(gVSConstants2));
 
     // Update fragmetn shader constants
     // Set light 0 colors
@@ -426,14 +426,14 @@
     // Set light 1 colors
     gFSConstants->light1_DiffuseColor = light1DiffCol;
     gFSConstants->light1_SpecularColor = light1SpecCol;
-    rsAllocationMarkDirty(rsGetAllocation(gFSConstants));
+    rsgAllocationSyncAll(rsGetAllocation(gFSConstants));
 
     gFSConstants2->light_DiffuseColor[0] = light0DiffCol;
     gFSConstants2->light_SpecularColor[0] = light0SpecCol;
     // Set light 1 colors
     gFSConstants2->light_DiffuseColor[1] = light1DiffCol;
     gFSConstants2->light_SpecularColor[1] = light1SpecCol;
-    rsAllocationMarkDirty(rsGetAllocation(gFSConstants2));
+    rsgAllocationSyncAll(rsGetAllocation(gFSConstants2));
 }
 
 static void displayCustomShaderSamples() {
diff --git a/libs/rs/java/tests/src/com/android/rs/test/rslist.rs b/libs/rs/java/tests/src/com/android/rs/test/rslist.rs
index f354a72..67c2b86 100644
--- a/libs/rs/java/tests/src/com/android/rs/test/rslist.rs
+++ b/libs/rs/java/tests/src/com/android/rs/test/rslist.rs
@@ -45,7 +45,6 @@
 
     rsgFontColor(0.9f, 0.9f, 0.9f, 1.0f);
     rsgBindFont(gFont);
-    color(0.2, 0.2, 0.2, 0);
 
     rs_allocation listAlloc;
     rsSetObject(&listAlloc, rsGetAllocation(gList));
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp
index 41c9fe2..c598f03 100644
--- a/libs/rs/rsAllocation.cpp
+++ b/libs/rs/rsAllocation.cpp
@@ -679,6 +679,7 @@
 void rsi_AllocationSyncAll(Context *rsc, RsAllocation va, RsAllocationUsageType src) {
     Allocation *a = static_cast<Allocation *>(va);
     a->syncAll(rsc, src);
+    a->sendDirty();
 }
 
 void rsi_AllocationGenerateMipmaps(Context *rsc, RsAllocation va) {
diff --git a/libs/rs/scriptc/rs_core.rsh b/libs/rs/scriptc/rs_core.rsh
index e32d4351..464e1d9 100644
--- a/libs/rs/scriptc/rs_core.rsh
+++ b/libs/rs/scriptc/rs_core.rsh
@@ -3,93 +3,227 @@
 
 #define _RS_RUNTIME extern
 
-// Debugging, print to the LOG a description string and a value.
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, float);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, float, float);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, float, float, float);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, float, float, float, float);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, double);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, const rs_matrix4x4 *);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, const rs_matrix3x3 *);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, const rs_matrix2x2 *);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, int);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, uint);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, long);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, unsigned long);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, long long);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, unsigned long long);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 extern void __attribute__((overloadable))
     rsDebug(const char *, const void *);
 #define RS_DEBUG(a) rsDebug(#a, a)
 #define RS_DEBUG_MARKER rsDebug(__FILE__, __LINE__)
 
+
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 _RS_RUNTIME void __attribute__((overloadable)) rsDebug(const char *s, float2 v);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 _RS_RUNTIME void __attribute__((overloadable)) rsDebug(const char *s, float3 v);
+/**
+ * Debug function.  Prints a string and value to the log.
+ */
 _RS_RUNTIME void __attribute__((overloadable)) rsDebug(const char *s, float4 v);
 
+
+/**
+ * Pack floating point (0-1) RGB values into a uchar4.  The alpha component is
+ * set to 255 (1.0).
+ *
+ * @param r
+ * @param g
+ * @param b
+ *
+ * @return uchar4
+ */
 _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, float b);
 
+/**
+ * Pack floating point (0-1) RGBA values into a uchar4.
+ *
+ * @param r
+ * @param g
+ * @param b
+ * @param a
+ *
+ * @return uchar4
+ */
 _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, float b, float a);
 
+/**
+ * Pack floating point (0-1) RGB values into a uchar4.  The alpha component is
+ * set to 255 (1.0).
+ *
+ * @param color
+ *
+ * @return uchar4
+ */
 _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float3 color);
 
+/**
+ * Pack floating point (0-1) RGBA values into a uchar4.
+ *
+ * @param color
+ *
+ * @return uchar4
+ */
 _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float4 color);
 
+/**
+ * Unpack a uchar4 color to float4.  The resulting float range will be (0-1).
+ *
+ * @param c
+ *
+ * @return float4
+ */
 _RS_RUNTIME float4 rsUnpackColor8888(uchar4 c);
 
-//extern uchar4 __attribute__((overloadable)) rsPackColorTo565(float r, float g, float b);
-//extern uchar4 __attribute__((overloadable)) rsPackColorTo565(float3);
-//extern float4 rsUnpackColor565(uchar4);
-
 
 /////////////////////////////////////////////////////
 // Matrix ops
 /////////////////////////////////////////////////////
 
+/**
+ * Set one element of a matrix.
+ *
+ * @param m The matrix to be set
+ * @param row
+ * @param col
+ * @param v
+ *
+ * @return void
+ */
 _RS_RUNTIME void __attribute__((overloadable))
 rsMatrixSet(rs_matrix4x4 *m, uint32_t row, uint32_t col, float v);
-
-_RS_RUNTIME float __attribute__((overloadable))
-rsMatrixGet(const rs_matrix4x4 *m, uint32_t row, uint32_t col);
-
 _RS_RUNTIME void __attribute__((overloadable))
 rsMatrixSet(rs_matrix3x3 *m, uint32_t row, uint32_t col, float v);
-
-_RS_RUNTIME float __attribute__((overloadable))
-rsMatrixGet(const rs_matrix3x3 *m, uint32_t row, uint32_t col);
-
 _RS_RUNTIME void __attribute__((overloadable))
 rsMatrixSet(rs_matrix2x2 *m, uint32_t row, uint32_t col, float v);
 
+/**
+ * Get one element of a matrix.
+ *
+ * @param m The matrix to read from
+ * @param row
+ * @param col
+ *
+ * @return float
+ */
+_RS_RUNTIME float __attribute__((overloadable))
+rsMatrixGet(const rs_matrix4x4 *m, uint32_t row, uint32_t col);
+_RS_RUNTIME float __attribute__((overloadable))
+rsMatrixGet(const rs_matrix3x3 *m, uint32_t row, uint32_t col);
 _RS_RUNTIME float __attribute__((overloadable))
 rsMatrixGet(const rs_matrix2x2 *m, uint32_t row, uint32_t col);
 
+/**
+ * Set the elements of a matrix to the identity matrix.
+ *
+ * @param m
+ */
 extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix4x4 *m);
 extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix3x3 *m);
 extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix2x2 *m);
+
+/**
+ * Set the elements of a matrix from an array of floats.
+ *
+ * @param m
+ */
 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const float *v);
 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix3x3 *m, const float *v);
 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix2x2 *m, const float *v);
+
+/**
+ * Set the elements of a matrix from another matrix.
+ *
+ * @param m
+ */
 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix4x4 *v);
 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix3x3 *v);
 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix2x2 *v);
 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix3x3 *m, const rs_matrix3x3 *v);
 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix2x2 *m, const rs_matrix2x2 *v);
 
+/**
+ * Load a rotation matrix.
+ *
+ * @param m
+ * @param rot
+ * @param x
+ * @param y
+ * @param z
+ */
 extern void __attribute__((overloadable))
 rsMatrixLoadRotate(rs_matrix4x4 *m, float rot, float x, float y, float z);
 
diff --git a/libs/rs/scriptc/rs_graphics.rsh b/libs/rs/scriptc/rs_graphics.rsh
index 3868f24..142e21a 100644
--- a/libs/rs/scriptc/rs_graphics.rsh
+++ b/libs/rs/scriptc/rs_graphics.rsh
@@ -1,21 +1,60 @@
 #ifndef __RS_GRAPHICS_RSH__
 #define __RS_GRAPHICS_RSH__
 
-// Bind a ProgramFragment to the RS context.
-extern void __attribute__((overloadable))
-    rsgBindProgramFragment(rs_program_fragment);
-extern void __attribute__((overloadable))
-    rsgBindProgramStore(rs_program_store);
-extern void __attribute__((overloadable))
-    rsgBindProgramVertex(rs_program_vertex);
-extern void __attribute__((overloadable))
-    rsgBindProgramRaster(rs_program_raster);
 
+/**
+ * Bind a new ProgramFragment to the rendering context.
+ *
+ * @param pf
+ */
+extern void __attribute__((overloadable))
+    rsgBindProgramFragment(rs_program_fragment pf);
+
+/**
+ * Bind a new ProgramStore to the rendering context.
+ *
+ * @param ps
+ */
+extern void __attribute__((overloadable))
+    rsgBindProgramStore(rs_program_store ps);
+
+/**
+ * Bind a new ProgramVertex to the rendering context.
+ *
+ * @param pv
+ */
+extern void __attribute__((overloadable))
+    rsgBindProgramVertex(rs_program_vertex pv);
+
+/**
+ * Bind a new ProgramRaster to the rendering context.
+ *
+ * @param pr
+ */
+extern void __attribute__((overloadable))
+    rsgBindProgramRaster(rs_program_raster pr);
+
+/**
+ * Bind a new Sampler object to a ProgramFragment.  The sampler will
+ * operate on the texture bound at the matching slot.
+ *
+ * @param slot
+ */
 extern void __attribute__((overloadable))
     rsgBindSampler(rs_program_fragment, uint slot, rs_sampler);
+
+/**
+ * Bind a new Allocation object to a ProgramFragment.  The
+ * Allocation must be a valid texture for the Program.  The sampling
+ * of the texture will be controled by the Sampler bound at the
+ * matching slot.
+ *
+ * @param slot
+ */
 extern void __attribute__((overloadable))
     rsgBindTexture(rs_program_fragment, uint slot, rs_allocation);
 
+
 extern void __attribute__((overloadable))
     rsgProgramVertexLoadProjectionMatrix(const rs_matrix4x4 *);
 extern void __attribute__((overloadable))
@@ -26,32 +65,134 @@
 extern void __attribute__((overloadable))
     rsgProgramVertexGetProjectionMatrix(rs_matrix4x4 *);
 
+/**
+ * Set the constant color for a fixed function emulation program.
+ *
+ * @param pf
+ * @param r
+ * @param g
+ * @param b
+ * @param a
+ */
 extern void __attribute__((overloadable))
-    rsgProgramFragmentConstantColor(rs_program_fragment, float, float, float, float);
+    rsgProgramFragmentConstantColor(rs_program_fragment pf, float r, float g, float b, float a);
 
+/**
+ * Get the width of the current rendering surface.
+ *
+ * @return uint
+ */
 extern uint __attribute__((overloadable))
     rsgGetWidth(void);
+
+/**
+ * Get the height of the current rendering surface.
+ *
+ * @return uint
+ */
 extern uint __attribute__((overloadable))
     rsgGetHeight(void);
 
-extern void __attribute__((overloadable))
-    rsgAllocationSyncAll(rs_allocation);
 
+/**
+ * Sync the contents of an allocation from its SCRIPT memory space to its HW
+ * memory spaces.
+ *
+ * @param alloc
+ */
+extern void __attribute__((overloadable))
+    rsgAllocationSyncAll(rs_allocation alloc);
+
+/**
+ * Low performance utility function for drawing a simple rectangle.  Not
+ * intended for drawing large quantities of geometry.
+ *
+ * @param x1
+ * @param y1
+ * @param x2
+ * @param y2
+ * @param z
+ */
 extern void __attribute__((overloadable))
     rsgDrawRect(float x1, float y1, float x2, float y2, float z);
+
+/**
+ * Low performance utility function for drawing a simple quad.  Not intended for
+ * drawing large quantities of geometry.
+ *
+ * @param x1
+ * @param y1
+ * @param z1
+ * @param x2
+ * @param y2
+ * @param z2
+ * @param x3
+ * @param y3
+ * @param z3
+ * @param x4
+ * @param y4
+ * @param z4
+ */
 extern void __attribute__((overloadable))
     rsgDrawQuad(float x1, float y1, float z1,
                 float x2, float y2, float z2,
                 float x3, float y3, float z3,
                 float x4, float y4, float z4);
+
+
+/**
+ * Low performance utility function for drawing a textured quad.  Not intended
+ * for drawing large quantities of geometry.
+ *
+ * @param x1
+ * @param y1
+ * @param z1
+ * @param u1
+ * @param v1
+ * @param x2
+ * @param y2
+ * @param z2
+ * @param u2
+ * @param v2
+ * @param x3
+ * @param y3
+ * @param z3
+ * @param u3
+ * @param v3
+ * @param x4
+ * @param y4
+ * @param z4
+ * @param u4
+ * @param v4
+ */
 extern void __attribute__((overloadable))
     rsgDrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1,
                          float x2, float y2, float z2, float u2, float v2,
                          float x3, float y3, float z3, float u3, float v3,
                          float x4, float y4, float z4, float u4, float v4);
+
+
+/**
+ * Low performance function for drawing rectangles in screenspace.  This
+ * function uses the default passthough ProgramVertex.  Any bound ProgramVertex
+ * is ignored.  This function has considerable overhead and should not be used
+ * for drawing in shipping applications.
+ *
+ * @param x
+ * @param y
+ * @param z
+ * @param w
+ * @param h
+ */
 extern void __attribute__((overloadable))
     rsgDrawSpriteScreenspace(float x, float y, float z, float w, float h);
 
+/**
+ * Draw a mesh of geometry using the current context state.  The whole mesh is
+ * rendered.
+ *
+ * @param ism
+ */
 extern void __attribute__((overloadable))
     rsgDrawMesh(rs_mesh ism);
 extern void __attribute__((overloadable))
@@ -59,10 +200,23 @@
 extern void __attribute__((overloadable))
     rsgDrawMesh(rs_mesh ism, uint primitiveIndex, uint start, uint len);
 
+/**
+ * Clears the rendering surface to the specified color.
+ *
+ * @param r
+ * @param g
+ * @param b
+ * @param a
+ */
 extern void __attribute__((overloadable))
-    rsgClearColor(float, float, float, float);
+    rsgClearColor(float r, float g, float b, float a);
+
+/**
+ * Clears the depth suface to the specified value.
+ *
+ */
 extern void __attribute__((overloadable))
-    rsgClearDepth(float);
+    rsgClearDepth(float value);
 
 extern void __attribute__((overloadable))
     rsgDrawText(const char *, int x, int y);
@@ -94,12 +248,13 @@
     bBoxMax->z = z2;
 }
 
-///////////////////////////////////////////////////////
-// misc
 
-// Depricated
-extern void __attribute__((overloadable))
-    color(float, float, float, float);
+/**
+ * @hide
+ * Deprecated, do not use.
+ *
+ */
+extern void __attribute__((overloadable)) color(float, float, float, float);
 
 #endif
 
diff --git a/libs/rs/scriptc/rs_math.rsh b/libs/rs/scriptc/rs_math.rsh
index a74c0e0..e2719e0 100644
--- a/libs/rs/scriptc/rs_math.rsh
+++ b/libs/rs/scriptc/rs_math.rsh
@@ -1,6 +1,12 @@
 #ifndef __RS_MATH_RSH__
 #define __RS_MATH_RSH__
 
+/**
+ * Copy reference to the specified object.
+ *
+ * @param dst
+ * @param src
+ */
 extern void __attribute__((overloadable))
     rsSetObject(rs_element *dst, rs_element src);
 extern void __attribute__((overloadable))
@@ -24,6 +30,11 @@
 extern void __attribute__((overloadable))
     rsSetObject(rs_font *dst, rs_font src);
 
+/**
+ * Sets the object to NULL.
+ *
+ * @return bool
+ */
 extern void __attribute__((overloadable))
     rsClearObject(rs_element *dst);
 extern void __attribute__((overloadable))
@@ -47,6 +58,12 @@
 extern void __attribute__((overloadable))
     rsClearObject(rs_font *dst);
 
+/**
+ * Tests if the object is valid.  Returns true if the object is valid, false if
+ * it is NULL.
+ *
+ * @return bool
+ */
 extern bool __attribute__((overloadable))
     rsIsObject(rs_element);
 extern bool __attribute__((overloadable))
@@ -71,27 +88,58 @@
     rsIsObject(rs_font);
 
 
-
-// Allocations
-
-// Return the rs_allocation associated with a bound data
-// pointer.
+/**
+ * Returns the Allocation for a given pointer.  The pointer should point within
+ * a valid allocation.  The results are undefined if the pointer is not from a
+ * valid allocation.
+ */
 extern rs_allocation __attribute__((overloadable))
     rsGetAllocation(const void *);
 
-// Mark the allocation dirty and notify those using it
+/**
+ * Mark the contents of an allocation as dirty.  This forces any other scripts
+ * using the allocation to receive the updated
+ */
 extern void __attribute__((overloadable))
     rsAllocationMarkDirty(rs_allocation);
 
-// Return the dimensions associated with an allocation.
+/**
+ * Query the dimension of an allocation.
+ *
+ * @return uint32_t The X dimension of the allocation.
+ */
 extern uint32_t __attribute__((overloadable))
     rsAllocationGetDimX(rs_allocation);
+
+/**
+ * Query the dimension of an allocation.
+ *
+ * @return uint32_t The Y dimension of the allocation.
+ */
 extern uint32_t __attribute__((overloadable))
     rsAllocationGetDimY(rs_allocation);
+
+/**
+ * Query the dimension of an allocation.
+ *
+ * @return uint32_t The Z dimension of the allocation.
+ */
 extern uint32_t __attribute__((overloadable))
     rsAllocationGetDimZ(rs_allocation);
+
+/**
+ * Query an allocation for the presence of more than one LOD.
+ *
+ * @return uint32_t Returns 1 if more than one LOD is present, 0 otherwise.
+ */
 extern uint32_t __attribute__((overloadable))
     rsAllocationGetDimLOD(rs_allocation);
+
+/**
+ * Query an allocation for the presence of more than one face.
+ *
+ * @return uint32_t Returns 1 if more than one face is present, 0 otherwise.
+ */
 extern uint32_t __attribute__((overloadable))
     rsAllocationGetDimFaces(rs_allocation);
 
diff --git a/libs/rs/scriptc/rs_types.rsh b/libs/rs/scriptc/rs_types.rsh
index a010096..367af46 100644
--- a/libs/rs/scriptc/rs_types.rsh
+++ b/libs/rs/scriptc/rs_types.rsh
@@ -73,8 +73,6 @@
     float m[4];
 } rs_matrix2x2;
 
-typedef float4 rs_quaternion;
-
 #define RS_PACKED __attribute__((packed, aligned(4)))
 
 #endif
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 11ac56c..89b3dab 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -378,14 +378,11 @@
 }
 
 void AwesomePlayer::reset() {
-    LOGI("reset");
-
     Mutex::Autolock autoLock(mLock);
     reset_l();
 }
 
 void AwesomePlayer::reset_l() {
-    LOGI("reset_l");
     mDisplayWidth = 0;
     mDisplayHeight = 0;
 
@@ -411,10 +408,6 @@
         }
     }
 
-    if (mFlags & PREPARING) {
-        LOGI("waiting until preparation is completes.");
-    }
-
     while (mFlags & PREPARING) {
         mPreparedCondition.wait(mLock);
     }
@@ -438,8 +431,6 @@
     }
     mAudioSource.clear();
 
-    LOGI("audio source cleared");
-
     mTimeSource = NULL;
 
     delete mAudioPlayer;
@@ -480,8 +471,6 @@
         IPCThreadState::self()->flushCommands();
     }
 
-    LOGI("video source cleared");
-
     mDurationUs = -1;
     mFlags = 0;
     mExtractorFlags = 0;
@@ -498,8 +487,6 @@
     mFileSource.clear();
 
     mBitrate = -1;
-
-    LOGI("reset_l completed");
 }
 
 void AwesomePlayer::notifyListener_l(int msg, int ext1, int ext2) {
diff --git a/media/libstagefright/rtsp/ASessionDescription.cpp b/media/libstagefright/rtsp/ASessionDescription.cpp
index 77917b3..3e710dc 100644
--- a/media/libstagefright/rtsp/ASessionDescription.cpp
+++ b/media/libstagefright/rtsp/ASessionDescription.cpp
@@ -254,26 +254,12 @@
         return false;
     }
 
-    if (value == "npt=now-" || value == "npt=0-") {
-        return false;
-    }
-
     if (strncmp(value.c_str(), "npt=", 4)) {
         return false;
     }
 
-    const char *s = value.c_str() + 4;
-    char *end;
-    double from = strtod(s, &end);
-
-    if (end == s || *end != '-') {
-        return false;
-    }
-
-    s = end + 1;
-    double to = strtod(s, &end);
-
-    if (end == s || *end != '\0' || to < from) {
+    float from, to;
+    if (!parseNTPRange(value.c_str() + 4, &from, &to)) {
         return false;
     }
 
@@ -307,5 +293,39 @@
     }
 }
 
+// static
+bool ASessionDescription::parseNTPRange(
+        const char *s, float *npt1, float *npt2) {
+    if (s[0] == '-') {
+        return false;  // no start time available.
+    }
+
+    if (!strncmp("now", s, 3)) {
+        return false;  // no absolute start time available
+    }
+
+    char *end;
+    *npt1 = strtof(s, &end);
+
+    if (end == s || *end != '-') {
+        // Failed to parse float or trailing "dash".
+        return false;
+    }
+
+    s = end + 1;  // skip the dash.
+
+    if (!strncmp("now", s, 3)) {
+        return false;  // no absolute end time available
+    }
+
+    *npt2 = strtof(s, &end);
+
+    if (end == s || *end != '\0') {
+        return false;
+    }
+
+    return *npt2 > *npt1;
+}
+
 }  // namespace android
 
diff --git a/media/libstagefright/rtsp/ASessionDescription.h b/media/libstagefright/rtsp/ASessionDescription.h
index a3fa79e..b462983 100644
--- a/media/libstagefright/rtsp/ASessionDescription.h
+++ b/media/libstagefright/rtsp/ASessionDescription.h
@@ -55,6 +55,14 @@
 
     bool findAttribute(size_t index, const char *key, AString *value) const;
 
+    // parses strings of the form
+    //   npt      := npt-time "-" npt-time? | "-" npt-time
+    //   npt-time := "now" | [0-9]+("." [0-9]*)?
+    //
+    // Returns true iff both "npt1" and "npt2" times were available,
+    // i.e. we have a fixed duration, otherwise this is live streaming.
+    static bool parseNTPRange(const char *s, float *npt1, float *npt2);
+
 protected:
     virtual ~ASessionDescription();
 
diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h
index 9bb8c46..306a9c1 100644
--- a/media/libstagefright/rtsp/MyHandler.h
+++ b/media/libstagefright/rtsp/MyHandler.h
@@ -938,13 +938,11 @@
 
         AString val;
         CHECK(GetAttribute(range.c_str(), "npt", &val));
-        float npt1, npt2;
 
-        if (val == "now-" || val == "0-") {
+        float npt1, npt2;
+        if (!ASessionDescription::parseNTPRange(val.c_str(), &npt1, &npt2)) {
             // This is a live stream and therefore not seekable.
             return;
-        } else {
-            CHECK_EQ(sscanf(val.c_str(), "%f-%f", &npt1, &npt2), 2);
         }
 
         i = response->mHeaders.indexOfKey("rtp-info");
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar.xml b/packages/SystemUI/res/layout-xlarge/status_bar.xml
index f355e17..6c173c9 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar.xml
@@ -44,20 +44,20 @@
                 />
 
             <!-- navigation controls -->
+            <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back"
+                android:layout_width="80dip"
+                android:layout_height="match_parent"
+                android:src="@drawable/ic_sysbar_back"
+                android:layout_alignParentLeft="true"
+                systemui:keyCode="4"
+                />
             <LinearLayout
                 android:id="@+id/navigationArea"
                 android:layout_width="wrap_content"
                 android:layout_height="match_parent"
-                android:layout_alignParentLeft="true"
+                android:layout_toRightOf="@+id/back"
                 android:orientation="horizontal"
                 >
-
-                <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back"
-                    android:layout_width="80dip"
-                    android:layout_height="match_parent"
-                    android:src="@drawable/ic_sysbar_back"
-                    systemui:keyCode="4"
-                    />
                 <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home"
                     android:layout_width="80dip"
                     android:layout_height="match_parent"
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml
index 0f3f5f0..8e456b2 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml
@@ -27,7 +27,7 @@
 
     <com.android.systemui.statusbar.LatestItemView android:id="@+id/content"
         android:layout_width="match_parent"
-        android:layout_height="64sp"
+        android:layout_height="64dp"
         android:layout_alignParentTop="true"
         android:layout_toRightOf="@id/large_icon"
         android:layout_toLeftOf="@id/veto"
diff --git a/packages/SystemUI/res/values-de-xlarge/strings.xml b/packages/SystemUI/res/values-de-xlarge/strings.xml
index e542638..b8fa3d6 100644
--- a/packages/SystemUI/res/values-de-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-de-xlarge/strings.xml
@@ -19,7 +19,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <!-- outdated translation 4341545325987974494 -->     <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Alle löschen"</string>
+    <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Alle löschen"</string>
     <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Keine Internetverbindung"</string>
     <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Mit WLAN verbunden"</string>
 </resources>
diff --git a/packages/SystemUI/res/values-fr-xlarge/strings.xml b/packages/SystemUI/res/values-fr-xlarge/strings.xml
index 5fc8044..371a9dc 100644
--- a/packages/SystemUI/res/values-fr-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-fr-xlarge/strings.xml
@@ -19,7 +19,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <!-- outdated translation 4341545325987974494 -->     <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Tout effacer"</string>
+    <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Tout effacer"</string>
     <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Aucune connexion Internet"</string>
     <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Connecté au Wi-Fi"</string>
 </resources>
diff --git a/packages/SystemUI/res/values-ja-xlarge/strings.xml b/packages/SystemUI/res/values-ja-xlarge/strings.xml
index d4ed958..126327b 100644
--- a/packages/SystemUI/res/values-ja-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-ja-xlarge/strings.xml
@@ -19,7 +19,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <!-- outdated translation 4341545325987974494 -->     <string name="status_bar_clear_all_button" msgid="4722520806446512408">"すべて消去"</string>
+    <string name="status_bar_clear_all_button" msgid="4722520806446512408">"すべて消去"</string>
     <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"インターネット未接続"</string>
     <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi接続済み"</string>
 </resources>
diff --git a/packages/SystemUI/res/values-pt-xlarge/strings.xml b/packages/SystemUI/res/values-pt-xlarge/strings.xml
index 27d9ac1..ba790e9 100644
--- a/packages/SystemUI/res/values-pt-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-pt-xlarge/strings.xml
@@ -19,7 +19,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <!-- outdated translation 4341545325987974494 -->     <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Limpar tudo"</string>
+    <string name="status_bar_clear_all_button" msgid="4722520806446512408">"Limpar tudo"</string>
     <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"Sem conex. à inter."</string>
     <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi conectado"</string>
 </resources>
diff --git a/packages/SystemUI/res/values-xlarge/styles.xml b/packages/SystemUI/res/values-xlarge/styles.xml
index fb10a24..c1cd533 100644
--- a/packages/SystemUI/res/values-xlarge/styles.xml
+++ b/packages/SystemUI/res/values-xlarge/styles.xml
@@ -39,6 +39,7 @@
         <item name="android:layout_weight">1</item>
         <item name="android:layout_gravity">left|center_vertical</item>
         <item name="android:textColor">?android:attr/textColorPrimary</item>
+        <item name="android:textSize">18sp</item>
     </style>
 
     <style name="StatusBarPanelSettingsPanelSeparator">
diff --git a/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml b/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml
index b25044a..9df36e1 100644
--- a/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml
@@ -19,7 +19,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <!-- outdated translation 4341545325987974494 -->     <string name="status_bar_clear_all_button" msgid="4722520806446512408">"全部清除"</string>
+    <string name="status_bar_clear_all_button" msgid="4722520806446512408">"全部清除"</string>
     <string name="status_bar_settings_signal_meter_disconnected" msgid="4684094636492991496">"未连接至互联网"</string>
     <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi 已连接"</string>
 </resources>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index 37939df..76aa793 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -82,7 +82,7 @@
         public void animateCollapse();
         public void setLightsOn(boolean on);
         public void setMenuKeyVisible(boolean visible);
-        public void setIMEButtonVisible(IBinder token, boolean visible);
+        public void setImeWindowStatus(IBinder token, int vis, int backDisposition);
     }
 
     public CommandQueue(Callbacks callbacks, StatusBarIconList list) {
@@ -165,10 +165,11 @@
         }
     }
 
-    public void setIMEButtonVisible(IBinder token, boolean visible) {
+    public void setImeWindowStatus(IBinder token, int vis, int backDisposition) {
         synchronized (mList) {
             mHandler.removeMessages(MSG_SHOW_IME_BUTTON);
-            mHandler.obtainMessage(MSG_SHOW_IME_BUTTON, visible ? 1 : 0, 0, token).sendToTarget();
+            mHandler.obtainMessage(MSG_SHOW_IME_BUTTON, vis, backDisposition, token)
+                    .sendToTarget();
         }
     }
 
@@ -233,7 +234,7 @@
                     mCallbacks.setMenuKeyVisible(msg.arg1 != 0);
                     break;
                 case MSG_SHOW_IME_BUTTON:
-                    mCallbacks.setIMEButtonVisible((IBinder)msg.obj, msg.arg1 != 0);
+                    mCallbacks.setImeWindowStatus((IBinder)msg.obj, msg.arg1, msg.arg2);
                     break;
             }
         }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java
index 8fca759..da8e831 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java
@@ -67,7 +67,7 @@
         mCommandQueue = new CommandQueue(this, iconList);
         mBarService = IStatusBarService.Stub.asInterface(
                 ServiceManager.getService(Context.STATUS_BAR_SERVICE));
-        int[] switches = new int[4];
+        int[] switches = new int[5];
         ArrayList<IBinder> binders = new ArrayList<IBinder>();
         try {
             mBarService.registerStatusBar(mCommandQueue, iconList, notificationKeys, notifications,
@@ -80,7 +80,7 @@
         setLightsOn(switches[1] != 0);
         setMenuKeyVisible(switches[2] != 0);
         // StatusBarManagerService has a back up of IME token and it's restored here.
-        setIMEButtonVisible(binders.get(0), switches[3] != 0);
+        setImeWindowStatus(binders.get(0), switches[3], switches[4]);
 
         // Set up the initial icon state
         int N = iconList.size();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 132433b..9505391 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -1020,7 +1020,7 @@
 
     // Not supported
     public void setMenuKeyVisible(boolean visible) { }
-    public void setIMEButtonVisible(IBinder token, boolean visible) { }
+    public void setImeWindowStatus(IBinder token, int vis, int backDisposition) { }
 
     private class Launcher implements View.OnClickListener {
         private PendingIntent mIntent;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java
index 28f485c..f131111 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java
@@ -53,7 +53,7 @@
     private final int mId;
     private ImageView mIcon;
     private IBinder mToken;
-    private boolean mKeyboardVisible = false;
+    private boolean mShowButton = false;
     private boolean mScreenLocked = false;
     private InputMethodInfo mShortcutInfo;
     private InputMethodSubtype mShortcutSubtype;
@@ -144,7 +144,7 @@
     // * There are no explicitly enabled (by the user) subtypes of the IME, or the IME doesn't have
     // its subtypes at all
     private boolean needsToShowIMEButton() {
-        if (!mKeyboardVisible || mScreenLocked) return false;
+        if (!mShowButton || mScreenLocked) return false;
         List<InputMethodInfo> imis = mImm.getEnabledInputMethodList();
         final int size = imis.size();
         final int visibility = loadInputMethodSelectorVisibility();
@@ -194,9 +194,9 @@
         }
     }
 
-    public void setIMEButtonVisible(IBinder token, boolean keyboardVisible) {
+    public void setImeWindowStatus(IBinder token, boolean showButton) {
         mToken = token;
-        mKeyboardVisible = keyboardVisible;
+        mShowButton = showButton;
         refreshStatusIcon();
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index 14a2f90..6c8a20d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -33,6 +33,7 @@
 import android.content.Intent;
 import android.content.res.Configuration;
 import android.content.res.Resources;
+import android.inputmethodservice.InputMethodService;
 import android.graphics.PixelFormat;
 import android.graphics.Rect;
 import android.graphics.drawable.Drawable;
@@ -97,8 +98,6 @@
     // Fitts' Law assistance for LatinIME; TODO: replace with a more general approach
     private static final boolean FAKE_SPACE_BAR = true;
 
-    public static final int LIGHTS_ON_DELAY = 5000;
-
     // The height of the bar, as definied by the build.  It may be taller if we're plugged
     // into hdmi.
     int mNaturalBarHeight = -1;
@@ -369,8 +368,8 @@
                 (ImageView)sb.findViewById(R.id.network_type));
 
         // The navigation buttons
+        mBackButton = (ImageView)sb.findViewById(R.id.back);
         mNavigationArea = sb.findViewById(R.id.navigationArea);
-        mBackButton = (ImageView)mNavigationArea.findViewById(R.id.back);
         mHomeButton = mNavigationArea.findViewById(R.id.home);
         mMenuButton = mNavigationArea.findViewById(R.id.menu);
         mRecentButton = mNavigationArea.findViewById(R.id.recent_apps);
@@ -391,6 +390,12 @@
             new View.OnTouchListener() {
                 public boolean onTouch(View v, MotionEvent ev) {
                     if (ev.getAction() == MotionEvent.ACTION_DOWN) {
+                        // even though setting the systemUI visibility below will turn these views
+                        // on, we need them to come up faster so that they can catch this motion
+                        // event
+                        mShadow.setVisibility(View.GONE);
+                        mBarContents.setVisibility(View.VISIBLE);
+
                         try {
                             mBarService.setSystemUiVisibility(View.STATUS_BAR_VISIBLE);
                         } catch (RemoteException ex) {
@@ -788,6 +793,18 @@
                 mInputMethodSwitchButton.setScreenLocked(false);
             }
         }
+        if ((diff & StatusBarManager.DISABLE_BACK) != 0) {
+            if ((state & StatusBarManager.DISABLE_BACK) != 0) {
+                Slog.i(TAG, "DISABLE_BACK: yes");
+                mBackButton.setVisibility(View.INVISIBLE);
+                mInputMethodSwitchButton.setScreenLocked(true);
+            } else {
+                Slog.i(TAG, "DISABLE_BACK: no");
+                mBackButton.setVisibility(View.VISIBLE);
+                mInputMethodSwitchButton.setScreenLocked(false);
+            }
+        }
+
     }
 
     private boolean hasTicker(Notification n) {
@@ -859,17 +876,32 @@
         if (visible) setLightsOn(true);
     }
 
-    public void setIMEButtonVisible(IBinder token, boolean visible) {
-        if (DEBUG) {
-            Slog.d(TAG, (visible?"showing":"hiding") + " the IME button");
-        }
-        mInputMethodSwitchButton.setIMEButtonVisible(token, visible);
+    public void setImeWindowStatus(IBinder token, int vis, int backDisposition) {
+        mInputMethodSwitchButton.setImeWindowStatus(token,
+                (vis & InputMethodService.IME_ACTIVE) != 0);
         updateNotificationIcons();
         mInputMethodsPanel.setImeToken(token);
-        mBackButton.setImageResource(
-                visible ? R.drawable.ic_sysbar_back_ime : R.drawable.ic_sysbar_back);
+        int res;
+        switch (backDisposition) {
+            case InputMethodService.BACK_DISPOSITION_WILL_NOT_DISMISS:
+                res = R.drawable.ic_sysbar_back;
+                break;
+            case InputMethodService.BACK_DISPOSITION_WILL_DISMISS:
+                res = R.drawable.ic_sysbar_back_ime;
+                break;
+            case InputMethodService.BACK_DISPOSITION_DEFAULT:
+            default:
+                if ((vis & InputMethodService.IME_VISIBLE) != 0) {
+                    res = R.drawable.ic_sysbar_back_ime;
+                } else {
+                    res = R.drawable.ic_sysbar_back;
+                }
+                break;
+        }
+        mBackButton.setImageResource(res);
         if (FAKE_SPACE_BAR) {
-            mFakeSpaceBar.setVisibility(visible ? View.VISIBLE : View.GONE);
+            mFakeSpaceBar.setVisibility(((vis & InputMethodService.IME_VISIBLE) != 0)
+                    ? View.VISIBLE : View.GONE);
         }
     }
 
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java b/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java
index 6b52454..36afd75 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java
@@ -50,6 +50,8 @@
     public KeyguardViewBase(Context context) {
         super(context);
 
+        setSystemUiVisibility(STATUS_BAR_DISABLE_BACK);
+
         // This is a faster way to draw the background on devices without hardware acceleration
         setBackgroundDrawable(new Drawable() {
             @Override
@@ -235,4 +237,9 @@
         return false;
     }
 
+    @Override
+    public void dispatchSystemUiVisibilityChanged(int visibility) {
+        super.dispatchSystemUiVisibilityChanged(visibility);
+        setSystemUiVisibility(STATUS_BAR_DISABLE_BACK);
+    }
 }
diff --git a/policy/src/com/android/internal/policy/impl/StatusView.java b/policy/src/com/android/internal/policy/impl/StatusView.java
index 1732adb..da7bbb8 100644
--- a/policy/src/com/android/internal/policy/impl/StatusView.java
+++ b/policy/src/com/android/internal/policy/impl/StatusView.java
@@ -19,10 +19,10 @@
 import android.widget.TextView;
 
 class StatusView {
-    public static final int LOCK_ICON = R.drawable.ic_lock_idle_lock;
-    public static final int ALARM_ICON = R.drawable.ic_lock_idle_alarm;
-    public static final int CHARGING_ICON = R.drawable.ic_lock_idle_charging;
-    public static final int BATTERY_LOW_ICON = R.drawable.ic_lock_idle_low_battery;
+    public static final int LOCK_ICON = 0; // R.drawable.ic_lock_idle_lock;
+    public static final int ALARM_ICON = 0; // R.drawable.ic_lock_idle_alarm;
+    public static final int CHARGING_ICON = 0; //R.drawable.ic_lock_idle_charging;
+    public static final int BATTERY_LOW_ICON = 0; //R.drawable.ic_lock_idle_low_battery;
 
     private String mDateFormatString;
 
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index 0147b1a..8d6d3a1 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -49,6 +49,7 @@
 import android.content.res.Resources;
 import android.content.res.TypedArray;
 import android.database.ContentObserver;
+import android.inputmethodservice.InputMethodService;
 import android.os.Binder;
 import android.os.Handler;
 import android.os.IBinder;
@@ -311,6 +312,9 @@
      */
     boolean mScreenOn = true;
 
+    int mBackDisposition = InputMethodService.BACK_DISPOSITION_DEFAULT;
+    int mImeWindowVis;
+
     AlertDialog.Builder mDialogBuilder;
     AlertDialog mSwitchingDialog;
     InputMethodInfo[] mIms;
@@ -430,7 +434,9 @@
                             // Uh oh, current input method is no longer around!
                             // Pick another one...
                             Slog.i(TAG, "Current input method removed: " + curInputMethodId);
-                            mStatusBar.setIMEButtonVisible(mCurToken, false);
+                            mImeWindowVis = 0;
+                            mStatusBar.setImeWindowStatus(mCurToken, mImeWindowVis,
+                                    mBackDisposition);
                             if (!chooseNewDefaultIMELocked()) {
                                 changed = true;
                                 curIm = null;
@@ -982,17 +988,19 @@
         }
     }
 
-    public void setIMEButtonVisible(IBinder token, boolean visible) {
+    public void setImeWindowStatus(IBinder token, int vis, int backDisposition) {
         int uid = Binder.getCallingUid();
         long ident = Binder.clearCallingIdentity();
         try {
             if (token == null || mCurToken != token) {
-                Slog.w(TAG, "Ignoring setIMEButtonVisible of uid " + uid + " token: " + token);
+                Slog.w(TAG, "Ignoring setImeWindowStatus of uid " + uid + " token: " + token);
                 return;
             }
 
             synchronized (mMethodMap) {
-                mStatusBar.setIMEButtonVisible(token, visible);
+                mImeWindowVis = vis;
+                mBackDisposition = backDisposition;
+                mStatusBar.setImeWindowStatus(token, vis, backDisposition);
             }
         } finally {
             Binder.restoreCallingIdentity(ident);
@@ -1045,12 +1053,9 @@
                     }
                     if (mCurMethod != null) {
                         try {
-                            if (mInputShown) {
-                                // If mInputShown is false, there is no IME button on the
-                                // system bar.
-                                // Thus there is no need to make it invisible explicitly.
-                                mStatusBar.setIMEButtonVisible(mCurToken, true);
-                            }
+                            mImeWindowVis = 0;
+                            mStatusBar.setImeWindowStatus(mCurToken, mImeWindowVis,
+                                    mBackDisposition);
                             // If subtype is null, try to find the most applicable one from
                             // getCurrentInputMethodSubtype.
                             if (subtype == null) {
@@ -1168,11 +1173,14 @@
                         if (!mIWindowManager.inputMethodClientHasFocus(client)) {
                             if (DEBUG) Slog.w(TAG, "Ignoring hideSoftInput of uid "
                                     + uid + ": " + client);
-                            mStatusBar.setIMEButtonVisible(mCurToken, false);
+                            mImeWindowVis = 0;
+                            mStatusBar.setImeWindowStatus(mCurToken, mImeWindowVis,
+                                    mBackDisposition);
                             return false;
                         }
                     } catch (RemoteException e) {
-                        mStatusBar.setIMEButtonVisible(mCurToken, false);
+                        mImeWindowVis = 0;
+                        mStatusBar.setImeWindowStatus(mCurToken, mImeWindowVis, mBackDisposition);
                         return false;
                     }
                 }
diff --git a/services/java/com/android/server/StatusBarManagerService.java b/services/java/com/android/server/StatusBarManagerService.java
index bdaa3b0..1a2f867 100644
--- a/services/java/com/android/server/StatusBarManagerService.java
+++ b/services/java/com/android/server/StatusBarManagerService.java
@@ -67,14 +67,16 @@
 
     // for disabling the status bar
     ArrayList<DisableRecord> mDisableRecords = new ArrayList<DisableRecord>();
+    IBinder mSysUiVisToken = new Binder();
     int mDisabled = 0;
 
     Object mLock = new Object();
     // We usually call it lights out mode, but double negatives are annoying
     boolean mLightsOn = true;
     boolean mMenuVisible = false;
-    boolean mIMEButtonVisible = false;
-    IBinder mIMEToken = null;
+    int mImeWindowVis = 0;
+    int mImeBackDisposition;
+    IBinder mImeToken = null;
 
     private class DisableRecord implements IBinder.DeathRecipient {
         String pkg;
@@ -140,25 +142,29 @@
     public void disable(int what, IBinder token, String pkg) {
         enforceStatusBar();
 
+        synchronized (mLock) {
+            disableLocked(what, token, pkg);
+        }
+    }
+
+    private void disableLocked(int what, IBinder token, String pkg) {
         // It's important that the the callback and the call to mBar get done
         // in the same order when multiple threads are calling this function
         // so they are paired correctly.  The messages on the handler will be
         // handled in the order they were enqueued, but will be outside the lock.
-        synchronized (mDisableRecords) {
-            manageDisableListLocked(what, token, pkg);
-            final int net = gatherDisableActionsLocked();
-            if (net != mDisabled) {
-                mDisabled = net;
-                mHandler.post(new Runnable() {
-                        public void run() {
-                            mNotificationCallbacks.onSetDisabled(net);
-                        }
-                    });
-                if (mBar != null) {
-                    try {
-                        mBar.disable(net);
-                    } catch (RemoteException ex) {
+        manageDisableListLocked(what, token, pkg);
+        final int net = gatherDisableActionsLocked();
+        if (net != mDisabled) {
+            mDisabled = net;
+            mHandler.post(new Runnable() {
+                    public void run() {
+                        mNotificationCallbacks.onSetDisabled(net);
                     }
+                });
+            if (mBar != null) {
+                try {
+                    mBar.disable(net);
+                } catch (RemoteException ex) {
                 }
             }
         }
@@ -259,22 +265,25 @@
         }
     }
 
-    public void setIMEButtonVisible(final IBinder token, final boolean visible) {
+    public void setImeWindowStatus(final IBinder token, final int vis, final int backDisposition) {
         enforceStatusBar();
 
-        if (SPEW) Slog.d(TAG, (visible?"showing":"hiding") + " IME Button");
+        if (SPEW) {
+            Slog.d(TAG, "swetImeWindowStatus vis=" + vis + " backDisposition=" + backDisposition);
+        }
 
         synchronized(mLock) {
-            // In case of IME change, we need to call up setIMEButtonVisible() regardless of
-            // mIMEButtonVisible because mIMEButtonVisible may not have been set to false when the
+            // In case of IME change, we need to call up setImeWindowStatus() regardless of
+            // mImeWindowVis because mImeWindowVis may not have been set to false when the
             // previous IME was destroyed.
-            mIMEButtonVisible = visible;
-            mIMEToken = token;
+            mImeWindowVis = vis;
+            mImeBackDisposition = backDisposition;
+            mImeToken = token;
             mHandler.post(new Runnable() {
                 public void run() {
                     if (mBar != null) {
                         try {
-                            mBar.setIMEButtonVisible(token, visible);
+                            mBar.setImeWindowStatus(token, vis, backDisposition);
                         } catch (RemoteException ex) {
                         }
                     }
@@ -290,6 +299,8 @@
         synchronized (mLock) {
             final boolean lightsOn = (vis & View.STATUS_BAR_HIDDEN) == 0;
             updateLightsOnLocked(lightsOn);
+            disableLocked(vis & StatusBarManager.DISABLE_MASK, mSysUiVisToken,
+                    "WindowManager.LayoutParams");
         }
     }
 
@@ -348,8 +359,9 @@
             switches[0] = gatherDisableActionsLocked();
             switches[1] = mLightsOn ? 1 : 0;
             switches[2] = mMenuVisible ? 1 : 0;
-            switches[3] = mIMEButtonVisible ? 1 : 0;
-            binders.add(mIMEToken);
+            switches[3] = mImeWindowVis;
+            switches[4] = mImeBackDisposition;
+            binders.add(mImeToken);
         }
     }
 
@@ -447,37 +459,35 @@
             Slog.d(TAG, "manageDisableList what=0x" + Integer.toHexString(what) + " pkg=" + pkg);
         }
         // update the list
-        synchronized (mDisableRecords) {
-            final int N = mDisableRecords.size();
-            DisableRecord tok = null;
-            int i;
-            for (i=0; i<N; i++) {
-                DisableRecord t = mDisableRecords.get(i);
-                if (t.token == token) {
-                    tok = t;
-                    break;
-                }
+        final int N = mDisableRecords.size();
+        DisableRecord tok = null;
+        int i;
+        for (i=0; i<N; i++) {
+            DisableRecord t = mDisableRecords.get(i);
+            if (t.token == token) {
+                tok = t;
+                break;
             }
-            if (what == 0 || !token.isBinderAlive()) {
-                if (tok != null) {
-                    mDisableRecords.remove(i);
-                    tok.token.unlinkToDeath(tok, 0);
-                }
-            } else {
-                if (tok == null) {
-                    tok = new DisableRecord();
-                    try {
-                        token.linkToDeath(tok, 0);
-                    }
-                    catch (RemoteException ex) {
-                        return; // give up
-                    }
-                    mDisableRecords.add(tok);
-                }
-                tok.what = what;
-                tok.token = token;
-                tok.pkg = pkg;
+        }
+        if (what == 0 || !token.isBinderAlive()) {
+            if (tok != null) {
+                mDisableRecords.remove(i);
+                tok.token.unlinkToDeath(tok, 0);
             }
+        } else {
+            if (tok == null) {
+                tok = new DisableRecord();
+                try {
+                    token.linkToDeath(tok, 0);
+                }
+                catch (RemoteException ex) {
+                    return; // give up
+                }
+                mDisableRecords.add(tok);
+            }
+            tok.what = what;
+            tok.token = token;
+            tok.pkg = pkg;
         }
     }
 
@@ -518,7 +528,7 @@
             }
         }
 
-        synchronized (mDisableRecords) {
+        synchronized (mLock) {
             final int N = mDisableRecords.size();
             pw.println("  mDisableRecords.size=" + N
                     + " mDisabled=0x" + Integer.toHexString(mDisabled));
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java
index cf07239..d2f2ec7 100644
--- a/services/java/com/android/server/WifiService.java
+++ b/services/java/com/android/server/WifiService.java
@@ -955,10 +955,10 @@
          * @see #shouldDeviceStayAwake(int, int)
          */
         private boolean shouldWifiStayAwake(int stayAwakeConditions, int pluggedType) {
-            //Never sleep when plugged in as long as the user has not changed the settings
+            //Never sleep as long as the user has not changed the settings
             int wifiSleepPolicy = Settings.System.getInt(mContext.getContentResolver(),
                     Settings.System.WIFI_SLEEP_POLICY,
-                    Settings.System.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED);
+                    Settings.System.WIFI_SLEEP_POLICY_NEVER);
 
             if (wifiSleepPolicy == Settings.System.WIFI_SLEEP_POLICY_NEVER) {
                 // Never sleep
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index fcc8e693..faaa28d7 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -11315,13 +11315,13 @@
 
         mInputMonitor.thawInputDispatchingLw();
 
+        boolean configChanged;
+        
         // While the display is frozen we don't re-compute the orientation
         // to avoid inconsistent states.  However, something interesting
         // could have actually changed during that time so re-evaluate it
         // now to catch that.
-        if (updateOrientationFromAppTokensLocked(false)) {
-            mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
-        }
+        configChanged = updateOrientationFromAppTokensLocked(false);
 
         // A little kludge: a lot could have happened while the
         // display was frozen, so now that we are coming back we
@@ -11336,11 +11336,12 @@
         
         if (updateRotation) {
             if (DEBUG_ORIENTATION) Slog.d(TAG, "Performing post-rotate rotation");
-            boolean changed = setRotationUncheckedLocked(
+            configChanged |= setRotationUncheckedLocked(
                     WindowManagerPolicy.USE_LAST_ROTATION, 0, false);
-            if (changed) {
-                sendNewConfiguration();
-            }
+        }
+        
+        if (configChanged) {
+            mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
         }
     }
 
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 3730739..f64fd7b 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -150,8 +150,7 @@
     // the layer is not on screen anymore. free as much resources as possible
     mFreezeLock.clear();
 
-    EGLDisplay dpy(mFlinger->graphicPlane(0).getEGLDisplay());
-    mBufferManager.destroy(dpy);
+    // Free our own reference to ISurface
     mSurface.clear();
 
     Mutex::Autolock _l(mLock);
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
index 19e7fae..a7f7866 100755
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
@@ -1069,6 +1069,8 @@
 
         cdmaDataConnectionState = newCdmaDataConnectionState;
         networkType = newNetworkType;
+        // this new state has been applied - forget it until we get a new new state
+        newNetworkType = 0;
 
         newSS.setStateOutOfService(); // clean slate for next time
 
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
index c107d17..bb99e45 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
@@ -957,6 +957,9 @@
 
         gprsState = newGPRSState;
         networkType = newNetworkType;
+        // this new state has been applied - forget it until we get a new new state
+        newNetworkType = 0;
+
 
         newSS.setStateOutOfService(); // clean slate for next time
 
diff --git a/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java b/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java
index 5fd946e..13665e1 100644
--- a/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java
+++ b/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java
@@ -70,6 +70,12 @@
     }
 
     private Test[] mTests = new Test[] {
+        new Test("DISABLE_NAVIGATION") {
+            public void run() {
+                View v = findViewById(android.R.id.list);
+                v.setSystemUiVisibility(View.STATUS_BAR_DISABLE_NAVIGATION);
+            }
+        },
         new Test("STATUS_BAR_HIDDEN") {
             public void run() {
                 View v = findViewById(android.R.id.list);
@@ -77,7 +83,7 @@
                 v.setOnSystemUiVisibilityChangeListener(mOnSystemUiVisibilityChangeListener);
             }
         },
-        new Test("not STATUS_BAR_HIDDEN") {
+        new Test("no setSystemUiVisibility") {
             public void run() {
                 View v = findViewById(android.R.id.list);
                 v.setSystemUiVisibility(View.STATUS_BAR_VISIBLE);
diff --git a/tools/layoutlib/bridge/.classpath b/tools/layoutlib/bridge/.classpath
index 64c1fb5..2eaf8e3 100644
--- a/tools/layoutlib/bridge/.classpath
+++ b/tools/layoutlib/bridge/.classpath
@@ -8,6 +8,6 @@
 	<classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_PLAT_SRC/dalvik/libcore/xml/src/main/java"/>
 	<classpathentry kind="var" path="ANDROID_PLAT_SRC/out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar" sourcepath="/ANDROID_PLAT_SRC/frameworks/base"/>
 	<classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/ninepatch/ninepatch-prebuilt.jar"/>
-	<classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/resources/resources-prebuilt.jar"/>
+	<classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/common/common-prebuilt.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/tools/layoutlib/bridge/Android.mk b/tools/layoutlib/bridge/Android.mk
index 57dd7ae..3d4c76a 100644
--- a/tools/layoutlib/bridge/Android.mk
+++ b/tools/layoutlib/bridge/Android.mk
@@ -21,7 +21,7 @@
 LOCAL_JAVA_LIBRARIES := \
 	kxml2-2.3.0 \
 	layoutlib_api-prebuilt \
-	resources-prebuilt
+	common-prebuilt
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
 	temp_layoutlib \
diff --git a/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java
index 7a0c2f7..38c092d 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java
@@ -95,7 +95,7 @@
          * Pre-computes the colors for the gradient. This must be called once before any call
          * to {@link #getGradientColor(float)}
          */
-        protected synchronized void precomputeGradientColors() {
+        protected void precomputeGradientColors() {
             if (mGradient == null) {
                 // actually create an array with an extra size, so that we can really go
                 // from 0 to SIZE (100%), or currentPos in the loop below will never equal 1.0
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
index bd52dc2..93c81d1 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
@@ -28,8 +28,10 @@
 import com.android.layoutlib.bridge.impl.FontLoader;
 import com.android.layoutlib.bridge.impl.RenderSessionImpl;
 import com.android.ninepatch.NinePatchChunk;
+import com.android.resources.ResourceType;
 import com.android.tools.layoutlib.create.MethodAdapter;
 import com.android.tools.layoutlib.create.OverrideMethod;
+import com.android.util.Pair;
 
 import android.graphics.Bitmap;
 import android.graphics.Typeface;
@@ -41,6 +43,7 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 import java.util.Arrays;
+import java.util.EnumMap;
 import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.Map;
@@ -68,9 +71,11 @@
     private final static ReentrantLock sLock = new ReentrantLock();
 
     /**
-     * Maps from id to resource name/type. This is for android.R only.
+     * Maps from id to resource type/name. This is for android.R only.
      */
-    private final static Map<Integer, String[]> sRMap = new HashMap<Integer, String[]>();
+    private final static Map<Integer, Pair<ResourceType, String>> sRMap =
+        new HashMap<Integer, Pair<ResourceType, String>>();
+
     /**
      * Same as sRMap except for int[] instead of int resources. This is for android.R only.
      */
@@ -79,8 +84,8 @@
      * Reverse map compared to sRMap, resource type -> (resource name -> id).
      * This is for android.R only.
      */
-    private final static Map<String, Map<String, Integer>> sRFullMap =
-        new HashMap<String, Map<String,Integer>>();
+    private final static Map<ResourceType, Map<String, Integer>> sRFullMap =
+        new EnumMap<ResourceType, Map<String,Integer>>(ResourceType.class);
 
     private final static Map<Object, Map<String, SoftReference<Bitmap>>> sProjectBitmapCache =
         new HashMap<Object, Map<String, SoftReference<Bitmap>>>();
@@ -130,7 +135,7 @@
         }
     }
 
-    /** Instance of IntArrayWrapper to be reused in {@link #resolveResourceValue(int[])}. */
+    /** Instance of IntArrayWrapper to be reused in {@link #resolveResourceId(int[])}. */
     private final static IntArray sIntArrayWrapper = new IntArray();
 
     /**
@@ -236,28 +241,30 @@
             Class<?> r = com.android.internal.R.class;
 
             for (Class<?> inner : r.getDeclaredClasses()) {
-                String resType = inner.getSimpleName();
+                String resTypeName = inner.getSimpleName();
+                ResourceType resType = ResourceType.getEnum(resTypeName);
+                if (resType != null) {
+                    Map<String, Integer> fullMap = new HashMap<String, Integer>();
+                    sRFullMap.put(resType, fullMap);
 
-                Map<String, Integer> fullMap = new HashMap<String, Integer>();
-                sRFullMap.put(resType, fullMap);
-
-                for (Field f : inner.getDeclaredFields()) {
-                    // only process static final fields. Since the final attribute may have
-                    // been altered by layoutlib_create, we only check static
-                    int modifiers = f.getModifiers();
-                    if (Modifier.isStatic(modifiers)) {
-                        Class<?> type = f.getType();
-                        if (type.isArray() && type.getComponentType() == int.class) {
-                            // if the object is an int[] we put it in sRArrayMap using an IntArray
-                            // wrapper that properly implements equals and hashcode for the array
-                            // objects, as required by the map contract.
-                            sRArrayMap.put(new IntArray((int[]) f.get(null)), f.getName());
-                        } else if (type == int.class) {
-                            Integer value = (Integer) f.get(null);
-                            sRMap.put(value, new String[] { f.getName(), resType });
-                            fullMap.put(f.getName(), value);
-                        } else {
-                            assert false;
+                    for (Field f : inner.getDeclaredFields()) {
+                        // only process static final fields. Since the final attribute may have
+                        // been altered by layoutlib_create, we only check static
+                        int modifiers = f.getModifiers();
+                        if (Modifier.isStatic(modifiers)) {
+                            Class<?> type = f.getType();
+                            if (type.isArray() && type.getComponentType() == int.class) {
+                                // if the object is an int[] we put it in sRArrayMap using an IntArray
+                                // wrapper that properly implements equals and hashcode for the array
+                                // objects, as required by the map contract.
+                                sRArrayMap.put(new IntArray((int[]) f.get(null)), f.getName());
+                            } else if (type == int.class) {
+                                Integer value = (Integer) f.get(null);
+                                sRMap.put(value, Pair.of(resType, f.getName()));
+                                fullMap.put(f.getName(), value);
+                            } else {
+                                assert false;
+                            }
                         }
                     }
                 }
@@ -388,10 +395,10 @@
     /**
      * Returns details of a framework resource from its integer value.
      * @param value the integer value
-     * @return an array of 2 strings containing the resource name and type, or null if the id
-     * does not match any resource.
+     * @return a Pair containing the resource type and name, or null if the id
+     *     does not match any resource.
      */
-    public static String[] resolveResourceValue(int value) {
+    public static Pair<ResourceType, String> resolveResourceId(int value) {
         return sRMap.get(value);
     }
 
@@ -399,7 +406,7 @@
      * Returns the name of a framework resource whose value is an int array.
      * @param array
      */
-    public static String resolveResourceValue(int[] array) {
+    public static String resolveResourceId(int[] array) {
         sIntArrayWrapper.set(array);
         return sRArrayMap.get(sIntArrayWrapper);
     }
@@ -410,7 +417,7 @@
      * @param name the name of the resource.
      * @return an {@link Integer} containing the resource id, or null if no resource were found.
      */
-    public static Integer getResourceValue(String type, String name) {
+    public static Integer getResourceId(ResourceType type, String name) {
         Map<String, Integer> map = sRFullMap.get(type);
         if (map != null) {
             return map.get(name);
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
index 79264d0..037ad23 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
@@ -24,6 +24,8 @@
 import com.android.layoutlib.bridge.Bridge;
 import com.android.layoutlib.bridge.BridgeConstants;
 import com.android.layoutlib.bridge.impl.Stack;
+import com.android.resources.ResourceType;
+import com.android.util.Pair;
 
 import android.app.Activity;
 import android.app.Fragment;
@@ -517,14 +519,14 @@
      */
     private TreeMap<Integer,String> searchAttrs(int[] attrs, boolean[] outFrameworkFlag) {
         // get the name of the array from the framework resources
-        String arrayName = Bridge.resolveResourceValue(attrs);
+        String arrayName = Bridge.resolveResourceId(attrs);
         if (arrayName != null) {
             // if we found it, get the name of each of the int in the array.
             TreeMap<Integer,String> attributes = new TreeMap<Integer, String>();
             for (int i = 0 ; i < attrs.length ; i++) {
-                String[] info = Bridge.resolveResourceValue(attrs[i]);
+                Pair<ResourceType, String> info = Bridge.resolveResourceId(attrs[i]);
                 if (info != null) {
-                    attributes.put(i, info[0]);
+                    attributes.put(i, info.getSecond());
                 } else {
                     // FIXME Not sure what we should be doing here...
                     attributes.put(i, null);
@@ -540,13 +542,13 @@
 
         // if the name was not found in the framework resources, look in the project
         // resources
-        arrayName = mProjectCallback.resolveResourceValue(attrs);
+        arrayName = mProjectCallback.resolveResourceId(attrs);
         if (arrayName != null) {
             TreeMap<Integer,String> attributes = new TreeMap<Integer, String>();
             for (int i = 0 ; i < attrs.length ; i++) {
-                String[] info = mProjectCallback.resolveResourceValue(attrs[i]);
+                Pair<ResourceType, String> info = mProjectCallback.resolveResourceId(attrs[i]);
                 if (info != null) {
-                    attributes.put(i, info[0]);
+                    attributes.put(i, info.getSecond());
                 } else {
                     // FIXME Not sure what we should be doing here...
                     attributes.put(i, null);
@@ -571,14 +573,14 @@
      *         if nothing is found.
      */
     public String searchAttr(int attr) {
-        String[] info = Bridge.resolveResourceValue(attr);
+        Pair<ResourceType, String> info = Bridge.resolveResourceId(attr);
         if (info != null) {
-            return info[0];
+            return info.getSecond();
         }
 
-        info = mProjectCallback.resolveResourceValue(attr);
+        info = mProjectCallback.resolveResourceId(attr);
         if (info != null) {
-            return info[0];
+            return info.getSecond();
         }
 
         return null;
@@ -614,8 +616,8 @@
         return null;
     }
 
-    int getFrameworkResourceValue(String resType, String resName, int defValue) {
-        Integer value = Bridge.getResourceValue(resType, resName);
+    int getFrameworkResourceValue(ResourceType resType, String resName, int defValue) {
+        Integer value = Bridge.getResourceId(resType, resName);
         if (value != null) {
             return value.intValue();
         }
@@ -623,9 +625,9 @@
         return defValue;
     }
 
-    int getProjectResourceValue(String resType, String resName, int defValue) {
+    int getProjectResourceValue(ResourceType resType, String resName, int defValue) {
         if (mProjectCallback != null) {
-            Integer value = mProjectCallback.getResourceValue(resType, resName);
+            Integer value = mProjectCallback.getResourceId(resType, resName);
             if (value != null) {
                 return value.intValue();
             }
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeInflater.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeInflater.java
index 465bf1d..5740e8b 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeInflater.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeInflater.java
@@ -19,9 +19,10 @@
 import com.android.ide.common.rendering.api.IProjectCallback;
 import com.android.ide.common.rendering.api.LayoutLog;
 import com.android.ide.common.rendering.api.MergeCookie;
-import com.android.ide.common.rendering.api.RenderResources;
 import com.android.ide.common.rendering.api.ResourceValue;
 import com.android.layoutlib.bridge.Bridge;
+import com.android.resources.ResourceType;
+import com.android.util.Pair;
 
 import org.kxml2.io.KXmlParser;
 import org.xmlpull.v1.XmlPullParser;
@@ -155,16 +156,16 @@
 
             ResourceValue value = null;
 
-            String[] layoutInfo = Bridge.resolveResourceValue(resource);
+            Pair<ResourceType, String> layoutInfo = Bridge.resolveResourceId(resource);
             if (layoutInfo != null) {
                 value = bridgeContext.getRenderResources().getFrameworkResource(
-                        RenderResources.RES_LAYOUT, layoutInfo[0]);
+                        ResourceType.LAYOUT, layoutInfo.getSecond());
             } else {
-                layoutInfo = mProjectCallback.resolveResourceValue(resource);
+                layoutInfo = mProjectCallback.resolveResourceId(resource);
 
                 if (layoutInfo != null) {
                     value = bridgeContext.getRenderResources().getProjectResource(
-                            RenderResources.RES_LAYOUT, layoutInfo[0]);
+                            ResourceType.LAYOUT, layoutInfo.getSecond());
                 }
             }
 
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java
index 7b66809..5ea0a8d 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java
@@ -22,6 +22,8 @@
 import com.android.layoutlib.bridge.Bridge;
 import com.android.layoutlib.bridge.BridgeConstants;
 import com.android.layoutlib.bridge.impl.ResourceHelper;
+import com.android.resources.ResourceType;
+import com.android.util.Pair;
 
 import org.kxml2.io.KXmlParser;
 import org.xmlpull.v1.XmlPullParser;
@@ -100,22 +102,22 @@
 
     private ResourceValue getResourceValue(int id, boolean[] platformResFlag_out) {
         // first get the String related to this id in the framework
-        String[] resourceInfo = Bridge.resolveResourceValue(id);
+        Pair<ResourceType, String> resourceInfo = Bridge.resolveResourceId(id);
 
         if (resourceInfo != null) {
             platformResFlag_out[0] = true;
             return mContext.getRenderResources().getFrameworkResource(
-                    resourceInfo[1], resourceInfo[0]);
+                    resourceInfo.getFirst(), resourceInfo.getSecond());
         }
 
         // didn't find a match in the framework? look in the project.
         if (mProjectCallback != null) {
-            resourceInfo = mProjectCallback.resolveResourceValue(id);
+            resourceInfo = mProjectCallback.resolveResourceId(id);
 
             if (resourceInfo != null) {
                 platformResFlag_out[0] = false;
                 return mContext.getRenderResources().getProjectResource(
-                        resourceInfo[1], resourceInfo[0]);
+                        resourceInfo.getFirst(), resourceInfo.getSecond());
             }
         }
 
@@ -614,18 +616,18 @@
      */
     private void throwException(int id) throws NotFoundException {
         // first get the String related to this id in the framework
-        String[] resourceInfo = Bridge.resolveResourceValue(id);
+        Pair<ResourceType, String> resourceInfo = Bridge.resolveResourceId(id);
 
         // if the name is unknown in the framework, get it from the custom view loader.
         if (resourceInfo == null && mProjectCallback != null) {
-            resourceInfo = mProjectCallback.resolveResourceValue(id);
+            resourceInfo = mProjectCallback.resolveResourceId(id);
         }
 
         String message = null;
         if (resourceInfo != null) {
             message = String.format(
                     "Could not find %1$s resource matching value 0x%2$X (resolved name: %3$s) in current configuration.",
-                    resourceInfo[1], id, resourceInfo[0]);
+                    resourceInfo.getFirst(), id, resourceInfo.getSecond());
         } else {
             message = String.format(
                     "Could not resolve resource value: 0x%1$X.", id);
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java
index 8d3c929..cf2c0ff 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java
@@ -24,6 +24,7 @@
 import com.android.layoutlib.bridge.Bridge;
 import com.android.layoutlib.bridge.BridgeConstants;
 import com.android.layoutlib.bridge.impl.ResourceHelper;
+import com.android.resources.ResourceType;
 
 import org.kxml2.io.KXmlParser;
 import org.xmlpull.v1.XmlPullParser;
@@ -39,6 +40,7 @@
 
 import java.io.File;
 import java.io.FileReader;
+import java.util.Arrays;
 import java.util.Map;
 
 /**
@@ -587,17 +589,17 @@
         // then the xml attribute value was "resolved" which leads us to a ResourceValue with a
         // valid getType() and getName() returning a resource name.
         // (and getValue() returning null!). We need to handle this!
-        if (resValue.getType() != null && resValue.getType().startsWith("@+") == false) {
+        if (resValue.getResourceType() != null) {
             // if this is a framework id
             if (mPlatformFile || resValue.isFramework()) {
                 // look for idName in the android R classes
                 return mContext.getFrameworkResourceValue(
-                        resValue.getType(), resValue.getName(), defValue);
+                        resValue.getResourceType(), resValue.getName(), defValue);
             }
 
             // look for idName in the project R class.
             return mContext.getProjectResourceValue(
-                    resValue.getType(), resValue.getName(), defValue);
+                    resValue.getResourceType(), resValue.getName(), defValue);
         }
 
         // else, try to get the value, and resolve it somehow.
@@ -634,21 +636,22 @@
             // if this is a framework id
             if (mPlatformFile || value.startsWith("@android") || value.startsWith("@+android")) {
                 // look for idName in the android R classes
-                return mContext.getFrameworkResourceValue(RenderResources.RES_ID, idName, defValue);
+                return mContext.getFrameworkResourceValue(ResourceType.ID, idName, defValue);
             }
 
             // look for idName in the project R class.
-            return mContext.getProjectResourceValue(RenderResources.RES_ID, idName, defValue);
+            return mContext.getProjectResourceValue(ResourceType.ID, idName, defValue);
         }
 
         // not a direct id valid reference? resolve it
         Integer idValue = null;
 
         if (resValue.isFramework()) {
-            idValue = Bridge.getResourceValue(resValue.getType(), resValue.getName());
+            idValue = Bridge.getResourceId(resValue.getResourceType(),
+                    resValue.getName());
         } else {
-            idValue = mContext.getProjectCallback().getResourceValue(
-                    resValue.getType(), resValue.getName());
+            idValue = mContext.getProjectCallback().getResourceId(
+                    resValue.getResourceType(), resValue.getName());
         }
 
         if (idValue != null) {
@@ -796,6 +799,6 @@
 
     @Override
     public String toString() {
-        return mResourceData.toString();
+        return Arrays.toString(mResourceData);
     }
  }
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeXmlPullAttributes.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeXmlPullAttributes.java
index 4a6880b..ba856e0 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeXmlPullAttributes.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeXmlPullAttributes.java
@@ -20,6 +20,7 @@
 import com.android.ide.common.rendering.api.ResourceValue;
 import com.android.layoutlib.bridge.Bridge;
 import com.android.layoutlib.bridge.BridgeConstants;
+import com.android.resources.ResourceType;
 
 import org.xmlpull.v1.XmlPullParser;
 
@@ -58,7 +59,7 @@
         String ns = mParser.getAttributeNamespace(index);
 
         if (BridgeConstants.NS_RESOURCES.equals(ns)) {
-            Integer v = Bridge.getResourceValue(RenderResources.RES_ATTR, name);
+            Integer v = Bridge.getResourceId(ResourceType.ATTR, name);
             if (v != null) {
                 return v.intValue();
             }
@@ -69,8 +70,7 @@
         // this is not an attribute in the android namespace, we query the customviewloader, if
         // the namespaces match.
         if (mContext.getProjectCallback().getNamespace().equals(ns)) {
-            Integer v = mContext.getProjectCallback().getResourceValue(RenderResources.RES_ATTR,
-                    name);
+            Integer v = mContext.getProjectCallback().getResourceId(ResourceType.ATTR, name);
             if (v != null) {
                 return v.intValue();
             }
@@ -110,10 +110,10 @@
         if (resource != null) {
             Integer id = null;
             if (mPlatformFile || resource.isFramework()) {
-                id = Bridge.getResourceValue(resource.getType(), resource.getName());
+                id = Bridge.getResourceId(resource.getResourceType(), resource.getName());
             } else {
-                id = mContext.getProjectCallback().getResourceValue(
-                        resource.getType(), resource.getName());
+                id = mContext.getProjectCallback().getResourceId(
+                        resource.getResourceType(), resource.getName());
             }
 
             if (id != null) {
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/FontLoader.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/FontLoader.java
index 5d56370..f62fad2 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/FontLoader.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/FontLoader.java
@@ -163,7 +163,7 @@
             mTtfToFontMap.put(ttf, styleMap);
         }
 
-        Font f = styleMap.get(style);
+        Font f = styleMap.get(style[0]);
 
         if (f != null) {
             return f;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
index 978832f..d816d18 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
@@ -48,7 +48,9 @@
 import com.android.layoutlib.bridge.android.BridgeWindowSession;
 import com.android.layoutlib.bridge.android.BridgeXmlBlockParser;
 import com.android.resources.Density;
+import com.android.resources.ResourceType;
 import com.android.resources.ScreenSize;
+import com.android.util.Pair;
 
 import android.animation.Animator;
 import android.animation.AnimatorInflater;
@@ -566,17 +568,16 @@
         int animationId = 0;
         if (isFrameworkAnimation) {
             animationResource = mContext.getRenderResources().getFrameworkResource(
-                    RenderResources.RES_ANIMATOR, animationName);
+                    ResourceType.ANIMATOR, animationName);
             if (animationResource != null) {
-                animationId = Bridge.getResourceValue(RenderResources.RES_ANIMATOR,
-                        animationName);
+                animationId = Bridge.getResourceId(ResourceType.ANIMATOR, animationName);
             }
         } else {
             animationResource = mContext.getRenderResources().getProjectResource(
-                    RenderResources.RES_ANIMATOR, animationName);
+                    ResourceType.ANIMATOR, animationName);
             if (animationResource != null) {
-                animationId = mContext.getProjectCallback().getResourceValue(
-                        RenderResources.RES_ANIMATOR, animationName);
+                animationId = mContext.getProjectCallback().getResourceId(
+                        ResourceType.ANIMATOR, animationName);
             }
         }
 
@@ -1022,7 +1023,7 @@
                 mStatusBarSize = DEFAULT_STATUS_BAR_HEIGHT;
 
                 // get the real value
-                ResourceValue value = resources.getFrameworkResource(RenderResources.RES_DIMEN,
+                ResourceValue value = resources.getFrameworkResource(ResourceType.DIMEN,
                         "status_bar_height");
 
                 if (value != null) {
@@ -1110,7 +1111,7 @@
             mSystemBarSize = 56; // ??
 
             // get the real value
-            ResourceValue value = resources.getFrameworkResource(RenderResources.RES_DIMEN,
+            ResourceValue value = resources.getFrameworkResource(ResourceType.DIMEN,
                     "status_bar_height");
 
             if (value != null) {
@@ -1227,10 +1228,10 @@
                 View child = content.getChildAt(i);
                 String tabSpec = String.format("tab_spec%d", i+1);
                 int id = child.getId();
-                String[] resource = projectCallback.resolveResourceValue(id);
+                Pair<ResourceType, String> resource = projectCallback.resolveResourceId(id);
                 String name;
                 if (resource != null) {
-                    name = resource[0]; // 0 is resource name, 1 is resource type.
+                    name = resource.getSecond();
                 } else {
                     name = String.format("Tab %d", i+1); // default name if id is unresolved.
                 }
@@ -1309,7 +1310,7 @@
     // --- FrameworkResourceIdProvider methods
 
     @Override
-    public Integer getId(String resType, String resName) {
-        return Bridge.getResourceValue(resType, resName);
+    public Integer getId(ResourceType resType, String resName) {
+        return Bridge.getResourceId(resType, resName);
     }
 }
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java
index 119dfb1..25bb81c 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java
@@ -197,7 +197,8 @@
                 } catch (Exception e) {
                     // this is an error and not warning since the file existence is checked before
                     // attempting to parse it.
-                    Bridge.getLog().error(null, "Failed to parse file " + value, e, null /*data*/);
+                    Bridge.getLog().error(null, "Failed to parse file " + stringValue,
+                            e, null /*data*/);
                 }
             } else {
                 Bridge.getLog().error(LayoutLog.TAG_BROKEN,
@@ -298,7 +299,7 @@
      */
     public static boolean stringToFloat(String s, TypedValue outValue) {
         // remove the space before and after
-        s.trim();
+        s = s.trim();
         int len = s.length();
 
         if (len <= 0) {