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

Commit c69969fc authored by Catherine Liang's avatar Catherine Liang
Browse files

Fix color options showing default colors (2/3)

Fix color options showing default colors for certain wallpapers.
Computing color info using thumbnail should only be used to get initial
colors while actual colors are being loaded. Actual colors should be
obtained from wallpaper manager.

Bug: 282999514
Test: manually verified, see bug
Change-Id: Ib54e354202108a8d6eb66bdfe485e65ceaef0a55
parent 53fad236
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
package com.android.customization.module;

import android.app.WallpaperManager;
import android.os.Bundle;

import androidx.annotation.Nullable;
@@ -100,6 +101,7 @@ public final class DefaultCustomizationSections implements CustomizationSections
            DisplayUtils displayUtils,
            CustomizationPickerViewModel customizationPickerViewModel,
            WallpaperInteractor wallpaperInteractor,
            WallpaperManager wallpaperManager,
            boolean isTwoPaneAndSmallWidth) {
        List<CustomizationSectionController<?>> sectionControllers = new ArrayList<>();

@@ -118,6 +120,7 @@ public final class DefaultCustomizationSections implements CustomizationSections
                        wallpaperPreviewNavigator,
                        sectionNavigationController,
                        wallpaperInteractor,
                        wallpaperManager,
                        isTwoPaneAndSmallWidth)
                        : new ScreenPreviewSectionController(
                                activity,
@@ -128,6 +131,7 @@ public final class DefaultCustomizationSections implements CustomizationSections
                                displayUtils,
                                wallpaperPreviewNavigator,
                                wallpaperInteractor,
                                wallpaperManager,
                                isTwoPaneAndSmallWidth));

        sectionControllers.add(
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@

package com.android.customization.picker.preview.ui.section

import android.app.WallpaperManager
import android.content.Context
import android.graphics.Rect
import android.os.Bundle
@@ -65,6 +66,7 @@ class PreviewWithClockCarouselSectionController(
    wallpaperPreviewNavigator: WallpaperPreviewNavigator,
    private val navigationController: CustomizationSectionNavigationController,
    wallpaperInteractor: WallpaperInteractor,
    wallpaperManager: WallpaperManager,
    private val isTwoPaneAndSmallWidth: Boolean,
) :
    ScreenPreviewSectionController(
@@ -76,6 +78,7 @@ class PreviewWithClockCarouselSectionController(
        displayUtils,
        wallpaperPreviewNavigator,
        wallpaperInteractor,
        wallpaperManager,
        isTwoPaneAndSmallWidth,
    ) {