summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-09-01 00:18:50 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-09-01 00:18:50 +0000
commit651b1615b8b6ae695c930a923c94f7518ba47c07 (patch)
tree5b4c37764e65ff784b2c0a7f4dbef3f46635eaef
parentb072fdaa33861a994babd1825070eb51c36db4e7 (diff)
parent22bd6262f60ee07dd4540f42d0f7dad3dcdd4e0b (diff)
downloadsystemui-android12-mainline-art-release.tar.gz
Change-Id: I528847c4a4f7ddd286d643e6fcc91db1c7d641fb
-rw-r--r--iconloaderlib/Android.bp4
-rw-r--r--iconloaderlib/lint-baseline.xml147
-rw-r--r--iconloaderlib/src/com/android/launcher3/icons/FastBitmapDrawable.java36
-rw-r--r--iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java2
4 files changed, 23 insertions, 166 deletions
diff --git a/iconloaderlib/Android.bp b/iconloaderlib/Android.bp
index 4f4ea0c..6867e6b 100644
--- a/iconloaderlib/Android.bp
+++ b/iconloaderlib/Android.bp
@@ -19,7 +19,7 @@ package {
android_library {
name: "iconloader_base",
sdk_version: "current",
- min_sdk_version: "21",
+ min_sdk_version: "26",
static_libs: [
"androidx.core_core",
],
@@ -34,7 +34,7 @@ android_library {
android_library {
name: "iconloader",
sdk_version: "system_current",
- min_sdk_version: "21",
+ min_sdk_version: "26",
static_libs: [
"androidx.core_core",
],
diff --git a/iconloaderlib/lint-baseline.xml b/iconloaderlib/lint-baseline.xml
deleted file mode 100644
index f2439e7..0000000
--- a/iconloaderlib/lint-baseline.xml
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<issues format="5" by="lint 4.1.0" client="cli" variant="all" version="4.1.0">
-
- <issue
- id="NewApi"
- message="Call requires API level 24 (current min is 21): `android.os.LocaleList#getEmptyLocaleList`"
- errorLine1=" protected LocaleList mLocaleList = LocaleList.getEmptyLocaleList();"
- errorLine2=" ~~~~~~~~~~~~~~~~~~">
- <location
- file="frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java"
- line="93"
- column="51"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 24 (current min is 21): `android.content.res.Configuration#getLocales`"
- errorLine1=" mLocaleList = mContext.getResources().getConfiguration().getLocales();"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java"
- line="241"
- column="66"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 24 (current min is 21): `android.os.LocaleList#toLanguageTags`"
- errorLine1=" mSystemState = mLocaleList.toLanguageTags() + &quot;,&quot; + Build.VERSION.SDK_INT;"
- errorLine2=" ~~~~~~~~~~~~~~">
- <location
- file="frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java"
- line="242"
- column="36"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 24 (current min is 21): `android.os.UserHandle#getUserHandleForUid`"
- errorLine1=" UserHandle.getUserHandleForUid(Integer.parseInt(str.substring(sep + 1))));"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~">
- <location
- file="frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/util/ComponentKey.java"
- line="79"
- column="32"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level 23 (current min is 21): `android.graphics.drawable.DrawableWrapper`"
- errorLine1="public class FixedScaleDrawable extends DrawableWrapper {"
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/FixedScaleDrawable.java"
- line="15"
- column="41"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 23 (current min is 21): `new android.graphics.drawable.DrawableWrapper`"
- errorLine1=" super(new ColorDrawable());"
- errorLine2=" ~~~~~">
- <location
- file="frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/FixedScaleDrawable.java"
- line="22"
- column="9"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 26 (current min is 21): `new android.graphics.drawable.AdaptiveIconDrawable`"
- errorLine1=" AdaptiveIconDrawable drawable = new AdaptiveIconDrawable("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/GraphicsUtils.java"
- line="97"
- column="41"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 26 (current min is 21): `android.graphics.drawable.AdaptiveIconDrawable#getIconMask`"
- errorLine1=" return new Path(drawable.getIconMask());"
- errorLine2=" ~~~~~~~~~~~">
- <location
- file="frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/GraphicsUtils.java"
- line="100"
- column="34"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Method reference requires API level 22 (current min is 21): `ActivityInfo::loadUnbadgedIcon`"
- errorLine1=" ActivityInfo::loadUnbadgedIcon;"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/IconProvider.java"
- line="64"
- column="13"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 24 (current min is 21): `android.os.UserHandle#getUserHandleForUid`"
- errorLine1=" UserHandle.getUserHandleForUid(info.applicationInfo.uid),"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~">
- <location
- file="frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/IconProvider.java"
- line="126"
- column="28"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 23 (current min is 21): `android.content.Context#getSystemService`"
- errorLine1=" : context.getSystemService(UserManager.class).getUserProfiles()) {"
- errorLine2=" ~~~~~~~~~~~~~~~~">
- <location
- file="frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/IconProvider.java"
- line="252"
- column="35"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Class requires API level 23 (current min is 21): `android.graphics.drawable.DrawableWrapper`"
- errorLine1="public class RoundDrawableWrapper extends DrawableWrapper {"
- errorLine2=" ~~~~~~~~~~~~~~~">
- <location
- file="frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/RoundDrawableWrapper.java"
- line="29"
- column="43"/>
- </issue>
-
- <issue
- id="NewApi"
- message="Call requires API level 23 (current min is 21): `new android.graphics.drawable.DrawableWrapper`"
- errorLine1=" super(dr);"
- errorLine2=" ~~~~~">
- <location
- file="frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/RoundDrawableWrapper.java"
- line="36"
- column="9"/>
- </issue>
-
-</issues>
diff --git a/iconloaderlib/src/com/android/launcher3/icons/FastBitmapDrawable.java b/iconloaderlib/src/com/android/launcher3/icons/FastBitmapDrawable.java
index 96ee291..4aa2846 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/FastBitmapDrawable.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/FastBitmapDrawable.java
@@ -253,22 +253,7 @@ public class FastBitmapDrawable extends Drawable {
private ColorFilter getDisabledColorFilter() {
if (sDisabledFColorFilter == null) {
- ColorMatrix tempBrightnessMatrix = new ColorMatrix();
- ColorMatrix tempFilterMatrix = new ColorMatrix();
-
- tempFilterMatrix.setSaturation(1f - DISABLED_DESATURATION);
- float scale = 1 - DISABLED_BRIGHTNESS;
- int brightnessI = (int) (255 * DISABLED_BRIGHTNESS);
- float[] mat = tempBrightnessMatrix.getArray();
- mat[0] = scale;
- mat[6] = scale;
- mat[12] = scale;
- mat[4] = brightnessI;
- mat[9] = brightnessI;
- mat[14] = brightnessI;
- mat[18] = mDisabledAlpha;
- tempFilterMatrix.preConcat(tempBrightnessMatrix);
- sDisabledFColorFilter = new ColorMatrixColorFilter(tempFilterMatrix);
+ sDisabledFColorFilter = getDisabledFColorFilter(mDisabledAlpha);
}
return sDisabledFColorFilter;
}
@@ -286,6 +271,25 @@ public class FastBitmapDrawable extends Drawable {
return new FastBitmapConstantState(mBitmap, mIconColor, mIsDisabled);
}
+ public static ColorFilter getDisabledFColorFilter(float disabledAlpha) {
+ ColorMatrix tempBrightnessMatrix = new ColorMatrix();
+ ColorMatrix tempFilterMatrix = new ColorMatrix();
+
+ tempFilterMatrix.setSaturation(1f - DISABLED_DESATURATION);
+ float scale = 1 - DISABLED_BRIGHTNESS;
+ int brightnessI = (int) (255 * DISABLED_BRIGHTNESS);
+ float[] mat = tempBrightnessMatrix.getArray();
+ mat[0] = scale;
+ mat[6] = scale;
+ mat[12] = scale;
+ mat[4] = brightnessI;
+ mat[9] = brightnessI;
+ mat[14] = brightnessI;
+ mat[18] = disabledAlpha;
+ tempFilterMatrix.preConcat(tempBrightnessMatrix);
+ return new ColorMatrixColorFilter(tempBrightnessMatrix);
+ }
+
protected static class FastBitmapConstantState extends ConstantState {
protected final Bitmap mBitmap;
protected final int mIconColor;
diff --git a/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java b/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java
index cb39490..d685737 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java
@@ -510,7 +510,7 @@ public abstract class BaseIconCache {
* Cache class to store the actual entries on disk
*/
public static final class IconDB extends SQLiteCacheHelper {
- private static final int RELEASE_VERSION = 30;
+ private static final int RELEASE_VERSION = 31;
public static final String TABLE_NAME = "icons";
public static final String COLUMN_ROWID = "rowid";