Merge "Removing some unused logs" into sc-dev
diff --git a/go/quickstep/res/values-en-rAU/strings.xml b/go/quickstep/res/values-en-rAU/strings.xml
new file mode 100644
index 0000000..3a609b6
--- /dev/null
+++ b/go/quickstep/res/values-en-rAU/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_share_drop_target_label" msgid="5804774105974539508">"Share app"</string>
+    <string name="action_listen" msgid="2370304050784689486">"Listen"</string>
+    <string name="action_translate" msgid="8028378961867277746">"Translate"</string>
+    <string name="action_search" msgid="6269564710943755464">"Lens"</string>
+</resources>
diff --git a/go/quickstep/res/values-en-rCA/strings.xml b/go/quickstep/res/values-en-rCA/strings.xml
new file mode 100644
index 0000000..3a609b6
--- /dev/null
+++ b/go/quickstep/res/values-en-rCA/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_share_drop_target_label" msgid="5804774105974539508">"Share app"</string>
+    <string name="action_listen" msgid="2370304050784689486">"Listen"</string>
+    <string name="action_translate" msgid="8028378961867277746">"Translate"</string>
+    <string name="action_search" msgid="6269564710943755464">"Lens"</string>
+</resources>
diff --git a/go/quickstep/res/values-en-rGB/strings.xml b/go/quickstep/res/values-en-rGB/strings.xml
new file mode 100644
index 0000000..3a609b6
--- /dev/null
+++ b/go/quickstep/res/values-en-rGB/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_share_drop_target_label" msgid="5804774105974539508">"Share app"</string>
+    <string name="action_listen" msgid="2370304050784689486">"Listen"</string>
+    <string name="action_translate" msgid="8028378961867277746">"Translate"</string>
+    <string name="action_search" msgid="6269564710943755464">"Lens"</string>
+</resources>
diff --git a/go/quickstep/res/values-en-rIN/strings.xml b/go/quickstep/res/values-en-rIN/strings.xml
new file mode 100644
index 0000000..3a609b6
--- /dev/null
+++ b/go/quickstep/res/values-en-rIN/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_share_drop_target_label" msgid="5804774105974539508">"Share app"</string>
+    <string name="action_listen" msgid="2370304050784689486">"Listen"</string>
+    <string name="action_translate" msgid="8028378961867277746">"Translate"</string>
+    <string name="action_search" msgid="6269564710943755464">"Lens"</string>
+</resources>
diff --git a/go/quickstep/res/values-uz/strings.xml b/go/quickstep/res/values-uz/strings.xml
new file mode 100644
index 0000000..4e375c7
--- /dev/null
+++ b/go/quickstep/res/values-uz/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_share_drop_target_label" msgid="5804774105974539508">"Ilovani ulashish"</string>
+    <string name="action_listen" msgid="2370304050784689486">"Tinglash"</string>
+    <string name="action_translate" msgid="8028378961867277746">"Tarjimon"</string>
+    <string name="action_search" msgid="6269564710943755464">"Lens"</string>
+</resources>
diff --git a/quickstep/res/values-en-rAU/strings.xml b/quickstep/res/values-en-rAU/strings.xml
index 1040a03..5aae288 100644
--- a/quickstep/res/values-en-rAU/strings.xml
+++ b/quickstep/res/values-en-rAU/strings.xml
@@ -74,14 +74,10 @@
     <string name="gesture_tutorial_try_again" msgid="65962545858556697">"Try again"</string>
     <string name="gesture_tutorial_nice" msgid="2936275692616928280">"Nice!"</string>
     <string name="gesture_tutorial_step" msgid="1279786122817620968">"Tutorial <xliff:g id="CURRENT">%1$d</xliff:g>/<xliff:g id="TOTAL">%2$d</xliff:g>"</string>
-    <!-- no translation found for allset_title (5021126669778966707) -->
-    <skip />
-    <!-- no translation found for allset_hint (459504134589971527) -->
-    <skip />
-    <!-- no translation found for allset_description (6350320429953234580) -->
-    <skip />
-    <!-- no translation found for allset_navigation_settings (417773244979225071) -->
-    <skip />
+    <string name="allset_title" msgid="5021126669778966707">"Ready!"</string>
+    <string name="allset_hint" msgid="459504134589971527">"Swipe up to go home"</string>
+    <string name="allset_description" msgid="6350320429953234580">"You’re ready to start using your phone"</string>
+    <string name="allset_navigation_settings" msgid="417773244979225071"><annotation id="link">"Navigation settings for accessibility"</annotation></string>
     <string name="action_share" msgid="2648470652637092375">"Share"</string>
     <string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
     <string name="blocked_by_policy" msgid="2071401072261365546">"This action isn\'t allowed by the app or your organisation"</string>
diff --git a/quickstep/res/values-en-rCA/strings.xml b/quickstep/res/values-en-rCA/strings.xml
index 1040a03..5aae288 100644
--- a/quickstep/res/values-en-rCA/strings.xml
+++ b/quickstep/res/values-en-rCA/strings.xml
@@ -74,14 +74,10 @@
     <string name="gesture_tutorial_try_again" msgid="65962545858556697">"Try again"</string>
     <string name="gesture_tutorial_nice" msgid="2936275692616928280">"Nice!"</string>
     <string name="gesture_tutorial_step" msgid="1279786122817620968">"Tutorial <xliff:g id="CURRENT">%1$d</xliff:g>/<xliff:g id="TOTAL">%2$d</xliff:g>"</string>
-    <!-- no translation found for allset_title (5021126669778966707) -->
-    <skip />
-    <!-- no translation found for allset_hint (459504134589971527) -->
-    <skip />
-    <!-- no translation found for allset_description (6350320429953234580) -->
-    <skip />
-    <!-- no translation found for allset_navigation_settings (417773244979225071) -->
-    <skip />
+    <string name="allset_title" msgid="5021126669778966707">"Ready!"</string>
+    <string name="allset_hint" msgid="459504134589971527">"Swipe up to go home"</string>
+    <string name="allset_description" msgid="6350320429953234580">"You’re ready to start using your phone"</string>
+    <string name="allset_navigation_settings" msgid="417773244979225071"><annotation id="link">"Navigation settings for accessibility"</annotation></string>
     <string name="action_share" msgid="2648470652637092375">"Share"</string>
     <string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
     <string name="blocked_by_policy" msgid="2071401072261365546">"This action isn\'t allowed by the app or your organisation"</string>
diff --git a/quickstep/res/values-en-rGB/strings.xml b/quickstep/res/values-en-rGB/strings.xml
index 1040a03..5aae288 100644
--- a/quickstep/res/values-en-rGB/strings.xml
+++ b/quickstep/res/values-en-rGB/strings.xml
@@ -74,14 +74,10 @@
     <string name="gesture_tutorial_try_again" msgid="65962545858556697">"Try again"</string>
     <string name="gesture_tutorial_nice" msgid="2936275692616928280">"Nice!"</string>
     <string name="gesture_tutorial_step" msgid="1279786122817620968">"Tutorial <xliff:g id="CURRENT">%1$d</xliff:g>/<xliff:g id="TOTAL">%2$d</xliff:g>"</string>
-    <!-- no translation found for allset_title (5021126669778966707) -->
-    <skip />
-    <!-- no translation found for allset_hint (459504134589971527) -->
-    <skip />
-    <!-- no translation found for allset_description (6350320429953234580) -->
-    <skip />
-    <!-- no translation found for allset_navigation_settings (417773244979225071) -->
-    <skip />
+    <string name="allset_title" msgid="5021126669778966707">"Ready!"</string>
+    <string name="allset_hint" msgid="459504134589971527">"Swipe up to go home"</string>
+    <string name="allset_description" msgid="6350320429953234580">"You’re ready to start using your phone"</string>
+    <string name="allset_navigation_settings" msgid="417773244979225071"><annotation id="link">"Navigation settings for accessibility"</annotation></string>
     <string name="action_share" msgid="2648470652637092375">"Share"</string>
     <string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
     <string name="blocked_by_policy" msgid="2071401072261365546">"This action isn\'t allowed by the app or your organisation"</string>
diff --git a/quickstep/res/values-en-rIN/strings.xml b/quickstep/res/values-en-rIN/strings.xml
index 1040a03..5aae288 100644
--- a/quickstep/res/values-en-rIN/strings.xml
+++ b/quickstep/res/values-en-rIN/strings.xml
@@ -74,14 +74,10 @@
     <string name="gesture_tutorial_try_again" msgid="65962545858556697">"Try again"</string>
     <string name="gesture_tutorial_nice" msgid="2936275692616928280">"Nice!"</string>
     <string name="gesture_tutorial_step" msgid="1279786122817620968">"Tutorial <xliff:g id="CURRENT">%1$d</xliff:g>/<xliff:g id="TOTAL">%2$d</xliff:g>"</string>
-    <!-- no translation found for allset_title (5021126669778966707) -->
-    <skip />
-    <!-- no translation found for allset_hint (459504134589971527) -->
-    <skip />
-    <!-- no translation found for allset_description (6350320429953234580) -->
-    <skip />
-    <!-- no translation found for allset_navigation_settings (417773244979225071) -->
-    <skip />
+    <string name="allset_title" msgid="5021126669778966707">"Ready!"</string>
+    <string name="allset_hint" msgid="459504134589971527">"Swipe up to go home"</string>
+    <string name="allset_description" msgid="6350320429953234580">"You’re ready to start using your phone"</string>
+    <string name="allset_navigation_settings" msgid="417773244979225071"><annotation id="link">"Navigation settings for accessibility"</annotation></string>
     <string name="action_share" msgid="2648470652637092375">"Share"</string>
     <string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
     <string name="blocked_by_policy" msgid="2071401072261365546">"This action isn\'t allowed by the app or your organisation"</string>
diff --git a/quickstep/res/values-uz/strings.xml b/quickstep/res/values-uz/strings.xml
index 4ddcae8..8ca3898 100644
--- a/quickstep/res/values-uz/strings.xml
+++ b/quickstep/res/values-uz/strings.xml
@@ -74,14 +74,10 @@
     <string name="gesture_tutorial_try_again" msgid="65962545858556697">"Qayta urinish"</string>
     <string name="gesture_tutorial_nice" msgid="2936275692616928280">"Yaxshi!"</string>
     <string name="gesture_tutorial_step" msgid="1279786122817620968">"Darslik: <xliff:g id="CURRENT">%1$d</xliff:g>/<xliff:g id="TOTAL">%2$d</xliff:g>"</string>
-    <!-- no translation found for allset_title (5021126669778966707) -->
-    <skip />
-    <!-- no translation found for allset_hint (459504134589971527) -->
-    <skip />
-    <!-- no translation found for allset_description (6350320429953234580) -->
-    <skip />
-    <!-- no translation found for allset_navigation_settings (417773244979225071) -->
-    <skip />
+    <string name="allset_title" msgid="5021126669778966707">"Hammasi tayyor!"</string>
+    <string name="allset_hint" msgid="459504134589971527">"Boshiga qaytish uchun tepaga suring"</string>
+    <string name="allset_description" msgid="6350320429953234580">"Telefoningiz xizmatga tayyor"</string>
+    <string name="allset_navigation_settings" msgid="417773244979225071"><annotation id="link">"Maxsus imkoniyatlar uchun navigatsiya sozlamalari"</annotation></string>
     <string name="action_share" msgid="2648470652637092375">"Ulashish"</string>
     <string name="action_screenshot" msgid="8171125848358142917">"Skrinshot"</string>
     <string name="blocked_by_policy" msgid="2071401072261365546">"Bu amal ilova yoki tashkilotingiz tomonidan taqiqlangan"</string>
diff --git a/res/values-en-rAU/strings.xml b/res/values-en-rAU/strings.xml
index 8dd37bc..5af3e7d 100644
--- a/res/values-en-rAU/strings.xml
+++ b/res/values-en-rAU/strings.xml
@@ -97,8 +97,7 @@
     <string name="folder_name_format_exact" msgid="8626242716117004803">"Folder: <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> items"</string>
     <string name="folder_name_format_overflow" msgid="4270108890534995199">"Folder: <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> or more items"</string>
     <string name="wallpaper_button_text" msgid="8404103075899945851">"Wallpapers"</string>
-    <!-- no translation found for styles_wallpaper_button_text (8216961355289236794) -->
-    <skip />
+    <string name="styles_wallpaper_button_text" msgid="8216961355289236794">"Wallpaper &amp; style"</string>
     <string name="settings_button_text" msgid="8873672322605444408">"Home settings"</string>
     <string name="msg_disabled_by_admin" msgid="6898038085516271325">"Disabled by your admin"</string>
     <string name="allow_rotation_title" msgid="7728578836261442095">"Allow Home screen rotation"</string>
diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml
index 8dd37bc..5af3e7d 100644
--- a/res/values-en-rCA/strings.xml
+++ b/res/values-en-rCA/strings.xml
@@ -97,8 +97,7 @@
     <string name="folder_name_format_exact" msgid="8626242716117004803">"Folder: <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> items"</string>
     <string name="folder_name_format_overflow" msgid="4270108890534995199">"Folder: <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> or more items"</string>
     <string name="wallpaper_button_text" msgid="8404103075899945851">"Wallpapers"</string>
-    <!-- no translation found for styles_wallpaper_button_text (8216961355289236794) -->
-    <skip />
+    <string name="styles_wallpaper_button_text" msgid="8216961355289236794">"Wallpaper &amp; style"</string>
     <string name="settings_button_text" msgid="8873672322605444408">"Home settings"</string>
     <string name="msg_disabled_by_admin" msgid="6898038085516271325">"Disabled by your admin"</string>
     <string name="allow_rotation_title" msgid="7728578836261442095">"Allow Home screen rotation"</string>
diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml
index 8dd37bc..5af3e7d 100644
--- a/res/values-en-rGB/strings.xml
+++ b/res/values-en-rGB/strings.xml
@@ -97,8 +97,7 @@
     <string name="folder_name_format_exact" msgid="8626242716117004803">"Folder: <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> items"</string>
     <string name="folder_name_format_overflow" msgid="4270108890534995199">"Folder: <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> or more items"</string>
     <string name="wallpaper_button_text" msgid="8404103075899945851">"Wallpapers"</string>
-    <!-- no translation found for styles_wallpaper_button_text (8216961355289236794) -->
-    <skip />
+    <string name="styles_wallpaper_button_text" msgid="8216961355289236794">"Wallpaper &amp; style"</string>
     <string name="settings_button_text" msgid="8873672322605444408">"Home settings"</string>
     <string name="msg_disabled_by_admin" msgid="6898038085516271325">"Disabled by your admin"</string>
     <string name="allow_rotation_title" msgid="7728578836261442095">"Allow Home screen rotation"</string>
diff --git a/res/values-en-rIN/strings.xml b/res/values-en-rIN/strings.xml
index 8dd37bc..5af3e7d 100644
--- a/res/values-en-rIN/strings.xml
+++ b/res/values-en-rIN/strings.xml
@@ -97,8 +97,7 @@
     <string name="folder_name_format_exact" msgid="8626242716117004803">"Folder: <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> items"</string>
     <string name="folder_name_format_overflow" msgid="4270108890534995199">"Folder: <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> or more items"</string>
     <string name="wallpaper_button_text" msgid="8404103075899945851">"Wallpapers"</string>
-    <!-- no translation found for styles_wallpaper_button_text (8216961355289236794) -->
-    <skip />
+    <string name="styles_wallpaper_button_text" msgid="8216961355289236794">"Wallpaper &amp; style"</string>
     <string name="settings_button_text" msgid="8873672322605444408">"Home settings"</string>
     <string name="msg_disabled_by_admin" msgid="6898038085516271325">"Disabled by your admin"</string>
     <string name="allow_rotation_title" msgid="7728578836261442095">"Allow Home screen rotation"</string>
diff --git a/res/values-uz/strings.xml b/res/values-uz/strings.xml
index 52b06ac..7f0ced4 100644
--- a/res/values-uz/strings.xml
+++ b/res/values-uz/strings.xml
@@ -97,8 +97,7 @@
     <string name="folder_name_format_exact" msgid="8626242716117004803">"Jild: <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> fayllar"</string>
     <string name="folder_name_format_overflow" msgid="4270108890534995199">"Jild: <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> va undan ortiq fayllar"</string>
     <string name="wallpaper_button_text" msgid="8404103075899945851">"Fon rasmlari"</string>
-    <!-- no translation found for styles_wallpaper_button_text (8216961355289236794) -->
-    <skip />
+    <string name="styles_wallpaper_button_text" msgid="8216961355289236794">"Fon rasmi va stili"</string>
     <string name="settings_button_text" msgid="8873672322605444408">"Bosh ekran sozlamalari"</string>
     <string name="msg_disabled_by_admin" msgid="6898038085516271325">"Administrator tomonidan o‘chirilgan"</string>
     <string name="allow_rotation_title" msgid="7728578836261442095">"Bosh ekranni burishga ruxsat"</string>
diff --git a/res/values/config.xml b/res/values/config.xml
index 9ad1224..2e5ecba 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -77,11 +77,6 @@
     <!-- Menu id for feature flags -->
     <item type="id" name="menu_apply_flags" />
 
-    <!-- Popup items -->
-    <integer name="config_popupOpenCloseDuration">150</integer>
-    <integer name="config_popupArrowOpenCloseDuration">40</integer>
-    <integer name="config_removeNotificationViewDuration">300</integer>
-
     <!-- Default packages -->
     <string name="wallpaper_picker_package" translatable="false"></string>
     <string name="local_colors_extraction_class" translatable="false"></string>
diff --git a/src/com/android/launcher3/AbstractFloatingView.java b/src/com/android/launcher3/AbstractFloatingView.java
index 95cdbdd..32b2c9a 100644
--- a/src/com/android/launcher3/AbstractFloatingView.java
+++ b/src/com/android/launcher3/AbstractFloatingView.java
@@ -39,6 +39,7 @@
 import com.android.launcher3.util.TouchController;
 import com.android.launcher3.views.ActivityContext;
 import com.android.launcher3.views.BaseDragLayer;
+import com.android.launcher3.widget.LocalColorExtractor;
 
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -108,12 +109,21 @@
 
     protected boolean mIsOpen;
 
+    // Index used to get background color when using local wallpaper color extraction.
+    protected int mColorExtractionIndex;
+
     public AbstractFloatingView(Context context, AttributeSet attrs) {
         super(context, attrs);
+        init(context);
     }
 
     public AbstractFloatingView(Context context, AttributeSet attrs, int defStyleAttr) {
         super(context, attrs, defStyleAttr);
+        init(context);
+    }
+
+    private void init(Context context) {
+        mColorExtractionIndex = LocalColorExtractor.getColorIndex(context);
     }
 
     /**
diff --git a/src/com/android/launcher3/anim/Interpolators.java b/src/com/android/launcher3/anim/Interpolators.java
index 11e831e..9d73bba 100644
--- a/src/com/android/launcher3/anim/Interpolators.java
+++ b/src/com/android/launcher3/anim/Interpolators.java
@@ -53,6 +53,9 @@
     public static final Interpolator AGGRESSIVE_EASE = new PathInterpolator(0.2f, 0f, 0f, 1f);
     public static final Interpolator AGGRESSIVE_EASE_IN_OUT = new PathInterpolator(0.6f,0, 0.4f, 1);
 
+    public static final Interpolator DECELERATED_EASE = new PathInterpolator(0, 0, .2f, 1f);
+    public static final Interpolator ACCELERATED_EASE = new PathInterpolator(0.4f, 0, 1f, 1f);
+
     public static final Interpolator EXAGGERATED_EASE;
 
     public static final Interpolator INSTANT = t -> 1;
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index ba5101b..6b42d98 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -88,7 +88,7 @@
             "ENABLE_QUICKSTEP_LIVE_TILE", true, "Enable live tile in Quickstep overview");
 
     public static final BooleanFlag ENABLE_QUICKSTEP_WIDGET_APP_START = getDebugFlag(
-            "ENABLE_QUICKSTEP_WIDGET_APP_START", false,
+            "ENABLE_QUICKSTEP_WIDGET_APP_START", true,
             "Enable Quickstep animation when launching activities from an app widget");
 
     // Keep as DeviceFlag to allow remote disable in emergency.
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index cf1cb45..92d891f 100644
--- a/src/com/android/launcher3/folder/Folder.java
+++ b/src/com/android/launcher3/folder/Folder.java
@@ -31,6 +31,7 @@
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
 import android.animation.AnimatorSet;
+import android.animation.ObjectAnimator;
 import android.annotation.SuppressLint;
 import android.appwidget.AppWidgetHostView;
 import android.content.Context;
@@ -38,6 +39,8 @@
 import android.graphics.Insets;
 import android.graphics.Path;
 import android.graphics.Rect;
+import android.graphics.RectF;
+import android.graphics.drawable.GradientDrawable;
 import android.os.Build;
 import android.text.InputType;
 import android.text.Selection;
@@ -45,6 +48,7 @@
 import android.util.AttributeSet;
 import android.util.Log;
 import android.util.Pair;
+import android.util.SparseIntArray;
 import android.util.TypedValue;
 import android.view.FocusFinder;
 import android.view.KeyEvent;
@@ -96,13 +100,16 @@
 import com.android.launcher3.model.data.WorkspaceItemInfo;
 import com.android.launcher3.pageindicators.PageIndicatorDots;
 import com.android.launcher3.util.Executors;
+import com.android.launcher3.util.Themes;
 import com.android.launcher3.util.Thunk;
 import com.android.launcher3.views.ActivityContext;
 import com.android.launcher3.views.BaseDragLayer;
 import com.android.launcher3.views.ClipPathView;
+import com.android.launcher3.widget.LocalColorExtractor;
 import com.android.launcher3.widget.PendingAddShortcutInfo;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
@@ -152,6 +159,7 @@
     private static final float ICON_OVERSCROLL_WIDTH_FACTOR = 0.45f;
 
     private static final int FOLDER_NAME_ANIMATION_DURATION = 633;
+    private static final int FOLDER_COLOR_ANIMATION_DURATION = 150;
 
     private static final int REORDER_DELAY = 250;
     private static final int ON_EXIT_CLOSE_DELAY = 400;
@@ -224,6 +232,19 @@
 
     @Nullable private FolderWindowInsetsAnimationCallback mFolderWindowInsetsAnimationCallback;
 
+    // Wallpaper local color extraction
+    @Nullable private LocalColorExtractor mColorExtractor;
+    @Nullable private LocalColorExtractor.Listener mColorListener;
+    private final Rect mTempRect = new Rect();
+    private final RectF mTempRectF = new RectF();
+
+    // For simplicity, we start the color change only after the open animation has started.
+    private Runnable mColorChangeRunnable;
+    private Animator mColorChangeAnimator;
+    // The background color animator used in the folder open animation. We keep a reference to this,
+    // so that we can cancel it when starting mColorChangeAnimator.
+    private ObjectAnimator mOpenAnimationColorChangeAnimator;
+
     /**
      * Used to inflate the Workspace from XML.
      *
@@ -241,7 +262,6 @@
         // name is complete, we have something to focus on, thus hiding the cursor and giving
         // reliable behavior when clicking the text field (since it will always gain focus on click).
         setFocusableInTouchMode(true);
-
     }
 
     @Override
@@ -276,6 +296,45 @@
 
             setWindowInsetsAnimationCallback(mFolderWindowInsetsAnimationCallback);
         }
+
+        if (Utilities.ATLEAST_S) {
+            mColorExtractor = LocalColorExtractor.newInstance(mLauncher);
+            mColorListener = (RectF rect, SparseIntArray extractedColors) -> {
+                mColorChangeRunnable = () -> {
+                    mColorChangeRunnable = null;
+                    int duration = FOLDER_COLOR_ANIMATION_DURATION;
+
+                    // Cancel the open animation color change animator.
+                    ObjectAnimator existingAnim = mOpenAnimationColorChangeAnimator;
+                    if (existingAnim != null && existingAnim.isRunning()) {
+                        duration = (int) Math.max(FOLDER_COLOR_ANIMATION_DURATION,
+                                existingAnim.getDuration() * (1f - existingAnim.getDuration()));
+                        existingAnim.cancel();
+                        mOpenAnimationColorChangeAnimator = null;
+                    }
+
+                    // Start a new animator to the extracted color.
+                    int newColor = extractedColors.get(mColorExtractionIndex);
+                    GradientDrawable bg = (GradientDrawable) getBackground();
+                    mColorChangeAnimator = ObjectAnimator.ofArgb(bg, "color",
+                            bg.getColor().getDefaultColor(), newColor).setDuration(duration);
+                    mColorChangeAnimator.addListener(new AnimatorListenerAdapter() {
+                        @Override
+                        public void onAnimationEnd(Animator animation) {
+                            mColorChangeAnimator = null;
+                        }
+                    });
+                    mColorChangeAnimator.start();
+                };
+
+                // If the folder open animation has started, we can start the color change now.
+                // Otherwise we wait for it to start.
+                if (mOpenAnimationColorChangeAnimator != null
+                        && mOpenAnimationColorChangeAnimator.isStarted()) {
+                    post(mColorChangeRunnable);
+                }
+            };
+        }
     }
 
     public boolean onLongClick(View v) {
@@ -652,15 +711,18 @@
         // dropping. One resulting issue is that replaceFolderWithFinalItem() can be called twice.
         mDeleteFolderOnDropCompleted = false;
 
-        if (mCurrentAnimator != null && mCurrentAnimator.isRunning()) {
-            mCurrentAnimator.cancel();
-        }
-        AnimatorSet anim = new FolderAnimationManager(this, true /* isOpening */).getAnimator();
+        cancelRunningAnimations();
+        FolderAnimationManager fam = new FolderAnimationManager(this, true /* isOpening */);
+        AnimatorSet anim = fam.getAnimator();
+        mOpenAnimationColorChangeAnimator = fam.getBgColorAnimator();
         anim.addListener(new AnimatorListenerAdapter() {
             @Override
             public void onAnimationStart(Animator animation) {
                 mFolderIcon.setIconVisible(false);
                 mFolderIcon.drawLeaveBehindIfExists();
+                if (mColorChangeRunnable != null) {
+                    mColorChangeRunnable.run();
+                }
             }
             @Override
             public void onAnimationEnd(Animator animation) {
@@ -752,6 +814,15 @@
                 AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
     }
 
+    private void cancelRunningAnimations() {
+        if (mCurrentAnimator != null && mCurrentAnimator.isRunning()) {
+            mCurrentAnimator.cancel();
+        }
+        if (mColorChangeAnimator != null && mColorChangeAnimator.isRunning()) {
+            mColorChangeAnimator.cancel();
+        }
+    }
+
     private void animateClosed() {
         if (mIsAnimatingClosed) {
             return;
@@ -760,9 +831,7 @@
         mContent.completePendingPageChanges();
         mContent.snapToPageImmediately(mContent.getDestinationPage());
 
-        if (mCurrentAnimator != null && mCurrentAnimator.isRunning()) {
-            mCurrentAnimator.cancel();
-        }
+        cancelRunningAnimations();
         AnimatorSet a = new FolderAnimationManager(this, false /* isOpening */).getAnimator();
         a.addListener(new AnimatorListenerAdapter() {
             @Override
@@ -837,6 +906,19 @@
         clearDragInfo();
         mState = STATE_SMALL;
         mContent.setCurrentPage(0);
+
+        mOpenAnimationColorChangeAnimator = null;
+        mColorChangeRunnable = null;
+        if (mColorChangeAnimator != null) {
+            mColorChangeAnimator.cancel();
+            mColorChangeAnimator = null;
+        }
+        if (mColorExtractor != null) {
+            mColorExtractor.removeLocations();
+            mColorExtractor.setListener(null);
+        }
+        GradientDrawable bg = (GradientDrawable) getBackground();
+        bg.setColor(Themes.getAttrColor(getContext(), R.attr.folderFillColor));
     }
 
     @Override
@@ -1104,6 +1186,17 @@
         lp.height = height;
         lp.x = left;
         lp.y = top;
+
+        if (mColorExtractor != null) {
+            mColorExtractor.removeLocations();
+            mColorExtractor.setListener(mColorListener);
+            mTempRect.set(lp.x, lp.y, lp.x + lp.width, lp.y + lp.height);
+            mColorExtractor.getExtractedRectForViewRect(mLauncher,
+                    mLauncher.getWorkspace().getCurrentPage(), mTempRect, mTempRectF);
+            if (!mTempRectF.isEmpty()) {
+                mColorExtractor.addLocation(Arrays.asList(mTempRectF));
+            }
+        }
     }
 
     protected int getContentAreaHeight() {
diff --git a/src/com/android/launcher3/folder/FolderAnimationManager.java b/src/com/android/launcher3/folder/FolderAnimationManager.java
index ee6ea99..af8be8d 100644
--- a/src/com/android/launcher3/folder/FolderAnimationManager.java
+++ b/src/com/android/launcher3/folder/FolderAnimationManager.java
@@ -35,8 +35,6 @@
 import android.view.View;
 import android.view.animation.AnimationUtils;
 
-import androidx.core.graphics.ColorUtils;
-
 import com.android.launcher3.BubbleTextView;
 import com.android.launcher3.CellLayout;
 import com.android.launcher3.R;
@@ -80,6 +78,8 @@
     private final PreviewItemDrawingParams mTmpParams = new PreviewItemDrawingParams(0, 0, 0, 0);
     private final FolderGridOrganizer mPreviewVerifier;
 
+    private ObjectAnimator mBgColorAnimator;
+
     public FolderAnimationManager(Folder folder, boolean isOpening) {
         mFolder = folder;
         mContent = folder.mContent;
@@ -105,6 +105,12 @@
                 R.interpolator.large_folder_preview_item_close_interpolator);
     }
 
+    /**
+     * Returns the animator that changes the background color.
+     */
+    public ObjectAnimator getBgColorAnimator() {
+        return mBgColorAnimator;
+    }
 
     /**
      * Prepares the Folder for animating between open / closed states.
@@ -162,10 +168,15 @@
         final float yDistance = initialY - lp.y;
 
         // Set up the Folder background.
-        final int finalColor = ColorUtils.setAlphaComponent(
-                Themes.getAttrColor(mContext, R.attr.folderFillColor), 255);
-        final int initialColor = setColorAlphaBound(
-                finalColor, mPreviewBackground.getBackgroundAlpha());
+        int previewBackgroundColor = Themes.getAttrColor(mContext, R.attr.folderFillColor);
+        final int finalColor;
+        if (mIsOpening) {
+            finalColor = Themes.getAttrColor(mContext, R.attr.popupColorPrimary);
+        } else {
+            finalColor = mFolderBackground.getColor().getDefaultColor();
+        }
+        final int initialColor = setColorAlphaBound(previewBackgroundColor,
+                mPreviewBackground.getBackgroundAlpha());
         mFolderBackground.mutate();
         mFolderBackground.setColor(mIsOpening ? initialColor : finalColor);
 
@@ -193,11 +204,12 @@
             play(a, anim);
         }
 
+        mBgColorAnimator = getAnimator(mFolderBackground, "color", initialColor, finalColor);
+        play(a, mBgColorAnimator);
         play(a, getAnimator(mFolder, View.TRANSLATION_X, xDistance, 0f));
         play(a, getAnimator(mFolder, View.TRANSLATION_Y, yDistance, 0f));
         play(a, getAnimator(mFolder.mContent, SCALE_PROPERTY, initialScale, finalScale));
         play(a, getAnimator(mFolder.mFooter, SCALE_PROPERTY, initialScale, finalScale));
-        play(a, getAnimator(mFolderBackground, "color", initialColor, finalColor));
         play(a, mFolderIcon.mFolderName.createTextAlphaAnimator(!mIsOpening));
         play(a, getShape().createRevealAnimator(
                 mFolder, startRect, endRect, finalRadius, !mIsOpening));
@@ -409,7 +421,7 @@
                 : ObjectAnimator.ofFloat(view, property, v2, v1);
     }
 
-    private Animator getAnimator(GradientDrawable drawable, String property, int v1, int v2) {
+    private ObjectAnimator getAnimator(GradientDrawable drawable, String property, int v1, int v2) {
         return mIsOpening
                 ? ObjectAnimator.ofArgb(drawable, property, v1, v2)
                 : ObjectAnimator.ofArgb(drawable, property, v2, v1);
diff --git a/src/com/android/launcher3/popup/ArrowPopup.java b/src/com/android/launcher3/popup/ArrowPopup.java
index c63d69d..03351af 100644
--- a/src/com/android/launcher3/popup/ArrowPopup.java
+++ b/src/com/android/launcher3/popup/ArrowPopup.java
@@ -16,7 +16,9 @@
 
 package com.android.launcher3.popup;
 
-import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
+import static com.android.launcher3.anim.Interpolators.ACCELERATED_EASE;
+import static com.android.launcher3.anim.Interpolators.DECELERATED_EASE;
+import static com.android.launcher3.anim.Interpolators.LINEAR;
 import static com.android.launcher3.popup.PopupPopulator.MAX_SHORTCUTS;
 
 import android.animation.Animator;
@@ -24,7 +26,6 @@
 import android.animation.AnimatorSet;
 import android.animation.ArgbEvaluator;
 import android.animation.ObjectAnimator;
-import android.animation.TimeInterpolator;
 import android.animation.ValueAnimator;
 import android.content.Context;
 import android.content.res.Resources;
@@ -42,6 +43,7 @@
 import android.view.ViewGroup;
 import android.view.ViewOutlineProvider;
 import android.view.ViewTreeObserver;
+import android.view.animation.Interpolator;
 import android.widget.FrameLayout;
 
 import androidx.annotation.NonNull;
@@ -51,13 +53,10 @@
 import com.android.launcher3.BaseDraggingActivity;
 import com.android.launcher3.InsettableFrameLayout;
 import com.android.launcher3.Launcher;
-import com.android.launcher3.LauncherAnimUtils;
 import com.android.launcher3.LauncherState;
 import com.android.launcher3.R;
 import com.android.launcher3.Utilities;
 import com.android.launcher3.Workspace;
-import com.android.launcher3.anim.RevealOutlineAnimation;
-import com.android.launcher3.anim.RoundedRectRevealOutlineProvider;
 import com.android.launcher3.dragndrop.DragLayer;
 import com.android.launcher3.shortcuts.DeepShortcutView;
 import com.android.launcher3.statemanager.StatefulActivity;
@@ -77,11 +76,21 @@
 public abstract class ArrowPopup<T extends StatefulActivity<LauncherState>>
         extends AbstractFloatingView {
 
+    // Duration values (ms) for popup open and close animations.
+    private static final int OPEN_DURATION = 276;
+    private static final int OPEN_FADE_START_DELAY = 0;
+    private static final int OPEN_FADE_DURATION = 38;
+    private static final int OPEN_CHILD_FADE_START_DELAY = 38;
+    private static final int OPEN_CHILD_FADE_DURATION = 76;
+
+    private static final int CLOSE_DURATION = 200;
+    private static final int CLOSE_FADE_START_DELAY = 140;
+    private static final int CLOSE_FADE_DURATION = 50;
+    private static final int CLOSE_CHILD_FADE_START_DELAY = 0;
+    private static final int CLOSE_CHILD_FADE_DURATION = 140;
+
     // +1 for system shortcut view
     private static final int MAX_NUM_CHILDREN = MAX_SHORTCUTS + 1;
-    // Index used to get background color when using local wallpaper color extraction,
-    private static final int LIGHT_COLOR_EXTRACTION_INDEX = android.R.color.system_accent2_50;
-    private static final int DARK_COLOR_EXTRACTION_INDEX = android.R.color.system_accent2_800;
 
     private final Rect mTempRect = new Rect();
 
@@ -103,10 +112,8 @@
     protected boolean mIsAboveIcon;
     private int mGravity;
 
-    protected Animator mOpenCloseAnimator;
+    protected AnimatorSet mOpenCloseAnimator;
     protected boolean mDeferContainerRemoval;
-    private final Rect mStartRect = new Rect();
-    private final Rect mEndRect = new Rect();
 
     private final GradientDrawable mRoundedTop;
     private final GradientDrawable mRoundedBottom;
@@ -119,7 +126,6 @@
     private final int[] mColors;
     private final HashMap<String, View> mViewForRect = new HashMap<>();
 
-    private final int mColorExtractionIndex;
     @Nullable private LocalColorExtractor mColorExtractor;
 
     public ArrowPopup(Context context, AttributeSet attrs, int defStyleAttr) {
@@ -128,9 +134,6 @@
         mOutlineRadius = Themes.getDialogCornerRadius(context);
         mLauncher = BaseDraggingActivity.fromContext(context);
         mIsRtl = Utilities.isRtl(getResources());
-        mColorExtractionIndex = Utilities.isDarkTheme(context)
-                ? DARK_COLOR_EXTRACTION_INDEX
-                : LIGHT_COLOR_EXTRACTION_INDEX;
         setClipToOutline(true);
         setOutlineProvider(new ViewOutlineProvider() {
             @Override
@@ -557,48 +560,13 @@
         return getChildCount() > 0 ? getChildAt(0) : this;
     }
 
-    private int getArrowDuration() {
-        return shouldAddArrow()
-                ? getResources().getInteger(R.integer.config_popupArrowOpenCloseDuration)
-                : 0;
-    }
-
     private void animateOpen() {
         setVisibility(View.VISIBLE);
 
-        final AnimatorSet openAnim = new AnimatorSet();
-        final Resources res = getResources();
-        final long revealDuration = (long) res.getInteger(R.integer.config_popupOpenCloseDuration);
-        final long arrowDuration = getArrowDuration();
-        final TimeInterpolator revealInterpolator = ACCEL_DEACCEL;
-
-        // Rectangular reveal.
-        mEndRect.set(0, 0, getMeasuredWidth(), getMeasuredHeight());
-        final ValueAnimator revealAnim = createOpenCloseOutlineProvider()
-                .createRevealAnimator(this, false);
-        revealAnim.setDuration(revealDuration);
-        revealAnim.setInterpolator(revealInterpolator);
-        // Clip the popup to the initial outline while the notification dot and arrow animate.
-        revealAnim.start();
-        revealAnim.pause();
-
-        ValueAnimator fadeIn = ValueAnimator.ofFloat(0, 1);
-        fadeIn.setDuration(revealDuration + arrowDuration);
-        fadeIn.setInterpolator(revealInterpolator);
-        fadeIn.addUpdateListener(anim -> {
-            float alpha = (float) anim.getAnimatedValue();
-            mArrow.setAlpha(alpha);
-            setAlpha(revealAnim.isStarted() ? alpha : 0);
-        });
-        openAnim.play(fadeIn);
-
-        // Animate the arrow.
-        mArrow.setScaleX(0);
-        mArrow.setScaleY(0);
-        Animator arrowScale = ObjectAnimator.ofFloat(mArrow, LauncherAnimUtils.SCALE_PROPERTY, 1)
-                .setDuration(arrowDuration);
-
-        openAnim.addListener(new AnimatorListenerAdapter() {
+        mOpenCloseAnimator = getOpenCloseAnimator(true, OPEN_DURATION, OPEN_FADE_START_DELAY,
+                OPEN_FADE_DURATION, OPEN_CHILD_FADE_START_DELAY, OPEN_CHILD_FADE_DURATION,
+                DECELERATED_EASE);
+        mOpenCloseAnimator.addListener(new AnimatorListenerAdapter() {
             @Override
             public void onAnimationEnd(Animator animation) {
                 setAlpha(1f);
@@ -606,56 +574,68 @@
                 mOpenCloseAnimator = null;
             }
         });
-
-        mOpenCloseAnimator = openAnim;
-        openAnim.playSequentially(arrowScale, revealAnim);
-        openAnim.start();
+        mOpenCloseAnimator.start();
     }
 
+    private AnimatorSet getOpenCloseAnimator(boolean isOpening, int totalDuration,
+            int fadeStartDelay, int fadeDuration, int childFadeStartDelay,
+            int childFadeDuration, Interpolator interpolator) {
+        final AnimatorSet openAnim = new AnimatorSet();
+        float[] alphaValues = isOpening ? new float[] {0, 1} : new float[] {1, 0};
+        float[] scaleValues = isOpening ? new float[] {0.5f, 1} : new float[] {1, 0.5f};
+
+        ValueAnimator fade = ValueAnimator.ofFloat(alphaValues);
+        fade.setStartDelay(fadeStartDelay);
+        fade.setDuration(fadeDuration);
+        fade.setInterpolator(LINEAR);
+        fade.addUpdateListener(anim -> {
+            float alpha = (float) anim.getAnimatedValue();
+            mArrow.setAlpha(alpha);
+            setAlpha(alpha);
+        });
+        openAnim.play(fade);
+
+        setPivotX(mIsLeftAligned ? 0 : getMeasuredWidth());
+        setPivotY(mIsAboveIcon ? getMeasuredHeight() : 0);
+        Animator scale = ObjectAnimator.ofFloat(this, View.SCALE_Y, scaleValues);
+        scale.setDuration(totalDuration);
+        scale.setInterpolator(interpolator);
+        openAnim.play(scale);
+
+        for (int i = getChildCount() - 1; i >= 0; --i) {
+            View view = getChildAt(i);
+            if (view.getVisibility() == VISIBLE && view instanceof ViewGroup) {
+                for (int j = ((ViewGroup) view).getChildCount() - 1; j >= 0; --j) {
+                    View childView = ((ViewGroup) view).getChildAt(j);
+
+                    childView.setAlpha(alphaValues[0]);
+                    ValueAnimator childFade = ObjectAnimator.ofFloat(childView, ALPHA, alphaValues);
+                    childFade.setStartDelay(childFadeStartDelay);
+                    childFade.setDuration(childFadeDuration);
+                    childFade.setInterpolator(LINEAR);
+
+                    openAnim.play(childFade);
+                }
+            }
+        }
+        return openAnim;
+    }
+
+
     protected void animateClose() {
         if (!mIsOpen) {
             return;
         }
-        if (getOutlineProvider() instanceof RevealOutlineAnimation) {
-            ((RevealOutlineAnimation) getOutlineProvider()).getOutline(mEndRect);
-        } else {
-            mEndRect.set(0, 0, getMeasuredWidth(), getMeasuredHeight());
-        }
         if (mOpenCloseAnimator != null) {
             mOpenCloseAnimator.cancel();
         }
         mIsOpen = false;
 
-
-        final AnimatorSet closeAnim = new AnimatorSet();
-        final Resources res = getResources();
-        final TimeInterpolator revealInterpolator = ACCEL_DEACCEL;
-        final long revealDuration = res.getInteger(R.integer.config_popupOpenCloseDuration);
-        final long arrowDuration = getArrowDuration();
-
-        // Hide the arrow
-        Animator scaleArrow = ObjectAnimator.ofFloat(mArrow, LauncherAnimUtils.SCALE_PROPERTY, 0)
-                .setDuration(arrowDuration);
-
-        // Rectangular reveal (reversed).
-        final ValueAnimator revealAnim = createOpenCloseOutlineProvider()
-                .createRevealAnimator(this, true);
-        revealAnim.setDuration(revealDuration);
-        revealAnim.setInterpolator(revealInterpolator);
-        closeAnim.playSequentially(revealAnim, scaleArrow);
-
-        ValueAnimator fadeOut = ValueAnimator.ofFloat(getAlpha(), 0);
-        fadeOut.setDuration(revealDuration + arrowDuration);
-        fadeOut.setInterpolator(revealInterpolator);
-        fadeOut.addUpdateListener(anim -> {
-            float alpha = (float) anim.getAnimatedValue();
-            mArrow.setAlpha(alpha);
-            setAlpha(scaleArrow.isStarted() ? 0 : alpha);
-        });
-        closeAnim.play(fadeOut);
-
-        onCreateCloseAnimation(closeAnim);
-        closeAnim.addListener(new AnimatorListenerAdapter() {
+        mOpenCloseAnimator = getOpenCloseAnimator(false, CLOSE_DURATION, CLOSE_FADE_START_DELAY,
+                CLOSE_FADE_DURATION, CLOSE_CHILD_FADE_START_DELAY, CLOSE_CHILD_FADE_DURATION,
+                ACCELERATED_EASE);
+        onCreateCloseAnimation(mOpenCloseAnimator);
+        mOpenCloseAnimator.addListener(new AnimatorListenerAdapter() {
             @Override
             public void onAnimationEnd(Animator animation) {
                 mOpenCloseAnimator = null;
@@ -666,8 +646,7 @@
                 }
             }
         });
-        mOpenCloseAnimator = closeAnim;
-        closeAnim.start();
+        mOpenCloseAnimator.start();
     }
 
     /**
@@ -675,16 +654,6 @@
      */
     protected void onCreateCloseAnimation(AnimatorSet anim) { }
 
-    private RoundedRectRevealOutlineProvider createOpenCloseOutlineProvider() {
-        int arrowLeft = getArrowLeft();
-        int arrowCenterY = mIsAboveIcon ? getMeasuredHeight() : 0;
-
-        mStartRect.set(arrowLeft, arrowCenterY, arrowLeft + mArrowWidth, arrowCenterY);
-
-        return new RoundedRectRevealOutlineProvider(
-                mArrowPointRadius, mOutlineRadius, mStartRect, mEndRect);
-    }
-
     /**
      * Closes the popup without animation.
      */
diff --git a/src/com/android/launcher3/widget/LocalColorExtractor.java b/src/com/android/launcher3/widget/LocalColorExtractor.java
index 8ae6b2e..a66024a 100644
--- a/src/com/android/launcher3/widget/LocalColorExtractor.java
+++ b/src/com/android/launcher3/widget/LocalColorExtractor.java
@@ -28,6 +28,7 @@
 
 import com.android.launcher3.Launcher;
 import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
 import com.android.launcher3.util.ResourceBasedOverride;
 
 import java.util.List;
@@ -35,6 +36,10 @@
 /** Extracts the colors we need from the wallpaper at given locations. */
 public class LocalColorExtractor implements ResourceBasedOverride {
 
+    // Index used to get background color when using local wallpaper color extraction,
+    private static final int LIGHT_COLOR_EXTRACTION_INDEX = android.R.color.system_accent2_50;
+    private static final int DARK_COLOR_EXTRACTION_INDEX = android.R.color.system_accent2_800;
+
     /** Listener for color changes on a screen location. */
     public interface Listener {
         /**
@@ -103,4 +108,13 @@
             RectF colorExtractionRectOut) {
         // no-op
     }
+
+    /**
+     * Returns an index used to query the color of interest from the list of extracted colors.
+     */
+    public static int getColorIndex(Context context) {
+        return Utilities.isDarkTheme(context)
+                ? DARK_COLOR_EXTRACTION_INDEX
+                : LIGHT_COLOR_EXTRACTION_INDEX;
+    }
 }