Merge "Support post-decode video rotation."
diff --git a/api/current.xml b/api/current.xml
index 357daae..c9c6f6f 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -19596,6 +19596,17 @@
  synchronized="false"
  static="false"
  final="false"
+ deprecated="deprecated"
+ visibility="public"
+>
+</method>
+<method name="getCustomView"
+ return="android.view.View"
+ abstract="true"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
  deprecated="not deprecated"
  visibility="public"
 >
diff --git a/core/java/android/app/ActionBar.java b/core/java/android/app/ActionBar.java
index a57b54a..246d661 100644
--- a/core/java/android/app/ActionBar.java
+++ b/core/java/android/app/ActionBar.java
@@ -138,14 +138,19 @@
      * Set the action bar into custom navigation mode, supplying a view
      * for custom navigation.
      * 
-     * Custom navigation views appear between the application icon and
+     * <p>Custom navigation views appear between the application icon and
      * any action buttons and may use any space available there. Common
      * use cases for custom navigation views might include an auto-suggesting
      * address bar for a browser or other navigation mechanisms that do not
-     * translate well to provided navigation modes.
+     * translate well to provided navigation modes.</p>
+     *
+     * <p>The display option {@link #DISPLAY_SHOW_CUSTOM} must be set for
+     * the custom view to be displayed.</p>
      * 
      * @param view Custom navigation view to place in the ActionBar.
      * @param layoutParams How this custom view should layout in the bar.
+     *
+     * @see #setDisplayOptions(int, int)
      */
     public abstract void setCustomView(View view, LayoutParams layoutParams);
 
@@ -248,39 +253,47 @@
     public abstract void setStandardNavigationMode();
 
     /**
-     * Set the action bar's title. This will only be displayed in standard navigation mode.
+     * Set the action bar's title. This will only be displayed if
+     * {@link #DISPLAY_SHOW_TITLE} is set.
      *
      * @param title Title to set
      *
      * @see #setTitle(int)
+     * @see #setDisplayOptions(int, int)
      */
     public abstract void setTitle(CharSequence title);
 
     /**
-     * Set the action bar's title. This will only be displayed in standard navigation mode.
+     * Set the action bar's title. This will only be displayed if
+     * {@link #DISPLAY_SHOW_TITLE} is set.
      *
      * @param resId Resource ID of title string to set
      *
      * @see #setTitle(CharSequence)
+     * @see #setDisplayOptions(int, int)
      */
     public abstract void setTitle(int resId);
 
     /**
-     * Set the action bar's subtitle. This will only be displayed in standard navigation mode.
-     * Set to null to disable the subtitle entirely.
+     * Set the action bar's subtitle. This will only be displayed if
+     * {@link #DISPLAY_SHOW_TITLE} is set. Set to null to disable the
+     * subtitle entirely.
      *
      * @param subtitle Subtitle to set
      *
      * @see #setSubtitle(int)
+     * @see #setDisplayOptions(int, int)
      */
     public abstract void setSubtitle(CharSequence subtitle);
 
     /**
-     * Set the action bar's subtitle. This will only be displayed in standard navigation mode.
+     * Set the action bar's subtitle. This will only be displayed if
+     * {@link #DISPLAY_SHOW_TITLE} is set.
      *
      * @param resId Resource ID of subtitle string to set
      *
      * @see #setSubtitle(CharSequence)
+     * @see #setDisplayOptions(int, int)
      */
     public abstract void setSubtitle(int resId);
 
@@ -317,9 +330,16 @@
     
     /**
      * @return The current custom navigation view.
+     * @deprecated Method has been renamed. Use {@link #getCustomView()}.
      */
+    @Deprecated
     public abstract View getCustomNavigationView();
-    
+
+    /**
+     * @return The current custom view.
+     */
+    public abstract View getCustomView();
+
     /**
      * Returns the current ActionBar title in standard mode.
      * Returns null if {@link #getNavigationMode()} would not return
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index b143325..fbc8549 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -305,6 +305,8 @@
     int mTextSelectHandleRes;
     int mTextEditPasteWindowLayout;
     int mTextEditNoPasteWindowLayout;
+    Drawable mEditTextMultilineBackground;
+    Drawable mEditTextSingleLineBackground;
 
     Drawable mSelectHandleLeft;
     Drawable mSelectHandleRight;
@@ -751,6 +753,10 @@
                 mTextEditNoPasteWindowLayout = a.getResourceId(attr, 0);
                 break;
 
+            case com.android.internal.R.styleable.TextView_multilineBackground:
+                mEditTextMultilineBackground = a.getDrawable(attr);
+                break;
+
             case com.android.internal.R.styleable.TextView_textLineHeight:
                 int lineHeight = a.getDimensionPixelSize(attr, 0);
                 if (lineHeight != 0) {
@@ -765,6 +771,7 @@
         }
         a.recycle();
 
+        mEditTextSingleLineBackground = getBackground();
         BufferType bufferType = BufferType.EDITABLE;
 
         final int variation =
@@ -6192,12 +6199,14 @@
             if (applyTransformation) {
                 setTransformationMethod(SingleLineTransformationMethod.getInstance());
             }
+            setBackgroundDrawable(mEditTextSingleLineBackground);
         } else {
             setMaxLines(Integer.MAX_VALUE);
             setHorizontallyScrolling(false);
             if (applyTransformation) {
                 setTransformationMethod(null);
             }
+            setBackgroundDrawable(mEditTextMultilineBackground);
         }
     }
     
diff --git a/core/java/com/android/internal/app/ActionBarImpl.java b/core/java/com/android/internal/app/ActionBarImpl.java
index cd1cae6..86523ac 100644
--- a/core/java/com/android/internal/app/ActionBarImpl.java
+++ b/core/java/com/android/internal/app/ActionBarImpl.java
@@ -212,6 +212,10 @@
     }
 
     public View getCustomNavigationView() {
+        return getCustomView();
+    }
+
+    public View getCustomView() {
         return mActionView.getCustomNavigationView();
     }
 
diff --git a/core/res/res/drawable-hdpi/textfield_active_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_active_holo_dark.9.png
new file mode 100644
index 0000000..a38c03a
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_active_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_active_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_active_holo_light.9.png
new file mode 100644
index 0000000..6a88a69
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_active_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_default_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_default_holo_dark.9.png
index 7ec2192..87d9c21 100644
--- a/core/res/res/drawable-hdpi/textfield_default_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/textfield_default_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_default_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_default_holo_light.9.png
index c03e4f6..720ee78 100644
--- a/core/res/res/drawable-hdpi/textfield_default_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/textfield_default_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_dark.9.png
new file mode 100644
index 0000000..4275da07
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_light.9.png
new file mode 100644
index 0000000..3ec9c1f
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_disabled_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_disabled_holo_dark.9.png
index 6642717..227bde2 100644
--- a/core/res/res/drawable-hdpi/textfield_disabled_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/textfield_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_disabled_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_disabled_holo_light.9.png
index 9572752..6ddfab0 100644
--- a/core/res/res/drawable-hdpi/textfield_disabled_holo_light.9.png
+++ b/core/res/res/drawable-hdpi/textfield_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_dark.9.png
deleted file mode 100644
index 0ad248c..0000000
--- a/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_light.9.png
deleted file mode 100644
index b7a07c4..0000000
--- a/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_active_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_multiline_active_holo_dark.9.png
new file mode 100644
index 0000000..7528479
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_active_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_active_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_multiline_active_holo_light.9.png
new file mode 100644
index 0000000..4c7d9e7
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_active_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_default_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_multiline_default_holo_dark.9.png
new file mode 100644
index 0000000..09ca253
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_default_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_default_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_multiline_default_holo_light.9.png
new file mode 100644
index 0000000..0a7d3a1
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_default_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_dark.9.png
new file mode 100644
index 0000000..54a1519
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_light.9.png
new file mode 100644
index 0000000..06ca0d4
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_dark.9.png
new file mode 100644
index 0000000..9015299
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_light.9.png
new file mode 100644
index 0000000..b355cb3
--- /dev/null
+++ b/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_pressed.9.png b/core/res/res/drawable-hdpi/textfield_pressed.9.png
deleted file mode 100644
index a42d87f..0000000
--- a/core/res/res/drawable-hdpi/textfield_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_pressed_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_pressed_holo_dark.9.png
deleted file mode 100644
index a271ac9b..0000000
--- a/core/res/res/drawable-hdpi/textfield_pressed_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_pressed_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_pressed_holo_light.9.png
deleted file mode 100644
index 521722d..0000000
--- a/core/res/res/drawable-hdpi/textfield_pressed_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_selected_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_selected_holo_dark.9.png
deleted file mode 100644
index a271ac9b..0000000
--- a/core/res/res/drawable-hdpi/textfield_selected_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/textfield_selected_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_selected_holo_light.9.png
deleted file mode 100644
index 521722d..0000000
--- a/core/res/res/drawable-hdpi/textfield_selected_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-ldpi/textfield_pressed.9.png b/core/res/res/drawable-ldpi/textfield_pressed.9.png
deleted file mode 100644
index 1433365..0000000
--- a/core/res/res/drawable-ldpi/textfield_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_active_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_active_holo_dark.9.png
new file mode 100644
index 0000000..d37c8b2
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_active_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_active_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_active_holo_light.9.png
new file mode 100644
index 0000000..16f2197
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_active_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_default_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_default_holo_dark.9.png
index 3a5f36d..c98c951 100644
--- a/core/res/res/drawable-mdpi/textfield_default_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/textfield_default_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_default_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_default_holo_light.9.png
index b8cc76f..7691f81 100644
--- a/core/res/res/drawable-mdpi/textfield_default_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/textfield_default_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_dark.9.png
new file mode 100644
index 0000000..500ede3
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_light.9.png
new file mode 100644
index 0000000..99f7f38
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_disabled_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_disabled_holo_dark.9.png
index a1f0c71..fab86ac 100644
--- a/core/res/res/drawable-mdpi/textfield_disabled_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/textfield_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_disabled_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_disabled_holo_light.9.png
index 71e3103..876eb794 100644
--- a/core/res/res/drawable-mdpi/textfield_disabled_holo_light.9.png
+++ b/core/res/res/drawable-mdpi/textfield_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_dark.9.png
deleted file mode 100644
index ac6d406..0000000
--- a/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_light.9.png
deleted file mode 100644
index bb6e953..0000000
--- a/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_active_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_multiline_active_holo_dark.9.png
new file mode 100644
index 0000000..2646899
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_active_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_active_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_multiline_active_holo_light.9.png
new file mode 100644
index 0000000..374d457
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_active_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_default_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_multiline_default_holo_dark.9.png
new file mode 100644
index 0000000..65c87ba
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_default_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_default_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_multiline_default_holo_light.9.png
new file mode 100644
index 0000000..724b3fd
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_default_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_dark.9.png
new file mode 100644
index 0000000..5f0ad56
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_light.9.png
new file mode 100644
index 0000000..df03a15
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_dark.9.png
new file mode 100644
index 0000000..2cc7f62
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_light.9.png
new file mode 100644
index 0000000..a2d9d8a
--- /dev/null
+++ b/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_pressed.9.png b/core/res/res/drawable-mdpi/textfield_pressed.9.png
deleted file mode 100644
index c909ad2..0000000
--- a/core/res/res/drawable-mdpi/textfield_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_pressed_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_pressed_holo_dark.9.png
deleted file mode 100644
index 7667d95..0000000
--- a/core/res/res/drawable-mdpi/textfield_pressed_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_pressed_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_pressed_holo_light.9.png
deleted file mode 100644
index 269affd..0000000
--- a/core/res/res/drawable-mdpi/textfield_pressed_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_selected_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_selected_holo_dark.9.png
deleted file mode 100644
index 7667d95..0000000
--- a/core/res/res/drawable-mdpi/textfield_selected_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/textfield_selected_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_selected_holo_light.9.png
deleted file mode 100644
index 269affd..0000000
--- a/core/res/res/drawable-mdpi/textfield_selected_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable/edit_text.xml b/core/res/res/drawable/edit_text.xml
index 315278d..e9ba84b 100644
--- a/core/res/res/drawable/edit_text.xml
+++ b/core/res/res/drawable/edit_text.xml
@@ -15,11 +15,8 @@
 -->
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_window_focused="false" android:state_enabled="true"
-        android:drawable="@drawable/textfield_default" />
-    <item android:state_window_focused="false" android:state_enabled="false"
-        android:drawable="@drawable/textfield_disabled" />
-    <item android:state_pressed="true" android:drawable="@drawable/textfield_pressed" />
+    <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_default" />
+    <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_disabled" />
     <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_selected" />
     <item android:state_enabled="true" android:drawable="@drawable/textfield_default" />
     <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_selected" />
diff --git a/core/res/res/drawable/edit_text_holo_dark.xml b/core/res/res/drawable/edit_text_holo_dark.xml
index b7d24ff..63ccd1d 100644
--- a/core/res/res/drawable/edit_text_holo_dark.xml
+++ b/core/res/res/drawable/edit_text_holo_dark.xml
@@ -15,14 +15,11 @@
 -->
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_window_focused="false" android:state_enabled="true"
-        android:drawable="@drawable/textfield_default_holo_dark" />
-    <item android:state_window_focused="false" android:state_enabled="false"
-        android:drawable="@drawable/textfield_disabled_holo_dark" />
-    <item android:state_pressed="true" android:drawable="@drawable/textfield_pressed_holo_dark" />
-    <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_selected_holo_dark" />
+    <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_dark" />
+    <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_disabled_holo_dark" />
+    <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_active_holo_dark" />
     <item android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_dark" />
-    <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_selected_holo_dark" />
+    <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_focused_holo_dark" />
     <item android:drawable="@drawable/textfield_disabled_holo_dark" />
 </selector>
 
diff --git a/core/res/res/drawable/edit_text_holo_light.xml b/core/res/res/drawable/edit_text_holo_light.xml
index dae39e3..324acda 100644
--- a/core/res/res/drawable/edit_text_holo_light.xml
+++ b/core/res/res/drawable/edit_text_holo_light.xml
@@ -15,14 +15,11 @@
 -->
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_window_focused="false" android:state_enabled="true"
-        android:drawable="@drawable/textfield_default_holo_light" />
-    <item android:state_window_focused="false" android:state_enabled="false"
-        android:drawable="@drawable/textfield_disabled_holo_light" />
-    <item android:state_pressed="true" android:drawable="@drawable/textfield_pressed_holo_light" />
-    <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_selected_holo_light" />
+    <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_light" />
+    <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_disabled_holo_light" />
+    <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_active_holo_light" />
     <item android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_light" />
-    <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_selected_holo_light" />
+    <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_focused_holo_light" />
     <item android:drawable="@drawable/textfield_disabled_holo_light" />
 </selector>
 
diff --git a/core/res/res/drawable/edit_text_multiline_holo_dark.xml b/core/res/res/drawable/edit_text_multiline_holo_dark.xml
new file mode 100644
index 0000000..67d2748
--- /dev/null
+++ b/core/res/res/drawable/edit_text_multiline_holo_dark.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_window_focused="false" android:state_enabled="true"  android:drawable="@drawable/textfield_multiline_default_holo_dark" />
+    <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_multiline_disabled_holo_dark" />
+    <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_multiline_active_holo_dark" />
+    <item android:state_enabled="true" android:drawable="@drawable/textfield_multiline_default_holo_dark" />
+    <item android:state_focused="true" android:drawable="@drawable/textfield_multiline_disabled_focused_holo_dark" />
+    <item android:drawable="@drawable/textfield_multiline_disabled_holo_dark" />
+</selector>
diff --git a/core/res/res/drawable/edit_text_multiline_holo_light.xml b/core/res/res/drawable/edit_text_multiline_holo_light.xml
new file mode 100644
index 0000000..08b3ec6
--- /dev/null
+++ b/core/res/res/drawable/edit_text_multiline_holo_light.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_window_focused="false" android:state_enabled="true"  android:drawable="@drawable/textfield_multiline_default_holo_light" />
+    <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_multiline_disabled_holo_light" />
+    <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_multiline_active_holo_light" />
+    <item android:state_enabled="true" android:drawable="@drawable/textfield_multiline_default_holo_light" />
+    <item android:state_focused="true" android:drawable="@drawable/textfield_multiline_disabled_focused_holo_light" />
+    <item android:drawable="@drawable/textfield_multiline_disabled_holo_light" />
+</selector>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 0b61202..55b3258 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -142,6 +142,8 @@
         <attr name="editTextColor" format="reference|color" />
         <!-- EditText background drawable. -->
         <attr name="editTextBackground" format="reference" />
+        <!-- EditText background drawable for multiline EditText. -->
+        <attr name="editTextMultilineBackground" format="reference" />
 
         <!-- A styled string, specifying the style to be used for showing
              inline candidate text when composing with an input method.  The
@@ -2508,7 +2510,8 @@
         <attr name="textLineHeight" />
         <!-- Indicates that a non-editable text can be selected. -->
         <attr name="textIsSelectable" />
-
+        <!--  A specific background drawable used by multi-line EditText only. -->
+        <attr name="multilineBackground" format="reference"/>
     </declare-styleable>
     <!-- An <code>input-extras</code> is a container for extra data to supply to
          an input method.  Contains
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index b2db9b4..dc67f45 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -422,6 +422,7 @@
         <item name="android:focusableInTouchMode">true</item>
         <item name="android:clickable">true</item>
         <item name="android:background">?android:attr/editTextBackground</item>
+        <item name="android:multilineBackground">?android:attr/editTextMultilineBackground</item>
         <item name="android:textAppearance">?android:attr/textAppearanceMediumInverse</item>
         <item name="android:textColor">?android:attr/editTextColor</item>
         <item name="android:gravity">center_vertical</item>
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 88e755f..dd7c8e48 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -72,6 +72,7 @@
         
         <item name="editTextColor">?android:attr/textColorPrimaryInverse</item>
         <item name="editTextBackground">@android:drawable/edit_text</item>
+        <item name="editTextMultilineBackground">@android:drawable/edit_text</item>
         
         <item name="candidatesTextStyleSpans">@android:string/candidates_style</item>
         
@@ -685,6 +686,7 @@
         
         <item name="editTextColor">?android:attr/textColorPrimary</item>
         <item name="editTextBackground">@android:drawable/edit_text_holo_dark</item>
+        <item name="editTextMultilineBackground">@android:drawable/edit_text_multiline_holo_dark</item>
         
         <item name="candidatesTextStyleSpans">@android:string/candidates_style</item>
         
@@ -917,10 +919,11 @@
         <item name="textAppearanceSearchResultSubtitle">@android:style/TextAppearance.Holo.Light.SearchResult.Subtitle</item>
         
         <item name="textAppearanceButton">@android:style/TextAppearance.Holo.Light.Widget.Button</item>
-        
+
         <item name="editTextColor">?android:attr/textColorPrimary</item>
         <item name="editTextBackground">@android:drawable/edit_text_holo_light</item>
-        
+        <item name="editTextMultilineBackground">@android:drawable/edit_text_multiline_holo_light</item>
+
         <item name="candidatesTextStyleSpans">@android:string/candidates_style</item>
         
         <item name="textCheckMark">@android:drawable/indicator_check_mark_light</item>
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp
index 033f316..072cc168 100644
--- a/libs/rs/rsScriptC.cpp
+++ b/libs/rs/rsScriptC.cpp
@@ -65,12 +65,11 @@
         void **dest = ((void ***)mEnviroment.mFieldAddress)[ct];
 
         if (rsc->props.mLogScripts) {
-            LOGV("%p ScriptC::setupScript slot=%i  dst=%p  src=%p  type=%p", rsc, ct, dest, ptr, mSlots[ct]->getType());
-
-            //const uint32_t *p32 = (const uint32_t *)ptr;
-            //for (uint32_t ct2=0; ct2 < mSlots[ct]->getType()->getDimX(); ct2++) {
-                //LOGE("  %i = 0x%08x ", ct2, p32[ct2]);
-            //}
+            if (mSlots[ct].get() != NULL) {
+                LOGV("%p ScriptC::setupScript slot=%i  dst=%p  src=%p  type=%p", rsc, ct, dest, ptr, mSlots[ct]->getType());
+            } else {
+                LOGV("%p ScriptC::setupScript slot=%i  dst=%p  src=%p  type=null", rsc, ct, dest, ptr);
+            }
         }
 
         if (dest) {
diff --git a/media/java/android/media/videoeditor/Effect.java b/media/java/android/media/videoeditor/Effect.java
index ef0aeb1..8fd0d27 100755
--- a/media/java/android/media/videoeditor/Effect.java
+++ b/media/java/android/media/videoeditor/Effect.java
@@ -76,7 +76,7 @@
 

     /**

      * Set the duration of the effect. If a preview or export is in progress,

-     * then this change is effective for next preview or export session. s

+     * then this change is effective for next preview or export session.

      *

      * @param durationMs of the effect in milliseconds

      */

@@ -85,9 +85,10 @@
             throw new IllegalArgumentException("Duration is too large");

         }

 

+        final long oldDurationMs = mDurationMs;

         mDurationMs = durationMs;

 

-        mMediaItem.invalidateTransitions(mStartTimeMs, mDurationMs);

+        mMediaItem.invalidateTransitions(mStartTimeMs, oldDurationMs, mStartTimeMs, mDurationMs);

     }

 

     /**

@@ -111,9 +112,10 @@
             throw new IllegalArgumentException("Start time is too large");

         }

 

+        final long oldStartTimeMs = mStartTimeMs;

         mStartTimeMs = startTimeMs;

 

-        mMediaItem.invalidateTransitions(mStartTimeMs, mDurationMs);

+        mMediaItem.invalidateTransitions(oldStartTimeMs, mDurationMs, mStartTimeMs, mDurationMs);

     }

 

     /**

@@ -134,10 +136,13 @@
             throw new IllegalArgumentException("Invalid start time or duration");

         }

 

+        final long oldStartTimeMs = mStartTimeMs;

+        final long oldDurationMs = mDurationMs;

+

         mStartTimeMs = startTimeMs;

         mDurationMs = durationMs;

 

-        mMediaItem.invalidateTransitions(mStartTimeMs, mDurationMs);

+        mMediaItem.invalidateTransitions(oldStartTimeMs, oldDurationMs, mStartTimeMs, mDurationMs);

     }

 

     /**

diff --git a/media/java/android/media/videoeditor/MediaImageItem.java b/media/java/android/media/videoeditor/MediaImageItem.java
index a4b0770..fa8d61b 100755
--- a/media/java/android/media/videoeditor/MediaImageItem.java
+++ b/media/java/android/media/videoeditor/MediaImageItem.java
@@ -242,15 +242,49 @@
      */

     @Override

     void invalidateTransitions(long startTimeMs, long durationMs) {

-        // Check if the effect overlaps with the beginning and end transitions

+        // Check if the item overlaps with the beginning and end transitions

         if (mBeginTransition != null) {

-            if (startTimeMs < mBeginTransition.getDuration()) {

+            if (isOverlapping(startTimeMs, durationMs, 0, mBeginTransition.getDuration())) {

                 mBeginTransition.invalidate();

             }

         }

 

         if (mEndTransition != null) {

-            if (startTimeMs + durationMs > mDurationMs - mEndTransition.getDuration()) {

+            final long transitionDurationMs = mEndTransition.getDuration();

+            if (isOverlapping(startTimeMs, durationMs,

+                    getDuration() - transitionDurationMs, transitionDurationMs)) {

+                mEndTransition.invalidate();

+            }

+        }

+    }

+

+    /*

+     * {@inheritDoc}

+     */

+    @Override

+    void invalidateTransitions(long oldStartTimeMs, long oldDurationMs, long newStartTimeMs,

+            long newDurationMs) {

+        // Check if the item overlaps with the beginning and end transitions

+        if (mBeginTransition != null) {

+            final long transitionDurationMs = mBeginTransition.getDuration();

+            // If the start time has changed and if the old or the new item

+            // overlaps with the begin transition, invalidate the transition.

+            if (oldStartTimeMs != newStartTimeMs &&

+                    (isOverlapping(oldStartTimeMs, oldDurationMs, 0, transitionDurationMs) ||

+                    isOverlapping(newStartTimeMs, newDurationMs, 0, transitionDurationMs))) {

+                mBeginTransition.invalidate();

+            }

+        }

+

+        if (mEndTransition != null) {

+            final long transitionDurationMs = mEndTransition.getDuration();

+            // If the start time + duration has changed and if the old or the new

+            // item overlaps the end transition, invalidate the transition/

+            if (oldStartTimeMs + oldDurationMs != newStartTimeMs + newDurationMs &&

+                    (isOverlapping(oldStartTimeMs, oldDurationMs,

+                            mDurationMs - transitionDurationMs, transitionDurationMs) ||

+                    isOverlapping(newStartTimeMs, newDurationMs,

+                            mDurationMs - transitionDurationMs, transitionDurationMs))) {

                 mEndTransition.invalidate();

             }

         }

diff --git a/media/java/android/media/videoeditor/MediaItem.java b/media/java/android/media/videoeditor/MediaItem.java
index 12f6084..20fd6c9 100755
--- a/media/java/android/media/videoeditor/MediaItem.java
+++ b/media/java/android/media/videoeditor/MediaItem.java
@@ -455,6 +455,40 @@
     abstract void invalidateTransitions(long startTimeMs, long durationMs);

 

     /**

+     * Invalidate the start and end transitions if necessary. This method is

+     * typically called when the start time and/or duration of an overlay or

+     * effect is changing.

+     *

+     * @param oldStartTimeMs The old start time of the effect or overlay

+     * @param oldDurationMs The old duration of the effect or overlay

+     * @param newStartTimeMs The new start time of the effect or overlay

+     * @param newDurationMs The new duration of the effect or overlay

+     */

+    abstract void invalidateTransitions(long oldStartTimeMs, long oldDurationMs,

+            long newStartTimeMs, long newDurationMs);

+

+    /**

+     * Check if two items overlap in time

+     *

+     * @param startTimeMs1 Item 1 start time

+     * @param durationMs1 Item 1 duration

+     * @param startTimeMs2 Item 2 start time

+     * @param durationMs2 Item 2 end time

+     *

+     * @return true if the two items overlap

+     */

+    protected boolean isOverlapping(long startTimeMs1, long durationMs1,

+            long startTimeMs2, long durationMs2) {

+       if (startTimeMs1 + durationMs1 <= startTimeMs2) {

+           return false;

+       } else if (startTimeMs1 >= startTimeMs2 + durationMs2) {

+           return false;

+       }

+

+       return true;

+    }

+

+    /**

      * Adjust the duration transitions.

      */

     protected void adjustTransitions() {

diff --git a/media/java/android/media/videoeditor/MediaVideoItem.java b/media/java/android/media/videoeditor/MediaVideoItem.java
index 745b00a..cb835b5 100755
--- a/media/java/android/media/videoeditor/MediaVideoItem.java
+++ b/media/java/android/media/videoeditor/MediaVideoItem.java
@@ -218,15 +218,52 @@
      */

     @Override

     void invalidateTransitions(long startTimeMs, long durationMs) {

-        // Check if the effect overlaps with the beginning and end transitions

+        // Check if the item overlaps with the beginning and end transitions

         if (mBeginTransition != null) {

-            if (startTimeMs < mBeginTransition.getDuration()) {

+            if (isOverlapping(startTimeMs, durationMs,

+                    mBeginBoundaryTimeMs, mBeginTransition.getDuration())) {

                 mBeginTransition.invalidate();

             }

         }

 

         if (mEndTransition != null) {

-            if (startTimeMs + durationMs > mEndBoundaryTimeMs - mEndTransition.getDuration()) {

+            final long transitionDurationMs = mEndTransition.getDuration();

+            if (isOverlapping(startTimeMs, durationMs,

+                    mEndBoundaryTimeMs - transitionDurationMs, transitionDurationMs)) {

+                mEndTransition.invalidate();

+            }

+        }

+    }

+

+    /*

+     * {@inheritDoc}

+     */

+    @Override

+    void invalidateTransitions(long oldStartTimeMs, long oldDurationMs, long newStartTimeMs,

+            long newDurationMs) {

+        // Check if the item overlaps with the beginning and end transitions

+        if (mBeginTransition != null) {

+            final long transitionDurationMs = mBeginTransition.getDuration();

+            // If the start time has changed and if the old or the new item

+            // overlaps with the begin transition, invalidate the transition.

+            if (oldStartTimeMs != newStartTimeMs &&

+                    (isOverlapping(oldStartTimeMs, oldDurationMs,

+                            mBeginBoundaryTimeMs, transitionDurationMs) ||

+                    isOverlapping(newStartTimeMs, newDurationMs,

+                            mBeginBoundaryTimeMs, transitionDurationMs))) {

+                mBeginTransition.invalidate();

+            }

+        }

+

+        if (mEndTransition != null) {

+            final long transitionDurationMs = mEndTransition.getDuration();

+            // If the start time + duration has changed and if the old or the new

+            // item overlaps the end transition, invalidate the transition/

+            if (oldStartTimeMs + oldDurationMs != newStartTimeMs + newDurationMs &&

+                    (isOverlapping(oldStartTimeMs, oldDurationMs,

+                            mEndBoundaryTimeMs - transitionDurationMs, transitionDurationMs) ||

+                    isOverlapping(newStartTimeMs, newDurationMs,

+                            mEndBoundaryTimeMs - transitionDurationMs, transitionDurationMs))) {

                 mEndTransition.invalidate();

             }

         }

diff --git a/media/java/android/media/videoeditor/Overlay.java b/media/java/android/media/videoeditor/Overlay.java
index e43f229..0174ba8 100755
--- a/media/java/android/media/videoeditor/Overlay.java
+++ b/media/java/android/media/videoeditor/Overlay.java
@@ -96,9 +96,10 @@
             throw new IllegalArgumentException("Duration is too large");

         }

 

+        final long oldDurationMs = mDurationMs;

         mDurationMs = durationMs;

 

-        mMediaItem.invalidateTransitions(mStartTimeMs, mDurationMs);

+        mMediaItem.invalidateTransitions(mStartTimeMs, oldDurationMs, mStartTimeMs, mDurationMs);

     }

 

     /**

@@ -120,9 +121,10 @@
             throw new IllegalArgumentException("Start time is too large");

         }

 

+        final long oldStartTimeMs = mStartTimeMs;

         mStartTimeMs = startTimeMs;

 

-        mMediaItem.invalidateTransitions(mStartTimeMs, mDurationMs);

+        mMediaItem.invalidateTransitions(oldStartTimeMs, mDurationMs, mStartTimeMs, mDurationMs);

     }

 

     /**

@@ -136,10 +138,13 @@
             throw new IllegalArgumentException("Invalid start time or duration");

         }

 

+        final long oldStartTimeMs = mStartTimeMs;

+        final long oldDurationMs = mDurationMs;

+

         mStartTimeMs = startTimeMs;

         mDurationMs = durationMs;

 

-        mMediaItem.invalidateTransitions(mStartTimeMs, mDurationMs);

+        mMediaItem.invalidateTransitions(oldStartTimeMs, oldDurationMs, mStartTimeMs, mDurationMs);

     }

 

     /**

diff --git a/media/java/android/media/videoeditor/WaveformData.java b/media/java/android/media/videoeditor/WaveformData.java
index b53bd7d..5791046 100644
--- a/media/java/android/media/videoeditor/WaveformData.java
+++ b/media/java/android/media/videoeditor/WaveformData.java
@@ -16,6 +16,8 @@
 
 package android.media.videoeditor;
 
+import java.io.IOException;
+
 /**
  * Class which describes the waveform data of an audio track. The gain values
  * represent the average gain for an audio frame. For audio codecs which do
@@ -33,7 +35,7 @@
      * This constructor shall not be used
      */
     @SuppressWarnings("unused")
-    private WaveformData() {
+    private WaveformData() throws IOException {
         mFrameDurationMs = 0;
         mFramesCount = 0;
         mGains = null;