Backport Material text handles pre-Lollipop

BUG: 28896163
Change-Id: I4cb4ffd31fd0438616b96358b393141b914a20b3
diff --git a/v7/appcompat/api/current.txt b/v7/appcompat/api/current.txt
index dc931b3..93e588d 100644
--- a/v7/appcompat/api/current.txt
+++ b/v7/appcompat/api/current.txt
@@ -816,6 +816,9 @@
     field public static int abc_tab_indicator_material;
     field public static int abc_tab_indicator_mtrl_alpha;
     field public static int abc_text_cursor_material;
+    field public static int abc_text_select_handle_left_mtrl_alpha;
+    field public static int abc_text_select_handle_middle_mtrl_alpha;
+    field public static int abc_text_select_handle_right_mtrl_alpha;
     field public static int abc_textfield_activated_mtrl_alpha;
     field public static int abc_textfield_default_mtrl_alpha;
     field public static int abc_textfield_search_activated_mtrl_alpha;
diff --git a/v7/appcompat/res/drawable-hdpi/abc_text_select_handle_left_mtrl_alpha.png b/v7/appcompat/res/drawable-hdpi/abc_text_select_handle_left_mtrl_alpha.png
new file mode 100644
index 0000000..3ab6586
--- /dev/null
+++ b/v7/appcompat/res/drawable-hdpi/abc_text_select_handle_left_mtrl_alpha.png
Binary files differ
diff --git a/v7/appcompat/res/drawable-hdpi/abc_text_select_handle_middle_mtrl_alpha.png b/v7/appcompat/res/drawable-hdpi/abc_text_select_handle_middle_mtrl_alpha.png
new file mode 100644
index 0000000..ba309c3
--- /dev/null
+++ b/v7/appcompat/res/drawable-hdpi/abc_text_select_handle_middle_mtrl_alpha.png
Binary files differ
diff --git a/v7/appcompat/res/drawable-hdpi/abc_text_select_handle_right_mtrl_alpha.png b/v7/appcompat/res/drawable-hdpi/abc_text_select_handle_right_mtrl_alpha.png
new file mode 100644
index 0000000..f9ab27a
--- /dev/null
+++ b/v7/appcompat/res/drawable-hdpi/abc_text_select_handle_right_mtrl_alpha.png
Binary files differ
diff --git a/v7/appcompat/res/drawable-mdpi/abc_text_select_handle_left_mtrl_alpha.png b/v7/appcompat/res/drawable-mdpi/abc_text_select_handle_left_mtrl_alpha.png
new file mode 100644
index 0000000..af067a7
--- /dev/null
+++ b/v7/appcompat/res/drawable-mdpi/abc_text_select_handle_left_mtrl_alpha.png
Binary files differ
diff --git a/v7/appcompat/res/drawable-mdpi/abc_text_select_handle_middle_mtrl_alpha.png b/v7/appcompat/res/drawable-mdpi/abc_text_select_handle_middle_mtrl_alpha.png
new file mode 100644
index 0000000..da64e70
--- /dev/null
+++ b/v7/appcompat/res/drawable-mdpi/abc_text_select_handle_middle_mtrl_alpha.png
Binary files differ
diff --git a/v7/appcompat/res/drawable-mdpi/abc_text_select_handle_right_mtrl_alpha.png b/v7/appcompat/res/drawable-mdpi/abc_text_select_handle_right_mtrl_alpha.png
new file mode 100644
index 0000000..0df9651
--- /dev/null
+++ b/v7/appcompat/res/drawable-mdpi/abc_text_select_handle_right_mtrl_alpha.png
Binary files differ
diff --git a/v7/appcompat/res/drawable-xhdpi/abc_text_select_handle_left_mtrl_alpha.png b/v7/appcompat/res/drawable-xhdpi/abc_text_select_handle_left_mtrl_alpha.png
new file mode 100644
index 0000000..dc8bae0
--- /dev/null
+++ b/v7/appcompat/res/drawable-xhdpi/abc_text_select_handle_left_mtrl_alpha.png
Binary files differ
diff --git a/v7/appcompat/res/drawable-xhdpi/abc_text_select_handle_middle_mtrl_alpha.png b/v7/appcompat/res/drawable-xhdpi/abc_text_select_handle_middle_mtrl_alpha.png
new file mode 100644
index 0000000..1286d11
--- /dev/null
+++ b/v7/appcompat/res/drawable-xhdpi/abc_text_select_handle_middle_mtrl_alpha.png
Binary files differ
diff --git a/v7/appcompat/res/drawable-xhdpi/abc_text_select_handle_right_mtrl_alpha.png b/v7/appcompat/res/drawable-xhdpi/abc_text_select_handle_right_mtrl_alpha.png
new file mode 100644
index 0000000..e50225a
--- /dev/null
+++ b/v7/appcompat/res/drawable-xhdpi/abc_text_select_handle_right_mtrl_alpha.png
Binary files differ
diff --git a/v7/appcompat/res/drawable-xxhdpi/abc_text_select_handle_left_mtrl_alpha.png b/v7/appcompat/res/drawable-xxhdpi/abc_text_select_handle_left_mtrl_alpha.png
new file mode 100644
index 0000000..2cf61b8
--- /dev/null
+++ b/v7/appcompat/res/drawable-xxhdpi/abc_text_select_handle_left_mtrl_alpha.png
Binary files differ
diff --git a/v7/appcompat/res/drawable-xxhdpi/abc_text_select_handle_middle_mtrl_alpha.png b/v7/appcompat/res/drawable-xxhdpi/abc_text_select_handle_middle_mtrl_alpha.png
new file mode 100644
index 0000000..7202f6d
--- /dev/null
+++ b/v7/appcompat/res/drawable-xxhdpi/abc_text_select_handle_middle_mtrl_alpha.png
Binary files differ
diff --git a/v7/appcompat/res/drawable-xxhdpi/abc_text_select_handle_right_mtrl_alpha.png b/v7/appcompat/res/drawable-xxhdpi/abc_text_select_handle_right_mtrl_alpha.png
new file mode 100644
index 0000000..0999989
--- /dev/null
+++ b/v7/appcompat/res/drawable-xxhdpi/abc_text_select_handle_right_mtrl_alpha.png
Binary files differ
diff --git a/v7/appcompat/res/drawable-xxxhdpi/abc_text_select_handle_left_mtrl_alpha.png b/v7/appcompat/res/drawable-xxxhdpi/abc_text_select_handle_left_mtrl_alpha.png
new file mode 100644
index 0000000..c87ee03
--- /dev/null
+++ b/v7/appcompat/res/drawable-xxxhdpi/abc_text_select_handle_left_mtrl_alpha.png
Binary files differ
diff --git a/v7/appcompat/res/drawable-xxxhdpi/abc_text_select_handle_right_mtrl_alpha.png b/v7/appcompat/res/drawable-xxxhdpi/abc_text_select_handle_right_mtrl_alpha.png
new file mode 100644
index 0000000..7bda3c8
--- /dev/null
+++ b/v7/appcompat/res/drawable-xxxhdpi/abc_text_select_handle_right_mtrl_alpha.png
Binary files differ
diff --git a/v7/appcompat/res/values-v11/themes_base.xml b/v7/appcompat/res/values-v11/themes_base.xml
index 2098ec7..f787454 100644
--- a/v7/appcompat/res/values-v11/themes_base.xml
+++ b/v7/appcompat/res/values-v11/themes_base.xml
@@ -74,6 +74,10 @@
         <item name="android:actionModeCutDrawable">?actionModeCutDrawable</item>
         <item name="android:actionModeCopyDrawable">?actionModeCopyDrawable</item>
         <item name="android:actionModePasteDrawable">?actionModePasteDrawable</item>
+
+        <item name="android:textSelectHandle">@drawable/abc_text_select_handle_middle_mtrl_alpha</item>
+        <item name="android:textSelectHandleLeft">@drawable/abc_text_select_handle_left_mtrl_alpha</item>
+        <item name="android:textSelectHandleRight">@drawable/abc_text_select_handle_right_mtrl_alpha</item>
     </style>
 
     <style name="Platform.V11.AppCompat.Light" parent="android:Theme.Holo.Light">
@@ -125,6 +129,10 @@
         <item name="android:actionModeCutDrawable">?actionModeCutDrawable</item>
         <item name="android:actionModeCopyDrawable">?actionModeCopyDrawable</item>
         <item name="android:actionModePasteDrawable">?actionModePasteDrawable</item>
+
+        <item name="android:textSelectHandle">@drawable/abc_text_select_handle_middle_mtrl_alpha</item>
+        <item name="android:textSelectHandleLeft">@drawable/abc_text_select_handle_left_mtrl_alpha</item>
+        <item name="android:textSelectHandleRight">@drawable/abc_text_select_handle_right_mtrl_alpha</item>
     </style>
 
     <style name="Base.V11.Theme.AppCompat.Dialog" parent="Base.V7.Theme.AppCompat.Dialog">
diff --git a/v7/appcompat/res/values/themes_base.xml b/v7/appcompat/res/values/themes_base.xml
index ab45f55..70917b5 100644
--- a/v7/appcompat/res/values/themes_base.xml
+++ b/v7/appcompat/res/values/themes_base.xml
@@ -59,6 +59,10 @@
 
         <item name="android:listChoiceIndicatorSingle">@drawable/abc_btn_radio_material</item>
         <item name="android:listChoiceIndicatorMultiple">@drawable/abc_btn_check_material</item>
+
+        <item name="android:textSelectHandle">@drawable/abc_text_select_handle_middle_mtrl_alpha</item>
+        <item name="android:textSelectHandleLeft">@drawable/abc_text_select_handle_left_mtrl_alpha</item>
+        <item name="android:textSelectHandleRight">@drawable/abc_text_select_handle_right_mtrl_alpha</item>
     </style>
 
     <style name="Platform.AppCompat.Light" parent="android:Theme.Light">
@@ -99,6 +103,10 @@
 
         <item name="android:listChoiceIndicatorSingle">@drawable/abc_btn_radio_material</item>
         <item name="android:listChoiceIndicatorMultiple">@drawable/abc_btn_check_material</item>
+
+        <item name="android:textSelectHandle">@drawable/abc_text_select_handle_middle_mtrl_alpha</item>
+        <item name="android:textSelectHandleLeft">@drawable/abc_text_select_handle_left_mtrl_alpha</item>
+        <item name="android:textSelectHandleRight">@drawable/abc_text_select_handle_right_mtrl_alpha</item>
     </style>
 
     <!-- Themes in the "Base.Theme" family vary based on the current platform
diff --git a/v7/appcompat/src/android/support/v7/widget/AppCompatDrawableManager.java b/v7/appcompat/src/android/support/v7/widget/AppCompatDrawableManager.java
index c0a32b2..4abad6b 100644
--- a/v7/appcompat/src/android/support/v7/widget/AppCompatDrawableManager.java
+++ b/v7/appcompat/src/android/support/v7/widget/AppCompatDrawableManager.java
@@ -133,7 +133,10 @@
             R.drawable.abc_textfield_activated_mtrl_alpha,
             R.drawable.abc_textfield_search_activated_mtrl_alpha,
             R.drawable.abc_cab_background_top_mtrl_alpha,
-            R.drawable.abc_text_cursor_material
+            R.drawable.abc_text_cursor_material,
+            R.drawable.abc_text_select_handle_left_mtrl_alpha,
+            R.drawable.abc_text_select_handle_middle_mtrl_alpha,
+            R.drawable.abc_text_select_handle_right_mtrl_alpha
     };
 
     /**