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

Commit 4f43aed6 authored by Aurélien Pomini's avatar Aurélien Pomini Committed by Android (Google) Code Review
Browse files

Merge "Cleanup offload_color_extraction flag" into main

parents ca69fe5b e1b214db
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -31,9 +31,7 @@ import static android.view.View.SYSTEM_UI_FLAG_VISIBLE;
import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
import static android.view.flags.Flags.disableDrawWakeLock;

import static com.android.window.flags.Flags.FLAG_OFFLOAD_COLOR_EXTRACTION;
import static com.android.window.flags.Flags.alwaysSeqIdLayout;
import static com.android.window.flags.Flags.offloadColorExtraction;

import android.animation.AnimationHandler;
import android.animation.Animator;
@@ -880,7 +878,6 @@ public abstract class WallpaperService extends Service {
         * wallpaper colors based on the new dim, and call {@link #notifyColorsChanged()}.
         * @hide
         */
        @FlaggedApi(FLAG_OFFLOAD_COLOR_EXTRACTION)
        public void onDimAmountChanged(float dimAmount) {
        }

@@ -1120,7 +1117,7 @@ public abstract class WallpaperService extends Service {

            // after the dim changes, allow colors to be immediately recomputed
            mLastColorInvalidation = 0;
            if (offloadColorExtraction()) onDimAmountChanged(mWallpaperDimAmount);
            onDimAmountChanged(mWallpaperDimAmount);
        }

        /**
+0 −10
Original line number Diff line number Diff line
@@ -17,16 +17,6 @@ flag {
  is_exported: true
}

flag {
  name: "offload_color_extraction"
  namespace: "systemui"
  description: "Let ImageWallpaper take care of its wallpaper color extraction, instead of system_server"
  bug: "328791519"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "avoid_rebinding_intentionally_disconnected_wallpaper"
  namespace: "systemui"
+0 −7
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package com.android.systemui.wallpapers;

import static com.android.window.flags.Flags.FLAG_OFFLOAD_COLOR_EXTRACTION;

import static com.google.common.truth.Truth.assertThat;

import static org.mockito.ArgumentMatchers.any;
@@ -35,7 +33,6 @@ import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.RectF;
import android.platform.test.annotations.EnableFlags;
import android.testing.TestableLooper;

import androidx.test.ext.junit.runners.AndroidJUnit4;
@@ -351,7 +348,6 @@ public class WallpaperLocalColorExtractorTest extends SysuiTestCase {
     * Test that after the bitmap changes, the colors are computed only if asked via onComputeColors
     */
    @Test
    @EnableFlags(FLAG_OFFLOAD_COLOR_EXTRACTION)
    public void testRecomputeColors() {
        resetCounters();
        Bitmap bitmap = getMockBitmap(HIGH_BMP_WIDTH, HIGH_BMP_HEIGHT);
@@ -366,7 +362,6 @@ public class WallpaperLocalColorExtractorTest extends SysuiTestCase {
     * Test that after onComputeColors is called, the colors are computed once the bitmap is loaded
     */
    @Test
    @EnableFlags(FLAG_OFFLOAD_COLOR_EXTRACTION)
    public void testRecomputeColorsBeforeBitmapLoaded() {
        resetCounters();
        Bitmap bitmap = getMockBitmap(HIGH_BMP_WIDTH, HIGH_BMP_HEIGHT);
@@ -380,7 +375,6 @@ public class WallpaperLocalColorExtractorTest extends SysuiTestCase {
     * Test that after the dim changes, the colors are computed if the bitmap is already loaded
     */
    @Test
    @EnableFlags(FLAG_OFFLOAD_COLOR_EXTRACTION)
    public void testRecomputeColorsOnDimChanged() {
        resetCounters();
        Bitmap bitmap = getMockBitmap(HIGH_BMP_WIDTH, HIGH_BMP_HEIGHT);
@@ -394,7 +388,6 @@ public class WallpaperLocalColorExtractorTest extends SysuiTestCase {
     * Test that after the dim changes, the colors will be recomputed once the bitmap is loaded
     */
    @Test
    @EnableFlags(FLAG_OFFLOAD_COLOR_EXTRACTION)
    public void testRecomputeColorsOnDimChangedBeforeBitmapLoaded() {
        resetCounters();
        Bitmap bitmap = getMockBitmap(HIGH_BMP_WIDTH, HIGH_BMP_HEIGHT);
+0 −3
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import static android.app.WallpaperManager.FLAG_SYSTEM;
import static android.app.WallpaperManager.SetWallpaperFlags;

import static com.android.window.flags.Flags.multiCrop;
import static com.android.window.flags.Flags.offloadColorExtraction;

import android.annotation.Nullable;
import android.app.WallpaperColors;
@@ -456,7 +455,6 @@ public class ImageWallpaper extends WallpaperService {

        @Override
        public @Nullable WallpaperColors onComputeColors() {
            if (!offloadColorExtraction()) return null;
            return mWallpaperLocalColorExtractor.onComputeColors();
        }

@@ -498,7 +496,6 @@ public class ImageWallpaper extends WallpaperService {

        @Override
        public void onDimAmountChanged(float dimAmount) {
            if (!offloadColorExtraction()) return;
            mWallpaperLocalColorExtractor.onDimAmountChanged(dimAmount);
        }

+1 −3
Original line number Diff line number Diff line
@@ -17,8 +17,6 @@

package com.android.systemui.wallpapers;

import static com.android.window.flags.Flags.offloadColorExtraction;

import android.app.WallpaperColors;
import android.graphics.Bitmap;
import android.graphics.Rect;
@@ -180,7 +178,7 @@ public class WallpaperLocalColorExtractor {
            mBitmapHeight = bitmap.getHeight();
            mMiniBitmap = createMiniBitmap(bitmap);
            mWallpaperLocalColorExtractorCallback.onMiniBitmapUpdated();
            if (offloadColorExtraction() && mRecomputeColors) recomputeColorsInternal();
            if (mRecomputeColors) recomputeColorsInternal();
            recomputeLocalColors();
        }
    }
Loading