Merge "Replace conversations widget app icon" into sc-dev am: 14e2070709 am: 883cbb303a

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14353226

Change-Id: I2201894f0da85b6d78c02cf04ed96eebc22ebef6
diff --git a/res/drawable/ic_conversations_widget_category.xml b/res/drawable/ic_conversations_widget_category.xml
new file mode 100644
index 0000000..7b13b23
--- /dev/null
+++ b/res/drawable/ic_conversations_widget_category.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 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="48dp"
+    android:height="48dp"
+    android:viewportWidth="48"
+    android:viewportHeight="48">
+  <path
+      android:pathData="M24,24m-24,0a24,24 0,1 1,48 0a24,24 0,1 1,-48 0"
+      android:fillColor="#81C995"/>
+  <path
+      android:pathData="M27,34C23.134,34 20,30.866 20,27C20,23.134 23.134,20 27,20C30.866,20 34,23.134 34,27C34,28.4872 33.5362,29.8662 32.7453,31"
+      android:strokeWidth="2"
+      android:fillColor="#00000000"
+      android:strokeColor="#3C4043"/>
+  <path
+      android:pathData="M35,33l-8,0l-0,2l8,0z"
+      android:fillColor="#3C4043"/>
+  <path
+      android:pathData="M21,21m-6,0a6,6 0,1 1,12 0a6,6 0,1 1,-12 0"
+      android:fillColor="#81C995"/>
+  <path
+      android:pathData="M16,25h5v2h-5z"
+      android:fillColor="#81C995"/>
+  <path
+      android:pathData="M21,28C24.866,28 28,24.866 28,21C28,17.134 24.866,14 21,14C17.134,14 14,17.134 14,21C14,22.4872 14.4638,23.8662 15.2547,25"
+      android:strokeWidth="2"
+      android:fillColor="#00000000"
+      android:strokeColor="#ffffff"/>
+  <path
+      android:pathData="M13,27h8v2h-8z"
+      android:fillColor="#ffffff"/>
+</vector>
diff --git a/src/com/android/launcher3/widget/picker/WidgetsListHeader.java b/src/com/android/launcher3/widget/picker/WidgetsListHeader.java
index ccf3187..41aa437 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsListHeader.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsListHeader.java
@@ -35,7 +35,6 @@
 import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.LauncherAppState;
 import com.android.launcher3.R;
-import com.android.launcher3.icons.FastBitmapDrawable;
 import com.android.launcher3.icons.IconCache.ItemInfoUpdateReceiver;
 import com.android.launcher3.icons.PlaceHolderIconDrawable;
 import com.android.launcher3.icons.cache.HandlerRunnable;
@@ -174,7 +173,14 @@
     }
 
     private void setIcon(PackageItemInfo info) {
-        FastBitmapDrawable icon = info.newIcon(getContext());
+        Drawable icon;
+        switch (info.category) {
+            case PackageItemInfo.CONVERSATIONS:
+                icon = getContext().getDrawable(R.drawable.ic_conversations_widget_category);
+                break;
+            default:
+                icon = info.newIcon(getContext());
+        }
         applyDrawables(icon);
         mIconDrawable = icon;
         if (mIconDrawable != null) {