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

Commit 4daae9b0 authored by Steven Ng's avatar Steven Ng Committed by Android (Google) Code Review
Browse files

Merge "Use DesktopExperienceFlags for desktop experience wallpaper gating" into main

parents a3e665f7 2bbf3760
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import static android.Manifest.permission.MANAGE_EXTERNAL_STORAGE;
import static android.Manifest.permission.READ_WALLPAPER_INTERNAL;
import static android.Manifest.permission.SET_WALLPAPER_DIM_AMOUNT;
import static android.app.Flags.FLAG_LIVE_WALLPAPER_CONTENT_HANDLING;
import static android.app.Flags.enableConnectedDisplaysWallpaper;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.os.ParcelFileDescriptor.MODE_READ_ONLY;

@@ -96,6 +95,7 @@ import android.util.Pair;
import android.util.SparseArray;
import android.view.Display;
import android.view.WindowManagerGlobal;
import android.window.DesktopExperienceFlags;

import com.android.internal.R;
import com.android.internal.annotations.Keep;
@@ -884,7 +884,7 @@ public class WallpaperManager {
                }
                try (InputStream is = new ParcelFileDescriptor.AutoCloseInputStream(pfd)) {
                    ImageDecoder.Source src;
                    if (enableConnectedDisplaysWallpaper()) {
                    if (DesktopExperienceFlags.ENABLE_CONNECTED_DISPLAYS_WALLPAPER.isTrue()) {
                        src = ImageDecoder.createSource(context.getResources(), is,
                                /* density= */ 0);
                    } else {
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ public enum DesktopExperienceFlags {
    ENABLE_CONNECTED_DISPLAYS_DND(Flags::enableConnectedDisplaysDnd, true),
    ENABLE_CONNECTED_DISPLAYS_PIP(Flags::enableConnectedDisplaysPip, false),
    ENABLE_CONNECTED_DISPLAYS_WALLPAPER(
            android.app.Flags::enableConnectedDisplaysWallpaper, false),
            android.app.Flags::enableConnectedDisplaysWallpaper, true),
    ENABLE_CONNECTED_DISPLAYS_WINDOW_DRAG(Flags::enableConnectedDisplaysWindowDrag, true),
    ENABLE_DESKTOP_CLOSE_TASK_ANIMATION_IN_DTC_BUGFIX(
            Flags::enableDesktopCloseTaskAnimationInDtcBugfix, false),
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.systemui.wallpapers

import android.app.Flags
import android.content.res.Configuration.UI_MODE_NIGHT_MASK
import android.content.res.Configuration.UI_MODE_NIGHT_YES
import android.graphics.Canvas
@@ -29,6 +28,7 @@ import android.graphics.Shader
import android.service.wallpaper.WallpaperService
import android.util.Log
import android.view.SurfaceHolder
import android.window.DesktopExperienceFlags
import androidx.core.graphics.ColorUtils
import androidx.core.graphics.toRectF
import com.android.systemui.res.R
@@ -37,7 +37,7 @@ import com.android.systemui.res.R
class GradientColorWallpaper : WallpaperService() {

    override fun onCreateEngine(): Engine =
        if (Flags.enableConnectedDisplaysWallpaper()) {
        if (DesktopExperienceFlags.ENABLE_CONNECTED_DISPLAYS_WALLPAPER.isTrue) {
            GradientColorWallpaperEngine()
        } else {
            EmptyWallpaperEngine()
+3 −2
Original line number Diff line number Diff line
@@ -16,12 +16,12 @@

package com.android.server.wm;

import static android.app.Flags.enableConnectedDisplaysWallpaper;
import static android.window.DesktopExperienceFlags.ENABLE_PROJECTED_DISPLAY_DESKTOP_MODE;

import android.annotation.NonNull;
import android.content.Context;
import android.os.SystemProperties;
import android.window.DesktopExperienceFlags;
import android.window.DesktopModeFlags;

import com.android.internal.R;
@@ -106,6 +106,7 @@ public final class DesktopModeHelper {

    /** Returns {@code true} if desktop experience wallpaper is supported on this device. */
    public static boolean isDeviceEligibleForDesktopExperienceWallpaper(@NonNull Context context) {
        return enableConnectedDisplaysWallpaper() && isDeviceEligibleForDesktopMode(context);
        return DesktopExperienceFlags.ENABLE_CONNECTED_DISPLAYS_WALLPAPER.isTrue()
                && isDeviceEligibleForDesktopMode(context);
    }
}