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

Commit 8788db00 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "InsetsState isn't needed when drawing snapshot with aspect ratio match" into main

parents 15383b12 21caae3b
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -412,8 +412,7 @@ public class SnapshotDrawerUtils {
        final WindowManager.LayoutParams attrs = Flags.drawSnapshotAspectRatioMatch()
                ? info.mainWindowLayoutParams : info.topOpaqueWindowLayoutParams;
        final WindowManager.LayoutParams mainWindowParams = info.mainWindowLayoutParams;
        final InsetsState topWindowInsetsState = info.topOpaqueWindowInsetsState;
        if (attrs == null || mainWindowParams == null || topWindowInsetsState == null) {
        if (attrs == null || mainWindowParams == null) {
            Log.w(TAG, "unable to create taskSnapshot surface ");
            return null;
        }
@@ -456,7 +455,10 @@ public class SnapshotDrawerUtils {
        return layoutParams;
    }

    static Rect getSystemBarInsets(Rect frame, InsetsState state) {
    static Rect getSystemBarInsets(Rect frame, @Nullable InsetsState state) {
        if (state == null) {
            return new Rect();
        }
        return state.calculateInsets(frame, WindowInsets.Type.systemBars(),
                false /* ignoreVisibility */).toRect();
    }