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

Commit 4818aee9 authored by Vishnu Nair's avatar Vishnu Nair Committed by Android (Google) Code Review
Browse files

Merge "Check if surfacecontrol is valid in getBufferTransformHint" into main

parents f2906c1c d4be328e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -92,6 +92,12 @@ public interface AttachedSurfaceControl {
     * SurfaceView Surface, the buffer producer will already have access to the transform hint and
     * no additional work is needed.
     *
     * If the root surface is not available, the API will return {@code BUFFER_TRANSFORM_IDENTITY}.
     * The caller should register a listener to listen for any changes. @see
     * {@link #addOnBufferTransformHintChangedListener(OnBufferTransformHintChangedListener)}.
     * Warning: Calling this API in Android 14 (API Level 34) or earlier will crash if the root
     * surface is not available.
     *
     * @see HardwareBuffer
     */
    default @SurfaceControl.BufferTransform int getBufferTransformHint() {
+5 −1
Original line number Diff line number Diff line
@@ -11527,7 +11527,11 @@ public final class ViewRootImpl implements ViewParent,

    @Override
    public @SurfaceControl.BufferTransform int getBufferTransformHint() {
        if (mSurfaceControl.isValid()) {
            return mSurfaceControl.getTransformHint();
        } else {
            return SurfaceControl.BUFFER_TRANSFORM_IDENTITY;
        }
    }

    @Override