Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/ThumbnailData.java +6 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.app.ActivityManager.TaskSnapshot; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.GraphicBuffer; import android.graphics.Point; import android.graphics.Rect; import android.hardware.HardwareBuffer; import android.util.Log; Loading Loading @@ -63,10 +64,12 @@ public class ThumbnailData { public ThumbnailData(TaskSnapshot snapshot) { final GraphicBuffer buffer = snapshot.getSnapshot(); if (buffer != null && (buffer.getUsage() & HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE) == 0) { if (buffer == null || (buffer.getUsage() & HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE) == 0) { // TODO(b/157562905): Workaround for a crash when we get a snapshot without this state Log.e("ThumbnailData", "Unexpected snapshot without USAGE_GPU_SAMPLED_IMAGE"); thumbnail = Bitmap.createBitmap(buffer.getWidth(), buffer.getHeight(), ARGB_8888); Log.e("ThumbnailData", "Unexpected snapshot without USAGE_GPU_SAMPLED_IMAGE: " + buffer); Point taskSize = snapshot.getTaskSize(); thumbnail = Bitmap.createBitmap(taskSize.x, taskSize.y, ARGB_8888); thumbnail.eraseColor(Color.BLACK); } else { thumbnail = Bitmap.wrapHardwareBuffer(buffer, snapshot.getColorSpace()); Loading Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/ThumbnailData.java +6 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.app.ActivityManager.TaskSnapshot; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.GraphicBuffer; import android.graphics.Point; import android.graphics.Rect; import android.hardware.HardwareBuffer; import android.util.Log; Loading Loading @@ -63,10 +64,12 @@ public class ThumbnailData { public ThumbnailData(TaskSnapshot snapshot) { final GraphicBuffer buffer = snapshot.getSnapshot(); if (buffer != null && (buffer.getUsage() & HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE) == 0) { if (buffer == null || (buffer.getUsage() & HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE) == 0) { // TODO(b/157562905): Workaround for a crash when we get a snapshot without this state Log.e("ThumbnailData", "Unexpected snapshot without USAGE_GPU_SAMPLED_IMAGE"); thumbnail = Bitmap.createBitmap(buffer.getWidth(), buffer.getHeight(), ARGB_8888); Log.e("ThumbnailData", "Unexpected snapshot without USAGE_GPU_SAMPLED_IMAGE: " + buffer); Point taskSize = snapshot.getTaskSize(); thumbnail = Bitmap.createBitmap(taskSize.x, taskSize.y, ARGB_8888); thumbnail.eraseColor(Color.BLACK); } else { thumbnail = Bitmap.wrapHardwareBuffer(buffer, snapshot.getColorSpace()); Loading