Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11e94031 authored by Uwais Ashraf's avatar Uwais Ashraf Committed by Android (Google) Code Review
Browse files

Merge "Clear Bitmap density to render correctly in Overview" into main

parents 4c10ff77 c435c3e2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ android_library {
        "androidx.lifecycle_lifecycle-runtime-ktx",
        "androidx.lifecycle_lifecycle-viewmodel-ktx",
        "androidx.recyclerview_recyclerview",
        "com_android_launcher3_flags_lib",
        "kotlinx_coroutines_android",
        "kotlinx_coroutines",
        "dagger2",
+16 −9
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.graphics.Rect
import android.util.Log
import android.view.WindowInsetsController.Appearance
import android.window.TaskSnapshot
import com.android.launcher3.Flags.enableRefactorTaskThumbnail

/** Data for a single thumbnail. */
data class ThumbnailData(
@@ -63,6 +64,11 @@ data class ThumbnailData(
                    ex,
                )
            }
            if (enableRefactorTaskThumbnail()) {
                // These bitmaps are used with custom rendering logic (PreviewPositionHelper) that
                // doesn't account for bitmap density
                thumbnail?.density = Bitmap.DENSITY_NONE
            } else {
                if (snapshot.densityDpi > 0 && thumbnail?.density != snapshot.densityDpi) {
                    Log.d(
                        TAG,
@@ -73,6 +79,7 @@ data class ThumbnailData(
                    )
                    thumbnail?.density = snapshot.densityDpi
                }
            }
            return thumbnail
                ?: Bitmap.createBitmap(snapshot.taskSize.x, snapshot.taskSize.y, ARGB_8888).apply {
                    eraseColor(Color.BLACK)