diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2019-01-25 15:10:18 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2019-01-29 11:29:52 -0800 |
commit | 8c48d8bea64b95916b18bd41a4fdb58d4d7477be (patch) | |
tree | 1a3538863bdb43b87eef0b1238d17ac908f045c5 /iconloaderlib/src/com/android/launcher3 | |
parent | 9752705e92593adfb60568ac4d059cc776cfceaa (diff) | |
download | android_packages_apps_Trebuchet-8c48d8bea64b95916b18bd41a4fdb58d4d7477be.tar.gz android_packages_apps_Trebuchet-8c48d8bea64b95916b18bd41a4fdb58d4d7477be.tar.bz2 android_packages_apps_Trebuchet-8c48d8bea64b95916b18bd41a4fdb58d4d7477be.zip |
Changing min sdk to 25
Change-Id: I0d28069967854357ca755bf25dec19d4979bdecf
Diffstat (limited to 'iconloaderlib/src/com/android/launcher3')
3 files changed, 5 insertions, 47 deletions
diff --git a/iconloaderlib/src/com/android/launcher3/icons/FixedScaleDrawable.java b/iconloaderlib/src/com/android/launcher3/icons/FixedScaleDrawable.java index e594f477e..516965ec2 100644 --- a/iconloaderlib/src/com/android/launcher3/icons/FixedScaleDrawable.java +++ b/iconloaderlib/src/com/android/launcher3/icons/FixedScaleDrawable.java @@ -1,12 +1,10 @@ package com.android.launcher3.icons; -import android.annotation.TargetApi; import android.content.res.Resources; import android.content.res.Resources.Theme; import android.graphics.Canvas; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.DrawableWrapper; -import android.os.Build; import android.util.AttributeSet; import org.xmlpull.v1.XmlPullParser; @@ -14,7 +12,6 @@ import org.xmlpull.v1.XmlPullParser; /** * Extension of {@link DrawableWrapper} which scales the child drawables by a fixed amount. */ -@TargetApi(Build.VERSION_CODES.N) public class FixedScaleDrawable extends DrawableWrapper { // TODO b/33553066 use the constant defined in MaskableIconDrawable diff --git a/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java b/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java index ce6644898..2966cb170 100644 --- a/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java +++ b/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java @@ -47,16 +47,15 @@ import com.android.launcher3.icons.BitmapInfo; import com.android.launcher3.icons.BitmapRenderer; import com.android.launcher3.icons.GraphicsUtils; import com.android.launcher3.util.ComponentKey; -import com.android.launcher3.util.Provider; import com.android.launcher3.util.SQLiteCacheHelper; import java.util.AbstractMap; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; -import java.util.Locale; import java.util.Map; import java.util.Set; +import java.util.function.Supplier; import androidx.annotation.NonNull; @@ -231,13 +230,8 @@ public abstract class BaseIconCache { * incorporates all the properties that can affect the cache like locale and system-version. */ private void updateSystemState() { - final String locale; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - locale = mContext.getResources().getConfiguration().getLocales().toLanguageTags(); - } else { - locale = Locale.getDefault().toString(); - } - + final String locale = + mContext.getResources().getConfiguration().getLocales().toLanguageTags(); mSystemState = locale + "," + Build.VERSION.SDK_INT; } @@ -309,7 +303,7 @@ public abstract class BaseIconCache { */ protected <T> CacheEntry cacheLocked( @NonNull ComponentName componentName, @NonNull UserHandle user, - @NonNull Provider<T> infoProvider, @NonNull CachingLogic<T> cachingLogic, + @NonNull Supplier<T> infoProvider, @NonNull CachingLogic<T> cachingLogic, boolean usePackageIcon, boolean useLowResIcon) { return cacheLocked(componentName, user, infoProvider, cachingLogic, usePackageIcon, useLowResIcon, true); @@ -317,7 +311,7 @@ public abstract class BaseIconCache { protected <T> CacheEntry cacheLocked( @NonNull ComponentName componentName, @NonNull UserHandle user, - @NonNull Provider<T> infoProvider, @NonNull CachingLogic<T> cachingLogic, + @NonNull Supplier<T> infoProvider, @NonNull CachingLogic<T> cachingLogic, boolean usePackageIcon, boolean useLowResIcon, boolean addToMemCache) { assertWorkerThread(); ComponentKey cacheKey = new ComponentKey(componentName, user); diff --git a/iconloaderlib/src/com/android/launcher3/util/Provider.java b/iconloaderlib/src/com/android/launcher3/util/Provider.java deleted file mode 100644 index 4a54c0f05..000000000 --- a/iconloaderlib/src/com/android/launcher3/util/Provider.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2016 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. - */ - -package com.android.launcher3.util; - -/** - * Utility class to allow lazy initialization of objects. - */ -public interface Provider<T> { - - /** - * Initializes and returns the object. This may contain expensive operations not suitable - * to UI thread. - */ - T get(); - - static <T> Provider<T> of (T value) { - return() -> value; - } -} |