Merge "Add a prefix to visited tab preferences keys" into ub-launcher3-qt-dev
diff --git a/res/drawable/ic_close_24px.xml b/res/drawable/ic_close_24px.xml
index d5cdfab..aacd703 100644
--- a/res/drawable/ic_close_24px.xml
+++ b/res/drawable/ic_close_24px.xml
@@ -2,9 +2,8 @@
     android:width="24dp"
     android:height="24dp"
     android:viewportWidth="24"
-    android:viewportHeight="24"
-    android:tint="@color/toolbar_icon_color">
+    android:viewportHeight="24">
   <path
-      android:fillColor="#FF000000"
+      android:fillColor="@android:color/white"
       android:pathData="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41z"/>
 </vector>
diff --git a/res/drawable/ic_colorize_24px.xml b/res/drawable/ic_colorize_24px.xml
index 6c9f320..fb70972 100644
--- a/res/drawable/ic_colorize_24px.xml
+++ b/res/drawable/ic_colorize_24px.xml
@@ -19,6 +19,6 @@
     android:viewportWidth="24"
     android:viewportHeight="24">
     <path
-        android:fillColor="#FF000000"
+        android:fillColor="@android:color/white"
         android:pathData="M17.67,3c-0.26,0 -0.51,0.1 -0.71,0.29l-3.12,3.12L11.91,4.5L10.5,5.91l1.42,1.42L3,16.25V21h4.75l8.92,-8.92l1.42,1.42l1.41,-1.41l-1.92,-1.92l3.12,-3.12c0.4,-0.4 0.4,-1.03 0.01,-1.42l-2.34,-2.34C18.17,3.1 17.92,3 17.67,3L17.67,3zM6.92,19H5v-1.92l8.06,-8.06l1.92,1.92L6.92,19L6.92,19z"/>
 </vector>
diff --git a/res/drawable/ic_delete_24px.xml b/res/drawable/ic_delete_24px.xml
index 5e4bdae..bc83f36 100644
--- a/res/drawable/ic_delete_24px.xml
+++ b/res/drawable/ic_delete_24px.xml
@@ -17,15 +17,14 @@
     android:width="24dp"
     android:height="24dp"
     android:viewportWidth="24"
-    android:viewportHeight="24"
-    android:tint="@color/toolbar_icon_color">
+    android:viewportHeight="24">
   <path
-      android:fillColor="#FF000000"
+      android:fillColor="@android:color/white"
       android:pathData="M15,4V3H9v1H4v2h1v13c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V6h1V4H15zM17,19H7V6h10V19z"/>
   <path
-      android:fillColor="#FF000000"
+      android:fillColor="@android:color/white"
       android:pathData="M9,8h2v9h-2z"/>
   <path
-      android:fillColor="#FF000000"
+      android:fillColor="@android:color/white"
       android:pathData="M13,8h2v9h-2z"/>
 </vector>
diff --git a/res/drawable/ic_font.xml b/res/drawable/ic_font.xml
index 7309815..f5df7ba 100644
--- a/res/drawable/ic_font.xml
+++ b/res/drawable/ic_font.xml
@@ -20,10 +20,10 @@
     android:viewportHeight="24">
     <!-- This path represents a square with rounded corners -->
     <path
-        android:fillColor="#FF000000"
+        android:fillColor="@android:color/white"
         android:pathData="M20,2H4C2.9,2 2,2.9 2,4v16c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V4C22,2.9 21.1,2 20,2zM20,20H4V4h16V20z"/>
     <!-- This path represents a letter "A" inside the square -->
     <path
-        android:fillColor="#FF000000"
+        android:fillColor="@android:color/white"
         android:pathData="M10.69,6h2.6l4.51,12h-2.5l-1.01,-2.87H9.7L8.7,18H6.2L10.69,6zM13.56,13.06l-1.06,-3.02L12.07,8.6h-0.13l-0.44,1.44l-1.07,3.02H13.56z"/>
 </vector>
diff --git a/res/drawable/ic_nav_clock.xml b/res/drawable/ic_nav_clock.xml
index 5544a0e..3584976 100644
--- a/res/drawable/ic_nav_clock.xml
+++ b/res/drawable/ic_nav_clock.xml
@@ -21,10 +21,10 @@
     android:viewportHeight="24">
     <!-- This path corresponds to the outside circle -->
     <path
-        android:fillColor="@color/bottom_nav_item_color"
+        android:fillColor="@android:color/white"
         android:pathData="M11.99,2C6.47,2 2,6.48 2,12c0,5.52 4.47,10 9.99,10C17.52,22 22,17.52 22,12C22,6.48 17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8c0,-4.42 3.58,-8 8,-8s8,3.58 8,8C20,16.42 16.42,20 12,20z"/>
     <!-- This draws two lines at an angle representing the clock hands -->
     <path
-        android:fillColor="@color/bottom_nav_item_color"
+        android:fillColor="@android:color/white"
         android:pathData="M16.49,16.36l-5.49,-3.29l0,-6.65l2,0l0,5.51l4.51,2.71z"/>
 </vector>
diff --git a/res/drawable/ic_nav_grid.xml b/res/drawable/ic_nav_grid.xml
index 61f0088..027662d 100644
--- a/res/drawable/ic_nav_grid.xml
+++ b/res/drawable/ic_nav_grid.xml
@@ -20,6 +20,6 @@
     android:viewportWidth="24"
     android:viewportHeight="24">
     <path
-        android:fillColor="@color/bottom_nav_item_color"
+        android:fillColor="@android:color/white"
         android:pathData="M22,7V5h-3V2h-2v3h-4V2h-2v3H7V2H5v3H2v2h3v4H2v2h3v4H2v2h3v3h2v-3h4v3h2v-3h4v3h2v-3h3v-2h-3v-4h3v-2h-3V7H22zM7,7h4v4H7V7zM7,17v-4h4v4H7zM17,17h-4v-4h4V17zM17,11h-4V7h4V11z"/>
 </vector>
diff --git a/res/drawable/ic_nav_theme.xml b/res/drawable/ic_nav_theme.xml
index 6d388c9..fcda980 100644
--- a/res/drawable/ic_nav_theme.xml
+++ b/res/drawable/ic_nav_theme.xml
@@ -20,6 +20,6 @@
         android:viewportWidth="24"
         android:viewportHeight="24">
     <path
-        android:fillColor="@color/bottom_nav_item_color"
+        android:fillColor="@android:color/white"
         android:pathData="M4,2v9c0,1.65 1.35,3 3,3h2v6c0,1.1 0.9,2 2,2h2c1.1,0 2,-0.9 2,-2v-6h2c1.65,0 3,-1.35 3,-3V2C20,2 4,2 4,2zM11,20v-6h2v6H11zM18,11c0,0.55 -0.45,1 -1,1h-2H9H7c-0.55,0 -1,-0.45 -1,-1v-0.93h12V11zM18,8.07H6V4h2.81v2.15h2V4h2.38v2.15h2V4H18V8.07z"/>
 </vector>
diff --git a/res/drawable/ic_nav_wallpaper.xml b/res/drawable/ic_nav_wallpaper.xml
index 96ebe10..c935666 100644
--- a/res/drawable/ic_nav_wallpaper.xml
+++ b/res/drawable/ic_nav_wallpaper.xml
@@ -20,6 +20,6 @@
     android:viewportWidth="24"
     android:viewportHeight="24">
     <path
-        android:fillColor="@color/bottom_nav_item_color"
+        android:fillColor="@android:color/white"
         android:pathData="M9,12.71l2.14,2.58l3,-3.87L18,16.57H6L9,12.71zM5,5h6V3H5C3.9,3 3,3.9 3,5v6h2V5zM19,19h-6v2h6c1.1,0 2,-0.9 2,-2v-6h-2V19zM5,19v-6H3v6c0,1.1 0.9,2 2,2h6v-2H5zM19,5v6h2V5c0,-1.1 -0.9,-2 -2,-2h-6v2H19zM16,9c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1c-0.55,0 -1,0.45 -1,1S15.45,9 16,9z"/>
 </vector>
diff --git a/res/drawable/ic_shapes_24px.xml b/res/drawable/ic_shapes_24px.xml
index d2838d2..525f757 100644
--- a/res/drawable/ic_shapes_24px.xml
+++ b/res/drawable/ic_shapes_24px.xml
@@ -19,6 +19,6 @@
     android:viewportWidth="24"
     android:viewportHeight="24">
     <path
-        android:fillColor="#FF000000"
+        android:fillColor="@android:color/white"
         android:pathData="M22,11v9c0,1.1 -0.9,2 -2,2H10c-1.1,0 -2,-0.9 -2,-2v-2.19h0.06c0.67,0 1.32,-0.08 1.94,-0.22V20h10v-9h-3.41c0.14,-0.63 0.22,-1.27 0.22,-1.94V9H20C21.1,9 22,9.9 22,11zM8.06,4C5.27,4 3,6.27 3,9.06s2.27,5.06 5.06,5.06s5.06,-2.27 5.06,-5.06C13.12,6.27 10.85,4 8.06,4M8.06,2c3.9,0 7.06,3.16 7.06,7.06s-3.16,7.06 -7.06,7.06S1,12.96 1,9.06S4.16,2 8.06,2z"/>
 </vector>
diff --git a/res/drawable/ic_tune.xml b/res/drawable/ic_tune.xml
index a6dd634..a310d56 100644
--- a/res/drawable/ic_tune.xml
+++ b/res/drawable/ic_tune.xml
@@ -19,6 +19,6 @@
     android:viewportWidth="24"
     android:viewportHeight="24">
   <path
-      android:fillColor="#FF000000"
+      android:fillColor="@android:color/white"
       android:pathData="M3,17v2h6v-2H3zM3,5v2h10V5H3zM13,21v-2h8v-2h-8v-2h-2v6H13zM7,9v2H3v2h4v2h2V9H7zM21,13v-2H11v2H21zM15,9h2V7h4V5h-4V3h-2V9z"/>
 </vector>
diff --git a/res/drawable/ic_wallpaper_24px.xml b/res/drawable/ic_wallpaper_24px.xml
deleted file mode 100644
index 737b309..0000000
--- a/res/drawable/ic_wallpaper_24px.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
-     Copyright (C) 2019 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:width="24dp"
-    android:height="24dp"
-    android:viewportWidth="24"
-    android:viewportHeight="24">
-    <path
-        android:fillColor="#FF000000"
-        android:pathData="M9,12.71l2.14,2.58l3,-3.87L18,16.57H6L9,12.71zM5,5h6V3H5C3.9,3 3,3.9 3,5v6h2V5zM19,19h-6v2h6c1.1,0 2,-0.9 2,-2v-6h-2V19zM5,19v-6H3v6c0,1.1 0.9,2 2,2h6v-2H5zM19,5v6h2V5c0,-1.1 -0.9,-2 -2,-2h-6v2H19zM16,9c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1c-0.55,0 -1,0.45 -1,1S15.45,9 16,9z"/>
-</vector>
diff --git a/res/drawable/ic_wifi_24px.xml b/res/drawable/ic_wifi_24px.xml
index cf44585..0e27c57 100644
--- a/res/drawable/ic_wifi_24px.xml
+++ b/res/drawable/ic_wifi_24px.xml
@@ -19,6 +19,6 @@
     android:viewportWidth="24"
     android:viewportHeight="24">
     <path
-        android:fillColor="#FF000000"
+        android:fillColor="@android:color/white"
         android:pathData="M1,9l2,2c4.97,-4.97 13.03,-4.97 18,0l2,-2C16.93,2.93 7.08,2.93 1,9zM9,17l3,3l3,-3C13.35,15.34 10.66,15.34 9,17zM5,13l2,2c2.76,-2.76 7.24,-2.76 10,0l2,-2C15.14,9.14 8.87,9.14 5,13z"/>
 </vector>
diff --git a/robolectric_tests/res/values/overlayable_icons_test.xml b/robolectric_tests/res/values/overlayable_icons_test.xml
new file mode 100644
index 0000000..73cffe1
--- /dev/null
+++ b/robolectric_tests/res/values/overlayable_icons_test.xml
@@ -0,0 +1,34 @@
+<!--
+   Copyright (C) 2019 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.
+-->
+<resources>
+  <!-- overlayable_icons references all of the drawables in this package
+       that are being overlayed by resource overlays. If you remove/rename
+       any of these resources, you must also change the resource overlay icons.-->
+  <array name="overlayable_icons">
+    <item>@drawable/ic_add_24px</item>
+    <item>@drawable/ic_close_24px</item>
+    <item>@drawable/ic_colorize_24px</item>
+    <item>@drawable/ic_delete_24px</item>
+    <item>@drawable/ic_font</item>
+    <item>@drawable/ic_nav_clock</item>
+    <item>@drawable/ic_nav_grid</item>
+    <item>@drawable/ic_nav_theme</item>
+    <item>@drawable/ic_nav_wallpaper</item>
+    <item>@drawable/ic_shapes_24px</item>
+    <item>@drawable/ic_tune</item>
+    <item>@drawable/ic_wifi_24px</item>
+  </array>
+</resources>
diff --git a/robolectric_tests/src/com/android/customization/model/theme/ThemeManagerTest.java b/robolectric_tests/src/com/android/customization/model/theme/ThemeManagerTest.java
index 185f632..24bf4ab 100644
--- a/robolectric_tests/src/com/android/customization/model/theme/ThemeManagerTest.java
+++ b/robolectric_tests/src/com/android/customization/model/theme/ThemeManagerTest.java
@@ -30,14 +30,10 @@
 import static junit.framework.TestCase.assertTrue;
 
 import static org.junit.Assert.assertFalse;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
-import android.app.Activity;
 import android.provider.Settings;
 
 import androidx.annotation.Nullable;
@@ -45,7 +41,6 @@
 
 import com.android.customization.model.CustomizationManager.Callback;
 import com.android.customization.module.ThemesUserEventLogger;
-import com.android.customization.testutils.Condition;
 import com.android.customization.testutils.OverlayManagerMocks;
 import com.android.customization.testutils.Wait;
 import com.android.wallpaper.module.WallpaperSetter;
@@ -59,8 +54,6 @@
 import org.robolectric.Robolectric;
 import org.robolectric.RobolectricTestRunner;
 
-import java.util.Map;
-
 @RunWith(RobolectricTestRunner.class)
 public class ThemeManagerTest {
 
@@ -102,13 +95,12 @@
                 OVERLAY_CATEGORY_ICON_SETTINGS, true, 0);
         mMockOmHelper.addOverlay("test.package.name_sysui", SYSUI_PACKAGE,
                 OVERLAY_CATEGORY_ICON_SYSUI, true, 0);
+        mMockOmHelper.addOverlay("test.package.name_themepicker", ,
+                OVERLAY_CATEGORY_ICON_SYSUI, true, 0);
 
         ThemeBundle defaultTheme = new ThemeBundle.Builder().asDefault().build(mActivity);
 
-        applyThemeAndWaitForCondition(defaultTheme, "Overlays didn't get disabled", () -> {
-            verify(mMockOm, times(6)).disableOverlay(anyString(), anyInt());
-            return true;
-        });
+        applyTheme(defaultTheme);
 
         assertEquals("Secure Setting should be emtpy after applying default theme",
                 "",
@@ -133,42 +125,22 @@
                 .addOverlayPackage(OVERLAY_CATEGORY_FONT, bundleFontPackage)
                 .build(mActivity);
 
-        applyThemeAndWaitForCondition(theme, "Overlays didn't get enabled", () -> {
-            verify(mMockOm, times(2)).setEnabledExclusiveInCategory(anyString(), anyInt());
-            Map<String, String> overlays = mMockOm.getEnabledOverlaysForTargets(ANDROID_PACKAGE);
-            assertEquals(2, overlays.size());
-            assertTrue(bundleColorPackage  + " should be enabled",
-                    overlays.values().contains(bundleColorPackage));
-            assertTrue(bundleFontPackage  + " should be enabled",
-                    overlays.values().contains(bundleFontPackage));
-            assertFalse(otherPackage  + " should not be enabled",
-                    overlays.values().contains(otherPackage));
-            return true;
-        });
+        applyTheme(theme);
 
         assertEquals("Secure Setting was not properly set after applying theme",
                 theme.getSerializedPackages(),
                 Settings.Secure.getString(mActivity.getContentResolver(), THEME_SETTING));
     }
 
-    private void applyThemeAndWaitForCondition(ThemeBundle theme, String message,
-            Condition condition) {
-        boolean[] done = {false, false};
+    private void applyTheme(ThemeBundle theme) {
         mThemeManager.apply(theme, new Callback() {
             @Override
             public void onSuccess() {
-                done[0] = true;
             }
 
             @Override
             public void onError(@Nullable Throwable throwable) {
-                done[0] = true;
-                done[1] = true;
             }
         });
-        // TODO: refactor these tests so we can get rid of the long wait.
-        Wait.atMost(message, () -> done[0] && condition.isTrue(), 1000);
-        // done[1] is only set to true in the onError callback.
-        assertFalse(done[1]);
     }
 }
diff --git a/src/com/android/customization/model/ResourceConstants.java b/src/com/android/customization/model/ResourceConstants.java
index f2bccfc..be3b548 100644
--- a/src/com/android/customization/model/ResourceConstants.java
+++ b/src/com/android/customization/model/ResourceConstants.java
@@ -64,6 +64,7 @@
     String OVERLAY_CATEGORY_ICON_SETTINGS = "android.theme.customization.icon_pack.settings";
     String OVERLAY_CATEGORY_ICON_SYSUI = "android.theme.customization.icon_pack.systemui";
     String OVERLAY_CATEGORY_ICON_LAUNCHER = "android.theme.customization.icon_pack.launcher";
+    String OVERLAY_CATEGORY_ICON_THEMEPICKER = "android.theme.customization.icon_pack.themepicker";
 
     /**
      * Global Android theme category (default theme prebundled with the OS)
@@ -96,6 +97,7 @@
             sTargetPackages.addAll(Arrays.asList(ANDROID_PACKAGE, SETTINGS_PACKAGE,
                     SYSUI_PACKAGE));
             sTargetPackages.add(getLauncherPackage(context));
+            sTargetPackages.add(context.getPackageName());
         }
         return sTargetPackages.toArray(new String[0]);
     }
diff --git a/src/com/android/customization/model/theme/DefaultThemeProvider.java b/src/com/android/customization/model/theme/DefaultThemeProvider.java
index e282cbd..ac32312 100644
--- a/src/com/android/customization/model/theme/DefaultThemeProvider.java
+++ b/src/com/android/customization/model/theme/DefaultThemeProvider.java
@@ -27,6 +27,7 @@
 import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_LAUNCHER;
 import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_SETTINGS;
 import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_SYSUI;
+import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_THEMEPICKER;
 import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_SHAPE;
 import static com.android.customization.model.ResourceConstants.SETTINGS_PACKAGE;
 import static com.android.customization.model.ResourceConstants.SYSUI_PACKAGE;
@@ -89,6 +90,7 @@
     private static final String SHAPE_PREFIX = "theme_overlay_shape_";
     private static final String ICON_ANDROID_PREFIX = "theme_overlay_icon_android_";
     private static final String ICON_LAUNCHER_PREFIX = "theme_overlay_icon_launcher_";
+    private static final String ICON_THEMEPICKER_PREFIX = "theme_overlay_icon_themepicker_";
     private static final String ICON_SETTINGS_PREFIX = "theme_overlay_icon_settings_";
     private static final String ICON_SYSUI_PREFIX = "theme_overlay_icon_sysui_";
     private static final String WALLPAPER_PREFIX = "theme_wallpaper_";
@@ -117,7 +119,8 @@
         om.getOverlayInfosForTarget(ANDROID_PACKAGE, user).forEach(addToMap);
         om.getOverlayInfosForTarget(SYSUI_PACKAGE, user).forEach(addToMap);
         om.getOverlayInfosForTarget(SETTINGS_PACKAGE, user).forEach(addToMap);
-        om.getOverlayInfosForTarget(ResourceConstants.getLauncherPackage(context),user).forEach(addToMap);
+        om.getOverlayInfosForTarget(ResourceConstants.getLauncherPackage(context), user).forEach(addToMap);
+        om.getOverlayInfosForTarget(context.getPackageName(), user).forEach(addToMap);
         mShapePreviewIconPackages = context.getResources().getStringArray(
                 R.array.icon_shape_preview_packages);
     }
@@ -170,7 +173,11 @@
 
                 String iconLauncherOverlayPackage = getOverlayPackage(ICON_LAUNCHER_PREFIX,
                         themeName);
-                addNoPreviewIconOverlay(builder,iconLauncherOverlayPackage);
+                addNoPreviewIconOverlay(builder, iconLauncherOverlayPackage);
+
+                String iconThemePickerOverlayPackage = getOverlayPackage(ICON_THEMEPICKER_PREFIX,
+                        themeName);
+                addNoPreviewIconOverlay(builder, iconThemePickerOverlayPackage);
 
                 String iconSettingsOverlayPackage = getOverlayPackage(ICON_SETTINGS_PREFIX,
                         themeName);
@@ -512,6 +519,7 @@
             addSysUiIconOverlay(builder, customPackages.get(OVERLAY_CATEGORY_ICON_SYSUI));
             addNoPreviewIconOverlay(builder, customPackages.get(OVERLAY_CATEGORY_ICON_SETTINGS));
             addNoPreviewIconOverlay(builder, customPackages.get(OVERLAY_CATEGORY_ICON_LAUNCHER));
+            addNoPreviewIconOverlay(builder, customPackages.get(OVERLAY_CATEGORY_ICON_THEMEPICKER));
 
             return builder;
         } catch (JSONException | NameNotFoundException | NotFoundException e) {
diff --git a/src/com/android/customization/model/theme/ThemeManager.java b/src/com/android/customization/model/theme/ThemeManager.java
index cd33f6b..fab10d8 100644
--- a/src/com/android/customization/model/theme/ThemeManager.java
+++ b/src/com/android/customization/model/theme/ThemeManager.java
@@ -15,16 +15,14 @@
  */
 package com.android.customization.model.theme;
 
-import static com.android.customization.model.ResourceConstants.ANDROID_PACKAGE;
 import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_COLOR;
 import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_FONT;
 import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_ANDROID;
 import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_LAUNCHER;
 import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_SETTINGS;
 import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_SYSUI;
+import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_THEMEPICKER;
 import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_SHAPE;
-import static com.android.customization.model.ResourceConstants.SETTINGS_PACKAGE;
-import static com.android.customization.model.ResourceConstants.SYSUI_PACKAGE;
 
 import android.graphics.Point;
 import android.provider.Settings;
@@ -59,6 +57,7 @@
         THEME_CATEGORIES.add(OVERLAY_CATEGORY_ICON_SETTINGS);
         THEME_CATEGORIES.add(OVERLAY_CATEGORY_ICON_SYSUI);
         THEME_CATEGORIES.add(OVERLAY_CATEGORY_ICON_LAUNCHER);
+        THEME_CATEGORIES.add(OVERLAY_CATEGORY_ICON_THEMEPICKER);
     };
 
 
@@ -161,30 +160,7 @@
     }
 
     private void applyOverlays(ThemeBundle theme, Callback callback) {
-        boolean allApplied = true;
-        if (theme.isDefault()) {
-            allApplied &= disableCurrentOverlay(ANDROID_PACKAGE, OVERLAY_CATEGORY_SHAPE);
-            allApplied &= disableCurrentOverlay(ANDROID_PACKAGE, OVERLAY_CATEGORY_COLOR);
-            allApplied &= disableCurrentOverlay(ANDROID_PACKAGE, OVERLAY_CATEGORY_FONT);
-            allApplied &= disableCurrentOverlay(ANDROID_PACKAGE, OVERLAY_CATEGORY_ICON_ANDROID);
-            allApplied &= disableCurrentOverlay(SYSUI_PACKAGE, OVERLAY_CATEGORY_ICON_SYSUI);
-            allApplied &= disableCurrentOverlay(SETTINGS_PACKAGE, OVERLAY_CATEGORY_ICON_SETTINGS);
-            allApplied &= disableCurrentOverlay(ResourceConstants.getLauncherPackage(mActivity),
-                    OVERLAY_CATEGORY_ICON_LAUNCHER);
-        } else {
-            allApplied &= applyOverlayOrDefault(theme, ANDROID_PACKAGE, OVERLAY_CATEGORY_SHAPE);
-            allApplied &= applyOverlayOrDefault(theme, ANDROID_PACKAGE, OVERLAY_CATEGORY_COLOR);
-            allApplied &= applyOverlayOrDefault(theme, ANDROID_PACKAGE, OVERLAY_CATEGORY_FONT);
-            allApplied &= applyOverlayOrDefault(theme, ANDROID_PACKAGE,
-                    OVERLAY_CATEGORY_ICON_ANDROID);
-            allApplied &= applyOverlayOrDefault(theme, SYSUI_PACKAGE, OVERLAY_CATEGORY_ICON_SYSUI);
-            allApplied &= applyOverlayOrDefault(theme, SETTINGS_PACKAGE,
-                    OVERLAY_CATEGORY_ICON_SETTINGS);
-            allApplied &= applyOverlayOrDefault(theme,
-                    ResourceConstants.getLauncherPackage(mActivity),
-                    OVERLAY_CATEGORY_ICON_LAUNCHER);
-        }
-        allApplied &= Settings.Secure.putString(mActivity.getContentResolver(),
+        boolean allApplied = Settings.Secure.putString(mActivity.getContentResolver(),
                 ResourceConstants.THEME_SETTING, theme.getSerializedPackages());
         if (theme instanceof CustomTheme) {
             storeCustomTheme((CustomTheme) theme);
@@ -207,14 +183,6 @@
         mProvider.fetch(callback, reload);
     }
 
-    private boolean disableCurrentOverlay(String targetPackage, String category) {
-        return true;
-    }
-
-    private boolean applyOverlayOrDefault(ThemeBundle theme, String targetPkg, String category) {
-        return true;
-    }
-
     public Map<String, String> getCurrentOverlays() {
         if (mCurrentOverlays == null) {
             mCurrentOverlays = mOverlayManagerCompat.getEnabledOverlaysForTargets(
diff --git a/src/com/android/customization/model/theme/custom/IconOptionsProvider.java b/src/com/android/customization/model/theme/custom/IconOptionsProvider.java
index 2319387..b977764 100644
--- a/src/com/android/customization/model/theme/custom/IconOptionsProvider.java
+++ b/src/com/android/customization/model/theme/custom/IconOptionsProvider.java
@@ -21,6 +21,7 @@
 import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_LAUNCHER;
 import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_SETTINGS;
 import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_SYSUI;
+import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_THEMEPICKER;
 
 import android.content.Context;
 import android.content.pm.PackageManager.NameNotFoundException;
@@ -51,6 +52,7 @@
     private final List<String> mSysUiIconsOverlayPackages = new ArrayList<>();
     private final List<String> mSettingsIconsOverlayPackages = new ArrayList<>();
     private final List<String> mLauncherIconsOverlayPackages = new ArrayList<>();
+    private final List<String> mThemePickerIconsOverlayPackages = new ArrayList<>();
 
     public IconOptionsProvider(Context context, OverlayManagerCompat manager) {
         super(context, manager, OVERLAY_CATEGORY_ICON_ANDROID);
@@ -61,6 +63,8 @@
                 OVERLAY_CATEGORY_ICON_SETTINGS, UserHandle.myUserId(), targetPackages));
         mLauncherIconsOverlayPackages.addAll(manager.getOverlayPackagesForCategory(
                 OVERLAY_CATEGORY_ICON_LAUNCHER, UserHandle.myUserId(), targetPackages));
+        mThemePickerIconsOverlayPackages.addAll(manager.getOverlayPackagesForCategory(
+                OVERLAY_CATEGORY_ICON_THEMEPICKER, UserHandle.myUserId(), targetPackages));
     }
 
     @Override
@@ -93,6 +97,10 @@
             addOrUpdateOption(optionsByPrefix, overlayPackage, OVERLAY_CATEGORY_ICON_LAUNCHER);
         }
 
+        for (String overlayPackage : mThemePickerIconsOverlayPackages) {
+            addOrUpdateOption(optionsByPrefix, overlayPackage, OVERLAY_CATEGORY_ICON_THEMEPICKER);
+        }
+
         for (IconOption option : optionsByPrefix.values()) {
             if (option.isValid(mContext)) {
                 mOptions.add(option);
diff --git a/src/com/android/customization/picker/CustomizationPickerActivity.java b/src/com/android/customization/picker/CustomizationPickerActivity.java
index 6156458..985a566 100644
--- a/src/com/android/customization/picker/CustomizationPickerActivity.java
+++ b/src/com/android/customization/picker/CustomizationPickerActivity.java
@@ -55,6 +55,7 @@
 import com.android.customization.picker.grid.GridFragment.GridFragmentHost;
 import com.android.customization.picker.theme.ThemeFragment;
 import com.android.customization.picker.theme.ThemeFragment.ThemeFragmentHost;
+import com.android.customization.widget.NoTintDrawableWrapper;
 import com.android.wallpaper.R;
 import com.android.wallpaper.model.WallpaperInfo;
 import com.android.wallpaper.module.DailyLoggingAlarmScheduler;
@@ -205,8 +206,6 @@
 
     private void setUpBottomNavView() {
         mBottomNav = findViewById(R.id.main_bottom_nav);
-        // Clear tint list so it doesn't recolor the indicator dots
-        mBottomNav.setItemIconTintList(null);
         Menu menu = mBottomNav.getMenu();
         DefaultCustomizationPreferences prefs =
             new DefaultCustomizationPreferences(getApplicationContext());
@@ -236,7 +235,7 @@
 
     private void showTipDot(MenuItem item) {
         Drawable icon = item.getIcon();
-        Drawable dot = getResources().getDrawable(R.drawable.tip_dot);
+        Drawable dot = new NoTintDrawableWrapper(getResources().getDrawable(R.drawable.tip_dot));
         Drawable[] layers = {icon, dot};
         LayerDrawable iconWithDot = new LayerDrawable(layers);
 
@@ -253,6 +252,7 @@
         item.setIcon(iconWithDot);
     }
 
+
     private void hideTipDot(MenuItem item) {
         Drawable iconWithDot = item.getIcon();
         if (iconWithDot instanceof LayerDrawable) {
diff --git a/src/com/android/customization/picker/theme/CustomThemeComponentFragment.java b/src/com/android/customization/picker/theme/CustomThemeComponentFragment.java
index cd2c067..0cc8e08 100644
--- a/src/com/android/customization/picker/theme/CustomThemeComponentFragment.java
+++ b/src/com/android/customization/picker/theme/CustomThemeComponentFragment.java
@@ -17,6 +17,8 @@
 
 import android.app.AlertDialog;
 import android.content.Context;
+import android.content.res.ColorStateList;
+import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.view.LayoutInflater;
 import android.view.MenuItem;
@@ -109,8 +111,13 @@
             setUpToolbar(view);
         } else {
             setUpToolbar(view, R.menu.custom_theme_editor_menu);
+            mToolbar.getMenu().getItem(0).setIconTintList(
+                    getContext().getColorStateList(R.color.toolbar_icon_color));
         }
-        mToolbar.setNavigationIcon(getResources().getDrawable(R.drawable.ic_close_24px, null));
+        Drawable closeIcon = getResources().getDrawable(R.drawable.ic_close_24px, null).mutate();
+        closeIcon.setTintList(getResources().getColorStateList(R.color.toolbar_icon_color, null));
+        mToolbar.setNavigationIcon(closeIcon);
+
         mToolbar.setNavigationContentDescription(R.string.cancel);
         mToolbar.setNavigationOnClickListener(v -> mHost.cancel());
         mOptionsContainer = view.findViewById(R.id.options_container);
diff --git a/src/com/android/customization/picker/theme/ThemeFragment.java b/src/com/android/customization/picker/theme/ThemeFragment.java
index 3c0c6d1..e3695e4 100644
--- a/src/com/android/customization/picker/theme/ThemeFragment.java
+++ b/src/com/android/customization/picker/theme/ThemeFragment.java
@@ -630,7 +630,7 @@
             }
             if (previewInfo.wallpaperAsset != null) {
                 addPage(new ThemePreviewPage(activity, R.string.preview_name_wallpaper,
-                        R.drawable.ic_wallpaper_24px, R.layout.preview_card_wallpaper_content,
+                        R.drawable.ic_nav_wallpaper, R.layout.preview_card_wallpaper_content,
                         previewInfo.resolveAccentColor(res)) {
 
                     private final WallpaperPreviewLayoutListener mListener =
diff --git a/src/com/android/customization/widget/NoTintDrawableWrapper.java b/src/com/android/customization/widget/NoTintDrawableWrapper.java
new file mode 100644
index 0000000..dd02f9a
--- /dev/null
+++ b/src/com/android/customization/widget/NoTintDrawableWrapper.java
@@ -0,0 +1,23 @@
+package com.android.customization.widget;
+
+import android.content.res.ColorStateList;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.DrawableWrapper;
+
+import androidx.annotation.Nullable;
+
+/**
+ * {@link DrawableWrapper} that no-ops {@link #setTint(int)} and
+ * {@link #setTintList(ColorStateList)}, leaving the original {@link Drawable} tint intact.
+ */
+public class NoTintDrawableWrapper extends DrawableWrapper {
+    public NoTintDrawableWrapper(Drawable drawable) {
+        super(drawable);
+    }
+
+    @Override
+    public void setTint(int tintColor) {}
+
+    @Override
+    public void setTintList(@Nullable ColorStateList tint) {}
+}