Merge "Use enabled flashlight icon for color QS preview" into ub-launcher3-qt-r1-dev
diff --git a/res/values/override.xml b/res/values/override.xml
index 818f357..a01507e 100644
--- a/res/values/override.xml
+++ b/res/values/override.xml
@@ -31,10 +31,10 @@
         typically GMS apps so they should be available in GMS devices. -->
     <array name="icon_shape_preview_packages">
         <item>com.google.android.gm</item>
-        <item>com.google.android.apps.maps</item>
+        <item>com.google.android.googlequicksearchbox</item>
         <item>com.google.android.apps.photos</item>
         <item>com.google.android.apps.docs</item>
         <item>com.google.android.youtube</item>
         <item>com.android.vending</item>
     </array>
-</resources>
\ No newline at end of file
+</resources>
diff --git a/src/com/android/customization/model/ResourceConstants.java b/src/com/android/customization/model/ResourceConstants.java
index be3b548..d8c32ff 100644
--- a/src/com/android/customization/model/ResourceConstants.java
+++ b/src/com/android/customization/model/ResourceConstants.java
@@ -83,7 +83,8 @@
             "ic_qs_dnd",
             "ic_qs_flashlight",
             "ic_qs_auto_rotate",
-            "ic_qs_airplane"
+            "ic_qs_airplane",
+            "ic_signal_cellular_3_4_bar"
     };
 
     ArrayList<String> sTargetPackages = new ArrayList<>();
diff --git a/src/com/android/customization/picker/theme/ThemePreviewPage.java b/src/com/android/customization/picker/theme/ThemePreviewPage.java
index 8da98bb..4d01f9d 100644
--- a/src/com/android/customization/picker/theme/ThemePreviewPage.java
+++ b/src/com/android/customization/picker/theme/ThemePreviewPage.java
@@ -73,6 +73,12 @@
 
     static class ThemeCoverPage extends ThemePreviewPage {
 
+        /**
+         * Maps which icon from ResourceConstants#ICONS_FOR_PREVIEW to use for each icon in the
+         * top bar (fake "status bar") of the cover page.
+         */
+        private static final int [] sTopBarIconToPreviewIcon = new int [] { 0, 6, 2 };
+
         private final Typeface mHeadlineFont;
         private final List<Drawable> mIcons;
         private final List<Drawable> mShapeAppIcons;
@@ -176,9 +182,10 @@
 
             ViewGroup iconsContainer = card.findViewById(R.id.theme_preview_top_bar_icons);
 
-            for (int i = 0; i < iconsContainer.getChildCount() && i < mIcons.size(); i++) {
+            for (int i = 0; i < iconsContainer.getChildCount(); i++) {
                 ((ImageView) iconsContainer.getChildAt(i))
-                        .setImageDrawable(mIcons.get(i).getConstantState().newDrawable().mutate());
+                        .setImageDrawable(mIcons.get(sTopBarIconToPreviewIcon[i]).getConstantState()
+                                .newDrawable().mutate());
             }
 
             ViewGroup body = card.findViewById(R.id.theme_preview_card_body_container);