Specify the wallpaper blast wrapper is a wallpaper window

SurfaceFlinger scheduler keys off the window type to implement some
refresh rate selection logic. If a layer has window type wallpaper, then
the refresh rate vote is set to min. With Blast, the actual buffer will
arrive in a layer without the window type metadata. Fix this by
setting the metadata on the blast bbq layer as well.

Test: check if wallpaper runs at a lower refresh rate
Fixes: 191222072
Change-Id: I50058cf42fca155630354ea247d12511ebfe37a8
This commit is contained in:
Vishnu Nair
2021-06-28 15:57:01 -07:00
parent 31bb5762d8
commit c59eff487b

View File

@@ -20,6 +20,7 @@ import static android.graphics.Matrix.MSCALE_X;
import static android.graphics.Matrix.MSCALE_Y;
import static android.graphics.Matrix.MSKEW_X;
import static android.graphics.Matrix.MSKEW_Y;
import static android.view.SurfaceControl.METADATA_WINDOW_TYPE;
import static android.view.View.SYSTEM_UI_FLAG_VISIBLE;
import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
@@ -1024,6 +1025,8 @@ public abstract class WallpaperService extends Service {
mBbqSurfaceControl = new SurfaceControl.Builder()
.setName("Wallpaper BBQ wrapper")
.setHidden(false)
// TODO(b/192291754)
.setMetadata(METADATA_WINDOW_TYPE, TYPE_WALLPAPER)
.setBLASTLayer()
.setParent(mSurfaceControl)
.setCallsite("Wallpaper#relayout")