Merge "UsbService: Handle the case where a USB accessory connects as the device is booting" into honeycomb-mr1
diff --git a/core/java/android/webkit/ZoomManager.java b/core/java/android/webkit/ZoomManager.java
index 72052a6..f2a1ec3 100644
--- a/core/java/android/webkit/ZoomManager.java
+++ b/core/java/android/webkit/ZoomManager.java
@@ -504,7 +504,7 @@
     }
 
     public boolean isFixedLengthAnimationInProgress() {
-        return mZoomScale != 0;
+        return mZoomScale != 0 || mInHWAcceleratedZoom;
     }
 
     public void refreshZoomScale(boolean reflowText) {
diff --git a/core/java/com/android/internal/app/LocalePicker.java b/core/java/com/android/internal/app/LocalePicker.java
index e32c62d..52cb679 100644
--- a/core/java/com/android/internal/app/LocalePicker.java
+++ b/core/java/com/android/internal/app/LocalePicker.java
@@ -88,7 +88,7 @@
     public static ArrayAdapter<LocaleInfo> constructAdapter(Context context,
             int layoutId, int fieldId) {
         final Resources resources = context.getResources();
-        final String[] locales = context.getAssets().getLocales();
+        final String[] locales = Resources.getSystem().getAssets().getLocales();
         final String[] specialLocaleCodes = resources.getStringArray(R.array.special_locale_codes);
         final String[] specialLocaleNames = resources.getStringArray(R.array.special_locale_names);
         Arrays.sort(locales);
diff --git a/core/res/res/drawable-hdpi/ic_media_video_poster.png b/core/res/res/drawable-hdpi/ic_media_video_poster.png
new file mode 100644
index 0000000..6c1fd6b
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_media_video_poster.png
Binary files differ
diff --git a/core/res/res/drawable-ldpi/ic_media_video_poster.png b/core/res/res/drawable-ldpi/ic_media_video_poster.png
new file mode 100644
index 0000000..786d0e6
--- /dev/null
+++ b/core/res/res/drawable-ldpi/ic_media_video_poster.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_media_video_poster.png b/core/res/res/drawable-mdpi/ic_media_video_poster.png
new file mode 100644
index 0000000..10bbd74
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_media_video_poster.png
Binary files differ
diff --git a/include/private/hwui/DrawGlInfo.h b/include/private/hwui/DrawGlInfo.h
new file mode 100644
index 0000000..1e9912b
--- /dev/null
+++ b/include/private/hwui/DrawGlInfo.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWUI_DRAW_GL_INFO_H
+#define ANDROID_HWUI_DRAW_GL_INFO_H
+
+namespace android {
+namespace uirenderer {
+
+/**
+ * Structure used by OpenGLRenderer::callDrawGLFunction() to pass and
+ * receive data from OpenGL functors.
+ */
+struct DrawGlInfo {
+    // Input: current clip rect
+    int clipLeft;
+    int clipTop;
+    int clipRight;
+    int clipBottom;
+
+    // Input: is the render target an FBO
+    bool isLayer;
+
+    // Input: current transform matrix, in OpenGL format
+    float transform[16];
+
+    // Output: dirty region to redraw
+    float dirtyLeft;
+    float dirtyTop;
+    float dirtyRight;
+    float dirtyBottom;
+}; // struct DrawGlInfo
+
+}; // namespace uirenderer
+}; // namespace android
+
+#endif // ANDROID_HWUI_DRAW_GL_INFO_H
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index d265804..d9d7d231 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -26,6 +26,8 @@
 #include <utils/Log.h>
 #include <utils/StopWatch.h>
 
+#include <private/hwui/DrawGlInfo.h>
+
 #include <ui/Rect.h>
 
 #include "OpenGLRenderer.h"
@@ -227,30 +229,18 @@
     }
 #endif
 
-    struct {
-        // Input: current clip rect
-        int clipLeft;
-        int clipTop;
-        int clipRight;
-        int clipBottom;
+    DrawGlInfo info;
+    info.clipLeft = clip.left;
+    info.clipTop = clip.top;
+    info.clipRight = clip.right;
+    info.clipBottom = clip.bottom;
+    info.isLayer = hasLayer();
+    getSnapshot()->transform->copyTo(&info.transform[0]);
 
-        // Output: dirty region to redraw
-        float dirtyLeft;
-        float dirtyTop;
-        float dirtyRight;
-        float dirtyBottom;
-    } constraints;
-
-    constraints.clipLeft = clip.left;
-    constraints.clipTop = clip.top;
-    constraints.clipRight = clip.right;
-    constraints.clipBottom = clip.bottom;
-
-    status_t result = (*functor)(0, &constraints);
+    status_t result = (*functor)(0, &info);
 
     if (result != 0) {
-        Rect localDirty(constraints.dirtyLeft, constraints.dirtyTop,
-                constraints.dirtyRight, constraints.dirtyBottom);
+        Rect localDirty(info.dirtyLeft, info.dirtyTop, info.dirtyRight, info.dirtyBottom);
         dirty.unionWith(localDirty);
     }
 
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaItemThumbnailTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaItemThumbnailTest.java
index 895ca25..154f691 100755
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaItemThumbnailTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaItemThumbnailTest.java
@@ -585,7 +585,9 @@
         try{
         final MediaImageItem mii = new MediaImageItem(mVideoEditor, "m1",
             imageItemFileName, 3000, renderingMode);
-        }catch (IllegalArgumentException e){
+        } catch (IllegalArgumentException e) {
+            flagForException = true;
+        } catch (IOException e) {
             flagForException = true;
         }
         assertTrue(" Invalid File Path", flagForException);
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPropertiesTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPropertiesTest.java
index 3efa5b2..958bbb0 100755
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPropertiesTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPropertiesTest.java
@@ -513,6 +513,8 @@
                 MediaItem.RENDERING_MODE_BLACK_BORDER);
         } catch (IllegalArgumentException e) {
             flagForException = true;
+        } catch (IOException e) {
+            flagForException = true;
         }
         assertTrue("Media Properties for non exsisting file", flagForException);
      }
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index cd24478..517c335 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -809,7 +809,7 @@
 
     { // scope for strong mUserClient reference
         sp<UserClient> userClient(mUserClient.promote());
-        if (mUserClient != 0 && mControlBlock != 0) {
+        if (userClient != 0 && mControlBlock != 0) {
             mControlBlock->setStatus(NO_INIT);
         }
     }