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

Commit 6087951a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Dump DepthController internals" into sc-v2-dev

parents 8c8dc564 01c362bb
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -90,6 +90,8 @@ import com.android.systemui.unfold.UnfoldTransitionFactory;
import com.android.systemui.unfold.UnfoldTransitionProgressProvider;
import com.android.systemui.unfold.config.UnfoldTransitionConfig;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.List;
import java.util.stream.Stream;

@@ -619,4 +621,12 @@ public abstract class BaseQuickstepLauncher extends Launcher
            recentsView.finishRecentsAnimation(/* toRecents= */ true, null);
        }
    }

    @Override
    public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
        super.dump(prefix, fd, writer, args);
        if (mDepthController != null) {
            mDepthController.dump(prefix, writer);
        }
    }
}
+23 −2
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@ import com.android.launcher3.states.StateAnimationConfig;
import com.android.systemui.shared.system.BlurUtils;
import com.android.systemui.shared.system.WallpaperManagerCompat;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.function.Consumer;

/**
@@ -137,6 +139,11 @@ public class DepthController implements StateHandler<LauncherState>,
     * @see android.service.wallpaper.WallpaperService.Engine#onZoomChanged(float)
     */
    private float mDepth;
    /**
     * Last blur value, in pixels, that was applied.
     * For debugging purposes.
     */
    private int mCurrentBlur;
    /**
     * If we're launching and app and should not be blurring the screen for performance reasons.
     */
@@ -306,10 +313,10 @@ public class DepthController implements StateHandler<LauncherState>,
        if (supportsBlur) {
            boolean opaque = mLauncher.getScrimView().isFullyOpaque();

            int blur = !mCrossWindowBlursEnabled || mBlurDisabledForAppLaunch
            mCurrentBlur = !mCrossWindowBlursEnabled || mBlurDisabledForAppLaunch
                    ? 0 : (int) (depth * mMaxBlurRadius);
            SurfaceControl.Transaction transaction = new SurfaceControl.Transaction()
                    .setBackgroundBlurRadius(mSurface, blur)
                    .setBackgroundBlurRadius(mSurface, mCurrentBlur)
                    .setOpaque(mSurface, opaque);

            // Set early wake-up flags when we know we're executing an expensive operation, this way
@@ -348,4 +355,18 @@ public class DepthController implements StateHandler<LauncherState>,
        mwAnimation.setAutoCancel(true);
        mwAnimation.start();
    }

    public void dump(String prefix, PrintWriter writer) {
        writer.println(prefix + this.getClass().getSimpleName());
        writer.println(prefix + "\tmMaxBlurRadius=" + mMaxBlurRadius);
        writer.println(prefix + "\tmCrossWindowBlursEnabled=" + mCrossWindowBlursEnabled);
        writer.println(prefix + "\tmSurface=" + mSurface);
        writer.println(prefix + "\tmOverlayScrollProgress=" + mOverlayScrollProgress);
        writer.println(prefix + "\tmDepth=" + mDepth);
        writer.println(prefix + "\tmCurrentBlur=" + mCurrentBlur);
        writer.println(prefix + "\tmBlurDisabledForAppLaunch=" + mBlurDisabledForAppLaunch);
        writer.println(prefix + "\tmInEarlyWakeUp=" + mInEarlyWakeUp);
        writer.println(prefix + "\tmIgnoreStateChangesDuringMultiWindowAnimation="
                + mIgnoreStateChangesDuringMultiWindowAnimation);
    }
}