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

Commit cde805e9 authored by Nick Chameyev's avatar Nick Chameyev
Browse files

[Unfold animation] Move unfold animation background under wallpaper

We add a color layer during unfold animation so
when the wallpaper is not visible (e.g. when an app is opened)
we will show our colored background instead of black pixels.

But when the wallpaper is visible the background is shown
on top of the wallpaper which is undesirable.

Removed the parent of the background layer so it is attached
to the root of the surface flinger hiearchy and below the
wallpaper layer.

Bug: 272703608
Test: manually test unfolding, folding when on launcher,
 a fullscreen app and split screen tasks are visible =>
 checked that we show the background when wallpaper is
 not visible and do not show it when wallpaper is visible
Test: attached winscope traces
Change-Id: Ic7f7ad855055b5de87db912a7dbaf3112bcf289c
parent f83766ec
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -634,14 +634,8 @@ public abstract class WMShellModule {

    @WMSingleton
    @Provides
    static UnfoldBackgroundController provideUnfoldBackgroundController(
            RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer,
            Context context
    ) {
        return new UnfoldBackgroundController(
                context,
                rootTaskDisplayAreaOrganizer
        );
    static UnfoldBackgroundController provideUnfoldBackgroundController(Context context) {
        return new UnfoldBackgroundController(context);
    }

    //
+1 −9
Original line number Diff line number Diff line
@@ -19,14 +19,12 @@ package com.android.wm.shell.unfold;
import static android.graphics.Color.blue;
import static android.graphics.Color.green;
import static android.graphics.Color.red;
import static android.view.Display.DEFAULT_DISPLAY;

import android.annotation.NonNull;
import android.content.Context;
import android.view.SurfaceControl;

import com.android.wm.shell.R;
import com.android.wm.shell.RootTaskDisplayAreaOrganizer;

/**
 * Controls background color layer for the unfold animations
@@ -34,15 +32,10 @@ import com.android.wm.shell.RootTaskDisplayAreaOrganizer;
public class UnfoldBackgroundController {

    private static final int BACKGROUND_LAYER_Z_INDEX = -1;

    private final RootTaskDisplayAreaOrganizer mRootTaskDisplayAreaOrganizer;
    private final float[] mBackgroundColor;
    private SurfaceControl mBackgroundLayer;

    public UnfoldBackgroundController(
            @NonNull Context context,
            @NonNull RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer) {
        mRootTaskDisplayAreaOrganizer = rootTaskDisplayAreaOrganizer;
    public UnfoldBackgroundController(@NonNull Context context) {
        mBackgroundColor = getBackgroundColor(context);
    }

@@ -57,7 +50,6 @@ public class UnfoldBackgroundController {
                .setName("app-unfold-background")
                .setCallsite("AppUnfoldTransitionController")
                .setColorLayer();
        mRootTaskDisplayAreaOrganizer.attachToDisplayArea(DEFAULT_DISPLAY, colorLayerBuilder);
        mBackgroundLayer = colorLayerBuilder.build();

        transaction