Merge "Fix bug 6886990: cling accessibility" into jb-mr1-dev
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_architecture.jpg b/res/drawable-sw720dp-nodpi/wallpaper_00.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_architecture.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_00.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_architecture_small.jpg b/res/drawable-sw720dp-nodpi/wallpaper_00_small.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_architecture_small.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_00_small.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_bubblegum.jpg b/res/drawable-sw720dp-nodpi/wallpaper_01.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_bubblegum.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_01.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_bubblegum_small.jpg b/res/drawable-sw720dp-nodpi/wallpaper_01_small.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_bubblegum_small.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_01_small.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_canyon.jpg b/res/drawable-sw720dp-nodpi/wallpaper_02.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_canyon.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_02.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_canyon_small.jpg b/res/drawable-sw720dp-nodpi/wallpaper_02_small.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_canyon_small.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_02_small.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_chroma.jpg b/res/drawable-sw720dp-nodpi/wallpaper_03.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_chroma.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_03.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_chroma_small.jpg b/res/drawable-sw720dp-nodpi/wallpaper_03_small.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_chroma_small.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_03_small.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_escape.jpg b/res/drawable-sw720dp-nodpi/wallpaper_04.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_escape.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_04.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_escape_small.jpg b/res/drawable-sw720dp-nodpi/wallpaper_04_small.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_escape_small.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_04_small.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_fidelity.jpg b/res/drawable-sw720dp-nodpi/wallpaper_05.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_fidelity.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_05.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_fidelity_small.jpg b/res/drawable-sw720dp-nodpi/wallpaper_05_small.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_fidelity_small.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_05_small.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_flora.jpg b/res/drawable-sw720dp-nodpi/wallpaper_06.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_flora.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_06.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_flora_small.jpg b/res/drawable-sw720dp-nodpi/wallpaper_06_small.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_flora_small.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_06_small.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_kepler.jpg b/res/drawable-sw720dp-nodpi/wallpaper_07.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_kepler.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_07.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_kepler_small.jpg b/res/drawable-sw720dp-nodpi/wallpaper_07_small.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_kepler_small.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_07_small.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_leaf.jpg b/res/drawable-sw720dp-nodpi/wallpaper_08.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_leaf.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_08.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_leaf_small.jpg b/res/drawable-sw720dp-nodpi/wallpaper_08_small.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_leaf_small.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_08_small.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_noir.jpg b/res/drawable-sw720dp-nodpi/wallpaper_09.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_noir.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_09.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_noir_small.jpg b/res/drawable-sw720dp-nodpi/wallpaper_09_small.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_noir_small.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_09_small.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_outofthebox.jpg b/res/drawable-sw720dp-nodpi/wallpaper_10.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_outofthebox.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_10.jpg
Binary files differ
diff --git a/res/drawable-sw720dp-nodpi/wallpaper_outofthebox_small.jpg b/res/drawable-sw720dp-nodpi/wallpaper_10_small.jpg
similarity index 100%
rename from res/drawable-sw720dp-nodpi/wallpaper_outofthebox_small.jpg
rename to res/drawable-sw720dp-nodpi/wallpaper_10_small.jpg
Binary files differ
diff --git a/res/layout/custom_workspace_cling.xml b/res/layout/custom_workspace_cling.xml
deleted file mode 100644
index 5bdc587..0000000
--- a/res/layout/custom_workspace_cling.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 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.
--->
-<!-- dummy layout, to be replaced in overlays -->
-<com.android.launcher2.Cling
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
-    launcher:drawIdentifier="workspace_custom">
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:textSize="20dp"
-        android:textColor="@android:color/holo_blue_light"
-        android:text="@string/dummy_custom_cling_error_message"
-        android:gravity="left"
-        android:layout_gravity="bottom|left"
-    />
-</com.android.launcher2.Cling>
diff --git a/res/values-am/strings.xml b/res/values-am/strings.xml
index 2319638..63a0972 100644
--- a/res/values-am/strings.xml
+++ b/res/values-am/strings.xml
@@ -91,7 +91,7 @@
     <string name="default_scroll_format" msgid="4057140866420001240">"ገጽ %1$d የ %2$d"</string>
     <string name="workspace_scroll_format" msgid="1704767047951143301">"መነሻ ማያ ገጽ %1$d ከ%2$d"</string>
     <string name="apps_customize_apps_scroll_format" msgid="5494241912377704885">"Appsገጽ %1$d የ %2$d"</string>
-    <string name="apps_customize_widgets_scroll_format" msgid="5383009742241717437">"ምግብሮች ገጽ %1$d የ %2$d"</string>
+    <string name="apps_customize_widgets_scroll_format" msgid="5383009742241717437">"ፍርግሞች ገጽ %1$d የ %2$d"</string>
     <string name="workspace_cling_title" msgid="738396473989890567">"እቤትህ እንዳለህ ሆነሀ ዘና በል"</string>
     <string name="workspace_cling_move_item" msgid="791013895761065070">"ተወዳጅ መተግበሪያዎችህን እዚህ ላይ ማስቀመጥ ትችላለህ፡፡"</string>
     <string name="workspace_cling_open_all_apps" msgid="2459977609848572588">"ሁሉንም መተግበሪያዎችህን ለማየት፣ ክቡን ንካ::"</string>
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index 6ed84db..dc1f72f 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -19,13 +19,13 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="application_name" msgid="8424725141379931883">"Barra d\'execució ràpida"</string>
-    <string name="home" msgid="5921706419368316758">"Pàgina d\'inici"</string>
+    <string name="application_name" msgid="8424725141379931883">"Menú d\'aplicacions"</string>
+    <string name="home" msgid="5921706419368316758">"Casa"</string>
     <string name="uid_name" msgid="3371120195364560632">"Aplicacions principals d\'Android"</string>
     <string name="folder_name" msgid="8551881338202938211"></string>
     <string name="chooser_wallpaper" msgid="6063168087625352235">"Selecciona fons de pantalla de"</string>
-    <string name="wallpaper_instructions" msgid="4215640646180727542">"Defineix l\'empaperat"</string>
-    <string name="pick_wallpaper" msgid="5630222540525626723">"Empaperats"</string>
+    <string name="wallpaper_instructions" msgid="4215640646180727542">"Estableix el fons de pantalla"</string>
+    <string name="pick_wallpaper" msgid="5630222540525626723">"Fons de pantalla"</string>
     <string name="activity_not_found" msgid="217823393239365967">"L\'aplicació no s\'ha instal·lat."</string>
     <string name="widgets_tab_label" msgid="9145860100000983599">"Widgets"</string>
     <string name="long_press_widget_to_add" msgid="7395697462851217506">"Mantén premut un widget per triar-lo."</string>
@@ -40,7 +40,7 @@
     <string name="group_applications" msgid="2103752818818161976">"Aplicacions"</string>
     <string name="group_shortcuts" msgid="9133529424900391877">"Dreceres"</string>
     <string name="group_widgets" msgid="6704978494073105844">"Widgets"</string>
-    <string name="group_wallpapers" msgid="1568191644272224858">"Empaperats"</string>
+    <string name="group_wallpapers" msgid="1568191644272224858">"Fons de pantalla"</string>
     <string name="completely_out_of_space" msgid="1759078539443491182">"No queda espai a les pantalles d\'inici."</string>
     <string name="out_of_space" msgid="8365249326091984698">"Ja no queda espai en aquesta pantalla Inici."</string>
     <string name="hotseat_out_of_space" msgid="6304886797358479361">"No queda espai al hotseat."</string>
@@ -92,8 +92,8 @@
     <string name="workspace_scroll_format" msgid="1704767047951143301">"Pantalla d\'inici %1$d de %2$d"</string>
     <string name="apps_customize_apps_scroll_format" msgid="5494241912377704885">"Pàgina d\'aplicacions %1$d de %2$d"</string>
     <string name="apps_customize_widgets_scroll_format" msgid="5383009742241717437">"Pàgina de widgets %1$d de %2$d"</string>
-    <string name="workspace_cling_title" msgid="738396473989890567">"Posa\'t còmode"</string>
-    <string name="workspace_cling_move_item" msgid="791013895761065070">"Pots posar les teves aplicacions preferides aquí."</string>
+    <string name="workspace_cling_title" msgid="738396473989890567">"Personalitza el teu escriptori"</string>
+    <string name="workspace_cling_move_item" msgid="791013895761065070">"Ací pots col·locar les teves aplicacions preferides."</string>
     <string name="workspace_cling_open_all_apps" msgid="2459977609848572588">"Per veure totes les aplicacions, toca el cercle."</string>
     <string name="all_apps_cling_title" msgid="2559734712581447107">"Tria algunes aplicacions"</string>
     <string name="all_apps_cling_add_item" msgid="5665035103260318891">"Per afegir una aplicació a la pantalla d\'inici, mantén-la premuda."</string>
diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml
index 9f48ef2..abdb30a 100644
--- a/res/values-fa/strings.xml
+++ b/res/values-fa/strings.xml
@@ -92,11 +92,11 @@
     <string name="workspace_scroll_format" msgid="1704767047951143301">"صفحهٔ اصلی %1$d از %2$d"</string>
     <string name="apps_customize_apps_scroll_format" msgid="5494241912377704885">"صفحه برنامه‌ها %1$d از %2$d"</string>
     <string name="apps_customize_widgets_scroll_format" msgid="5383009742241717437">"صفحه ابزارک‌ها %1$d از %2$d"</string>
-    <string name="workspace_cling_title" msgid="738396473989890567">"احساس کنید در خانه هستید"</string>
-    <string name="workspace_cling_move_item" msgid="791013895761065070">"برنامه‌های مورد دلخواه خود را می‌توانید در اینجا قرار دهید."</string>
+    <string name="workspace_cling_title" msgid="738396473989890567">"منزل خودتان است"</string>
+    <string name="workspace_cling_move_item" msgid="791013895761065070">"می‌توانید برنامه‌های دلخواه خود را اینجا بگذارید."</string>
     <string name="workspace_cling_open_all_apps" msgid="2459977609848572588">"برای مشاهدهٔ تمام برنامه‌های خود، حلقه را لمس کنید."</string>
-    <string name="all_apps_cling_title" msgid="2559734712581447107">"انتخاب چند برنامه‌"</string>
-    <string name="all_apps_cling_add_item" msgid="5665035103260318891">"برای افزودن یک برنامه به صفحهٔ اصلی خود، آن را لمس کرده و نگه دارید."</string>
+    <string name="all_apps_cling_title" msgid="2559734712581447107">"چندتا برنامه انتخاب کنید"</string>
+    <string name="all_apps_cling_add_item" msgid="5665035103260318891">"اگر می‌خواهید برنامه‌ای را به صفحهٔ اصلی خود اضافه کنید، آن را لمس کرده و نگه دارید."</string>
     <string name="folder_cling_title" msgid="4308949882377840953">"برنامه‌های خود را با پوشه‌ها سازماندهی کنید"</string>
     <string name="folder_cling_move_item" msgid="270598675060435169">"برای جابجا کردن یک برنامه، آن را لمس کرده و نگهدارید."</string>
     <string name="folder_cling_create_folder" msgid="8352867485656129478">"برای ایجاد یک پوشه جدید در صفحهٔ اصلی خود، یک برنامه را در بالای دیگری قرار دهید."</string>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 7e29730..a049d2e 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -61,7 +61,7 @@
     <string name="accessibility_voice_search_button" msgid="3938249215065842475">"音声検索"</string>
     <string name="accessibility_all_apps_button" msgid="8803738611398979849">"アプリ"</string>
     <string name="accessibility_delete_button" msgid="3628162007991023603">"削除"</string>
-    <string name="delete_zone_label_all_apps_system_app" msgid="3683920959591819044">"アップデートをアンインストール"</string>
+    <string name="delete_zone_label_all_apps_system_app" msgid="3683920959591819044">"アップデートを削除"</string>
     <string name="menu_add" msgid="3065046628354640854">"追加"</string>
     <string name="menu_manage_apps" msgid="2308685199463588895">"アプリの管理"</string>
     <string name="menu_wallpaper" msgid="5837429080911269832">"壁紙"</string>
diff --git a/res/values-sw/strings.xml b/res/values-sw/strings.xml
index 676edcb..c09d328 100644
--- a/res/values-sw/strings.xml
+++ b/res/values-sw/strings.xml
@@ -68,7 +68,7 @@
     <string name="menu_search" msgid="4826514464423239041">"Tafuta"</string>
     <string name="menu_notifications" msgid="6424587053194766192">"Arifa"</string>
     <string name="menu_settings" msgid="3946232973327980394">"Mipangilio ya mfumo"</string>
-    <string name="menu_help" msgid="4901160661634590633">"Msaada"</string>
+    <string name="menu_help" msgid="4901160661634590633">"Usaidizi"</string>
     <string name="cab_menu_delete_app" msgid="4089398025537640349">"Sanidua programu"</string>
     <string name="cab_menu_app_info" msgid="914548323652698884">"Maelezo ya programu"</string>
     <string name="cab_app_selection_text" msgid="6378522164293415735">"Programu 1 imechaguliwa"</string>
@@ -95,7 +95,7 @@
     <string name="apps_customize_apps_scroll_format" msgid="5494241912377704885">"Ukurasa wa programu %1$d ya %2$d"</string>
     <string name="apps_customize_widgets_scroll_format" msgid="5383009742241717437">"Ukurasa wa wijeti %1$d ya %2$d"</string>
     <string name="workspace_cling_title" msgid="738396473989890567">"Jisikie huru"</string>
-    <string name="workspace_cling_move_item" msgid="791013895761065070">"Unaweza kuweka prog zako uzipendazo hapa."</string>
+    <string name="workspace_cling_move_item" msgid="791013895761065070">"Unaweza kuweka programu zako uzipendazo hapa."</string>
     <string name="workspace_cling_open_all_apps" msgid="2459977609848572588">"Kutazama programu zako zote, gusa duara."</string>
     <string name="all_apps_cling_title" msgid="2559734712581447107">"Chagua programu kadhaa"</string>
     <string name="all_apps_cling_add_item" msgid="5665035103260318891">"Ili kuongeza programu kwa skrini yako ya Nyumbani, iguse na uishikilie."</string>
diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml
index 4e8281e..439709a 100644
--- a/res/values-sw720dp/dimens.xml
+++ b/res/values-sw720dp/dimens.xml
@@ -72,7 +72,7 @@
     <!-- The size of the image which sits behind the preview of the folder contents -->
     <dimen name="folder_cell_width">96dp</dimen>
     <dimen name="folder_cell_height">96dp</dimen>
-    <dimen name="folder_preview_size">75dp</dimen>
+    <dimen name="folder_preview_size">70dp</dimen>
     <dimen name="folder_width_gap">2dp</dimen>
     <dimen name="folder_height_gap">2dp</dimen>
     <dimen name="folder_padding">4dp</dimen>
diff --git a/res/values-sw720dp/wallpapers.xml b/res/values-sw720dp/wallpapers.xml
index fb386f4..8b01477 100644
--- a/res/values-sw720dp/wallpapers.xml
+++ b/res/values-sw720dp/wallpapers.xml
@@ -17,16 +17,16 @@
 
 <resources>
     <string-array name="wallpapers" translatable="false">
-        <item>wallpaper_architecture</item>
-        <item>wallpaper_bubblegum</item>
-        <item>wallpaper_canyon</item>
-        <item>wallpaper_chroma</item>
-        <item>wallpaper_escape</item>
-        <item>wallpaper_fidelity</item>
-        <item>wallpaper_flora</item>
-        <item>wallpaper_kepler</item>
-        <item>wallpaper_leaf</item>
-        <item>wallpaper_noir</item>
-        <item>wallpaper_outofthebox</item>
+        <item>wallpaper_00</item>
+        <item>wallpaper_01</item>
+        <item>wallpaper_02</item>
+        <item>wallpaper_03</item>
+        <item>wallpaper_04</item>
+        <item>wallpaper_05</item>
+        <item>wallpaper_06</item>
+        <item>wallpaper_07</item>
+        <item>wallpaper_08</item>
+        <item>wallpaper_09</item>
+        <item>wallpaper_10</item>
     </string-array>
 </resources>
diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml
index 5031ea9..5cb330c 100644
--- a/res/values-uk/strings.xml
+++ b/res/values-uk/strings.xml
@@ -95,7 +95,7 @@
     <string name="workspace_cling_title" msgid="738396473989890567">"Влаштовуйтеся зручніше"</string>
     <string name="workspace_cling_move_item" msgid="791013895761065070">"Тут можна розмістити вибрані програми."</string>
     <string name="workspace_cling_open_all_apps" msgid="2459977609848572588">"Щоб побачити всі свої програми, торкніться кола."</string>
-    <string name="all_apps_cling_title" msgid="2559734712581447107">"Виберіть декілька програм"</string>
+    <string name="all_apps_cling_title" msgid="2559734712581447107">"Виберіть програми"</string>
     <string name="all_apps_cling_add_item" msgid="5665035103260318891">"Щоб додати програму на головний екран, торкніться й утримуйте її."</string>
     <string name="folder_cling_title" msgid="4308949882377840953">"Організовуйте програми за допомогою папок"</string>
     <string name="folder_cling_move_item" msgid="270598675060435169">"Щоб перемістити програму, торкніться й утримуйте її."</string>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 628884f..d497c2d 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -22,9 +22,6 @@
     <dimen name="cling_text_block_offset_x">0dp</dimen>
     <dimen name="cling_text_block_offset_y">0dp</dimen>
     <dimen name="reveal_radius">48dp</dimen>
-    <!-- entries for custom clings, will be set in overlays -->
-    <add-resource type="dimen" name="custom_cling_margin_top" />
-    <add-resource type="dimen" name="custom_cling_margin_right" />
 
 <!-- Workspace -->
     <!-- qsb_bar_height_inset represents qsb_bar_height minus the padding
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 0ea12c4..4aee339 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -244,8 +244,6 @@
     <string name="folder_cling_create_folder">To make a new folder on your Home screen, stack one app on top of another.</string>
     <!-- The text on the button to dismiss a cling [CHAR_LIMIT=none] -->
     <string name="cling_dismiss">OK</string>
-    <!-- Error message on dummy custom cling layout [DO NOT TRANSLATE] -->
-    <string name="dummy_custom_cling_error_message">Error: custom workspace layout passed in but custom cling was not overwritten</string>
     <add-resource type="string" name="default_folder_name" />
 
     <!-- Folder accessibility -->
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 609bb6d..5580381 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -449,8 +449,10 @@
         if (mMaxAppCellCountX > -1) {
             maxCellCountX = Math.min(maxCellCountX, mMaxAppCellCountX);
         }
+        // Temp hack for now: only use the max cell count Y for widget layout
+        int maxWidgetCellCountY = maxCellCountY;
         if (mMaxAppCellCountY > -1) {
-            maxCellCountY = Math.min(maxCellCountY, mMaxAppCellCountY);
+            maxWidgetCellCountY = Math.min(maxWidgetCellCountY, mMaxAppCellCountY);
         }
 
         // Now that the data is ready, we can calculate the content width, the number of cells to
@@ -466,6 +468,7 @@
         // Force a measure to update recalculate the gaps
         int widthSpec = MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.AT_MOST);
         int heightSpec = MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.AT_MOST);
+        mWidgetSpacingLayout.calculateCellCount(width, height, maxCellCountX, maxWidgetCellCountY);
         mWidgetSpacingLayout.measure(widthSpec, heightSpec);
         mContentWidth = mWidgetSpacingLayout.getContentWidth();
 
@@ -617,11 +620,22 @@
         Bundle options = null;
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
             AppWidgetResizeFrame.getWidgetSizeRanges(mLauncher, info.spanX, info.spanY, mTmpRect);
+            Rect padding = AppWidgetHostView.getDefaultPaddingForWidget(mLauncher,
+                    info.componentName, null);
+
+            float density = getResources().getDisplayMetrics().density;
+            int xPaddingDips = (int) ((padding.left + padding.right) / density);
+            int yPaddingDips = (int) ((padding.top + padding.bottom) / density);
+
             options = new Bundle();
-            options.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH, mTmpRect.left);
-            options.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT, mTmpRect.top);
-            options.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH, mTmpRect.right);
-            options.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT, mTmpRect.bottom);
+            options.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH,
+                    mTmpRect.left - xPaddingDips);
+            options.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT,
+                    mTmpRect.top - yPaddingDips);
+            options.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH,
+                    mTmpRect.right - xPaddingDips);
+            options.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT,
+                    mTmpRect.bottom - yPaddingDips);
         }
         return options;
     }
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 64e382a..a48740d 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1194,9 +1194,8 @@
 
             launcherInfo.hostView.setTag(launcherInfo);
             launcherInfo.hostView.setVisibility(View.VISIBLE);
-            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
-                launcherInfo.notifyWidgetSizeChanged(this);
-            }
+            launcherInfo.notifyWidgetSizeChanged(this);
+
             mWorkspace.addInScreen(launcherInfo.hostView, container, screen, cellXY[0], cellXY[1],
                     launcherInfo.spanX, launcherInfo.spanY, isWorkspaceLocked());
 
@@ -3750,18 +3749,6 @@
         if (isClingsEnabled() &&
                 !mSharedPrefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, false) &&
                 !skipCustomClingIfNoAccounts() ) {
-            // If we're not using the default workspace layout, replace workspace cling
-            // with a custom workspace cling (usually specified in an overlay)
-            if (mSharedPrefs.getInt(LauncherProvider.DEFAULT_WORKSPACE_RESOURCE_ID, 0) != 0) {
-                // Use a custom cling
-                View cling = findViewById(R.id.workspace_cling);
-                ViewGroup clingParent = (ViewGroup) cling.getParent();
-                int clingIndex = clingParent.indexOfChild(cling);
-                clingParent.removeViewAt(clingIndex);
-                View customCling = mInflater.inflate(R.layout.custom_workspace_cling, clingParent, false);
-                clingParent.addView(customCling, clingIndex);
-                customCling.setId(R.id.workspace_cling);
-            }
             initCling(R.id.workspace_cling, null, false, 0);
         } else {
             removeCling(R.id.workspace_cling);
diff --git a/src/com/android/launcher2/LauncherAppWidgetInfo.java b/src/com/android/launcher2/LauncherAppWidgetInfo.java
index 5c8fb38..602695a 100644
--- a/src/com/android/launcher2/LauncherAppWidgetInfo.java
+++ b/src/com/android/launcher2/LauncherAppWidgetInfo.java
@@ -73,8 +73,7 @@
      * done so already (only really for default workspace widgets).
      */
     void onBindAppWidget(Launcher launcher) {
-        if (!mHasNotifiedInitialWidgetSizeChanged &&
-            Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
+        if (!mHasNotifiedInitialWidgetSizeChanged) {
             notifyWidgetSizeChanged(launcher);
         }
     }
diff --git a/src/com/android/launcher2/LauncherProvider.java b/src/com/android/launcher2/LauncherProvider.java
index 8097ac9..74cf7a4 100644
--- a/src/com/android/launcher2/LauncherProvider.java
+++ b/src/com/android/launcher2/LauncherProvider.java
@@ -74,8 +74,6 @@
     static final String PARAMETER_NOTIFY = "notify";
     static final String DB_CREATED_BUT_DEFAULT_WORKSPACE_NOT_LOADED =
             "DB_CREATED_BUT_DEFAULT_WORKSPACE_NOT_LOADED";
-    static final String DEFAULT_WORKSPACE_RESOURCE_ID =
-            "DEFAULT_WORKSPACE_RESOURCE_ID";
 
     private static final String ACTION_APPWIDGET_DEFAULT_WORKSPACE_CONFIGURE =
             "com.android.launcher.action.APPWIDGET_DEFAULT_WORKSPACE_CONFIGURE";
@@ -208,23 +206,18 @@
     /**
      * @param workspaceResId that can be 0 to use default or non-zero for specific resource
      */
-    synchronized public void loadDefaultFavoritesIfNecessary(int origWorkspaceResId) {
+    synchronized public void loadDefaultFavoritesIfNecessary(int workspaceResId) {
         String spKey = LauncherApplication.getSharedPreferencesKey();
         SharedPreferences sp = getContext().getSharedPreferences(spKey, Context.MODE_PRIVATE);
         if (sp.getBoolean(DB_CREATED_BUT_DEFAULT_WORKSPACE_NOT_LOADED, false)) {
-            int workspaceResId = origWorkspaceResId;
-
             // Use default workspace resource if none provided
             if (workspaceResId == 0) {
-                workspaceResId = sp.getInt(DEFAULT_WORKSPACE_RESOURCE_ID, R.xml.default_workspace);
+                workspaceResId = R.xml.default_workspace;
             }
 
             // Populate favorites table with initial favorites
             SharedPreferences.Editor editor = sp.edit();
             editor.remove(DB_CREATED_BUT_DEFAULT_WORKSPACE_NOT_LOADED);
-            if (origWorkspaceResId != 0) {
-                editor.putInt(DEFAULT_WORKSPACE_RESOURCE_ID, origWorkspaceResId);
-            }
             mOpenHelper.loadFavorites(mOpenHelper.getWritableDatabase(), workspaceResId);
             editor.commit();
         }
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 77cb467..6350c84 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -2232,11 +2232,9 @@
 
                 boolean foundCell = mTargetCell[0] >= 0 && mTargetCell[1] >= 0;
 
-                // if the widget resizes on drop, or the sdk level is less than JBMR1, then we
-                // need to update the size.
+                // if the widget resizes on drop
                 if (foundCell && (cell instanceof AppWidgetHostView) &&
-                        (resultSpan[0] != item.spanX || resultSpan[1] != item.spanY ||
-                        Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1)) {
+                        (resultSpan[0] != item.spanX || resultSpan[1] != item.spanY)) {
                     resizeOnDrop = true;
                     item.spanX = resultSpan[0];
                     item.spanY = resultSpan[1];
@@ -3045,7 +3043,7 @@
             }
 
             final ItemInfo item = (ItemInfo) d.dragInfo;
-            boolean updateWidgetSize = Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN;
+            boolean updateWidgetSize = false;
             if (findNearestVacantCell) {
                 int minSpanX = item.spanX;
                 int minSpanY = item.spanY;