summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Chapin <chapin@google.com>2023-04-11 00:28:30 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-04-11 01:10:41 +0000
commitba7e28e012bb887ca84292a26930ecf9cf8acf6c (patch)
treebe1bda134653e17c3201c70a60846a44b2d046f7
parentde55cbafd25a3cabe56096fadb6db186f91bcc6e (diff)
Revert "Calculate LiveWallpaper thumbnail raw dimension"
Revert submission 22371636-thumb-dimen Reason for revert: Droidfood blocking bug b/277538431 Reverted changes: /q/submissionid:22371636-thumb-dimen (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c7bb6603a8960eee8c21749a5a725f1f1307827b) Merged-In: Ied113ef3e2839872fa4e32eaa9c900f4a53d2348 Change-Id: Ied113ef3e2839872fa4e32eaa9c900f4a53d2348
-rwxr-xr-xsrc/com/android/wallpaper/asset/LiveWallpaperThumbAsset.java23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/com/android/wallpaper/asset/LiveWallpaperThumbAsset.java b/src/com/android/wallpaper/asset/LiveWallpaperThumbAsset.java
index 3e4d58bd..1f4fb674 100755
--- a/src/com/android/wallpaper/asset/LiveWallpaperThumbAsset.java
+++ b/src/com/android/wallpaper/asset/LiveWallpaperThumbAsset.java
@@ -21,21 +21,16 @@ import android.content.res.AssetFileDescriptor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
-import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
-import android.graphics.drawable.LayerDrawable;
import android.net.Uri;
import android.util.Log;
import android.widget.ImageView;
import androidx.annotation.WorkerThread;
-import com.android.wallpaper.module.DrawableLayerResolver;
-import com.android.wallpaper.module.InjectorProvider;
-
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.Key;
import com.bumptech.glide.load.MultiTransformation;
@@ -64,7 +59,6 @@ public class LiveWallpaperThumbAsset extends Asset {
protected final Context mContext;
protected final android.app.WallpaperInfo mInfo;
- protected final DrawableLayerResolver mLayerResolver;
// The content Uri of thumbnail
protected Uri mUri;
private Drawable mThumbnailDrawable;
@@ -72,7 +66,6 @@ public class LiveWallpaperThumbAsset extends Asset {
public LiveWallpaperThumbAsset(Context context, android.app.WallpaperInfo info) {
mContext = context.getApplicationContext();
mInfo = info;
- mLayerResolver = InjectorProvider.getInjector().getDrawableLayerResolver();
}
public LiveWallpaperThumbAsset(Context context, android.app.WallpaperInfo info, Uri uri) {
@@ -121,21 +114,7 @@ public class LiveWallpaperThumbAsset extends Asset {
@Override
public void decodeRawDimensions(Activity unused, DimensionsReceiver receiver) {
- // TODO(b/277166654): Reuse the logic for all thumb asset decoding
- sExecutorService.execute(() -> {
- Bitmap result = null;
- Drawable thumb = mInfo.loadThumbnail(mContext.getPackageManager());
- if (thumb instanceof BitmapDrawable) {
- result = ((BitmapDrawable) thumb).getBitmap();
- } else if (thumb instanceof LayerDrawable) {
- Drawable layer = mLayerResolver.resolveLayer((LayerDrawable) thumb);
- if (layer instanceof BitmapDrawable) {
- result = ((BitmapDrawable) layer).getBitmap();
- }
- }
- receiver.onDimensionsDecoded(
- result == null ? null : new Point(result.getWidth(), result.getHeight()));
- });
+ receiver.onDimensionsDecoded(null);
}
@Override