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

Commit af1d87c3 authored by Todd Lee's avatar Todd Lee Committed by Cherrypicker Worker
Browse files

Add flag to guard wallpaper token transition change

Bug: b/347593088
Flag: com.android.window.flags.ensure_wallpaper_in_transitions
Test: presubmits
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:6cf4a370b32f6d979caacb57375d8c0c434bd4ac)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c4e56f87214b5cb057f9cf5e61503ff838dacead)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1a49bad13a37712be110ad8833509ad32d69d69a)
Merged-In: Idda8e20b4362de965f6256cedff829e4bbd8ffb1
Change-Id: Idda8e20b4362de965f6256cedff829e4bbd8ffb1
parent ece9c0e3
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -130,3 +130,13 @@ flag {
      purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "ensure_wallpaper_in_transitions"
  namespace: "windowing_frontend"
  description: "Ensure that wallpaper window tokens are always present/available for collection in transitions"
  bug: "347593088"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
 No newline at end of file
+3 −1
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ import com.android.internal.util.function.pooled.PooledLambda;
import com.android.server.inputmethod.InputMethodManagerInternal;
import com.android.server.statusbar.StatusBarManagerInternal;
import com.android.server.wm.utils.SurfaceControlUtils;
import com.android.window.flags.Flags;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -2445,7 +2446,8 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {

            final ChangeInfo changeInfo = changes.get(wc);
            // Reject no-ops, unless wallpaper
            if (!changeInfo.hasChanged() && wc.asWallpaperToken() == null) {
            if (!changeInfo.hasChanged()
                    && (!Flags.ensureWallpaperInTransitions() || wc.asWallpaperToken() == null)) {
                ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
                        "  Rejecting as no-op: %s", wc);
                continue;
+12 −2
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.protolog.common.ProtoLog;
import com.android.internal.util.ToBooleanFunction;
import com.android.server.wallpaper.WallpaperCropper.WallpaperCropUtils;
import com.android.window.flags.Flags;

import java.io.PrintWriter;
import java.util.ArrayList;
@@ -753,10 +754,19 @@ class WallpaperController {

    void collectTopWallpapers(Transition transition) {
        if (mFindResults.hasTopShowWhenLockedWallpaper()) {
            if (Flags.ensureWallpaperInTransitions()) {
                transition.collect(mFindResults.mTopWallpaper.mTopShowWhenLockedWallpaper.mToken);
            } else {
                transition.collect(mFindResults.mTopWallpaper.mTopShowWhenLockedWallpaper);
            }

        }
        if (mFindResults.hasTopHideWhenLockedWallpaper()) {
            if (Flags.ensureWallpaperInTransitions()) {
                transition.collect(mFindResults.mTopWallpaper.mTopHideWhenLockedWallpaper.mToken);
            } else {
                transition.collect(mFindResults.mTopWallpaper.mTopHideWhenLockedWallpaper);
            }
        }
    }