summaryrefslogtreecommitdiffstats
path: root/iconloaderlib
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2019-07-23 20:54:13 -0700
committerWinson Chung <winsonc@google.com>2019-07-23 20:54:13 -0700
commit3fc9a1cf695d6d561953e53e159ed786e193c48d (patch)
tree3a0e35d751a94716de0020fa4fa2d67434ed753a /iconloaderlib
parent5841e40a95b2d01386d83b83abeef9b150d833c5 (diff)
parent7b0520afe48b511ed910de1048405185712e5b03 (diff)
downloadandroid_packages_apps_Trebuchet-3fc9a1cf695d6d561953e53e159ed786e193c48d.tar.gz
android_packages_apps_Trebuchet-3fc9a1cf695d6d561953e53e159ed786e193c48d.tar.bz2
android_packages_apps_Trebuchet-3fc9a1cf695d6d561953e53e159ed786e193c48d.zip
Merging ub-launcher3-qt-r1-dev, build 5749827
Test: Manual Bug:136282913 P1 Swipe up from Assistant Fulfillment Card Jank Bug:137129923 P1 Pixel launcher is leaking memory Bug:137161198 P1 Unable to pull notification panel down with a swipe on home screen Bug:137253043 P1 "Pixel Launcher keeps stopping" when scrolling through recent apps Bug:137487381 P1 Overview goes back to fullscreen when swiping up during transition Bug:137836033 P4 Fail to stop music due to "Swipe failed to receive an event for the swipe end" Bug:138152531 P2 [Android Q][04713598] Launcher test cases are failed Bug:138236583 P1 Icon scale is wrong when dragging from all apps or folders Bug:138251824 P1 Flake: want to switch from background to overview; Swipe failed to receive an event for the swipe end Bug:138252347 P1 qt-r1-dev Pixel Launcher flag ENABLE_HINTS_IN_OVERVIEW is Disable by Default Change-Id: Idd0e987d26e1ffc75cdb9f90e9c08c26bb8c6503
Diffstat (limited to 'iconloaderlib')
-rw-r--r--iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java b/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java
index 60320d63b..e1b71a0b5 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java
@@ -22,6 +22,7 @@ import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Process;
import android.os.UserHandle;
+import androidx.annotation.NonNull;
/**
* This class will be moved to androidx library. There shouldn't be any dependency outside
@@ -154,7 +155,7 @@ public class BaseIconFactory implements AutoCloseable {
* @param scale returns the scale result from normalization
* @return a bitmap suitable for disaplaying as an icon at various system UIs.
*/
- public BitmapInfo createBadgedIconBitmap(Drawable icon, UserHandle user,
+ public BitmapInfo createBadgedIconBitmap(@NonNull Drawable icon, UserHandle user,
boolean shrinkNonAdaptiveIcons, boolean isInstantApp, float[] scale) {
if (scale == null) {
scale = new float[1];
@@ -204,8 +205,11 @@ public class BaseIconFactory implements AutoCloseable {
mDisableColorExtractor = true;
}
- private Drawable normalizeAndWrapToAdaptiveIcon(Drawable icon, boolean shrinkNonAdaptiveIcons,
- RectF outIconBounds, float[] outScale) {
+ private Drawable normalizeAndWrapToAdaptiveIcon(@NonNull Drawable icon,
+ boolean shrinkNonAdaptiveIcons, RectF outIconBounds, float[] outScale) {
+ if (icon == null) {
+ return null;
+ }
float scale = 1f;
if (shrinkNonAdaptiveIcons && ATLEAST_OREO) {
@@ -261,7 +265,7 @@ public class BaseIconFactory implements AutoCloseable {
* @param icon drawable that should be flattened to a bitmap
* @param scale the scale to apply before drawing {@param icon} on the canvas
*/
- public Bitmap createIconBitmap(Drawable icon, float scale, int size) {
+ public Bitmap createIconBitmap(@NonNull Drawable icon, float scale, int size) {
Bitmap bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
if (icon == null) {
return bitmap;