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

Commit daea33e6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

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

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


/** Data for a single thumbnail. */
/** Data for a single thumbnail. */
data class ThumbnailData(
data class ThumbnailData(
@@ -63,6 +64,11 @@ data class ThumbnailData(
                    ex,
                    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) {
                if (snapshot.densityDpi > 0 && thumbnail?.density != snapshot.densityDpi) {
                    Log.d(
                    Log.d(
                        TAG,
                        TAG,
@@ -73,6 +79,7 @@ data class ThumbnailData(
                    )
                    )
                    thumbnail?.density = snapshot.densityDpi
                    thumbnail?.density = snapshot.densityDpi
                }
                }
            }
            return thumbnail
            return thumbnail
                ?: Bitmap.createBitmap(snapshot.taskSize.x, snapshot.taskSize.y, ARGB_8888).apply {
                ?: Bitmap.createBitmap(snapshot.taskSize.x, snapshot.taskSize.y, ARGB_8888).apply {
                    eraseColor(Color.BLACK)
                    eraseColor(Color.BLACK)