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

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

Merge "Allow creating ASurfaceControl from NativeActivity Surface" into main

parents 5be651f1 34459252
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -835,8 +835,8 @@ public class Surface implements Parcelable {
    @Override
    public String toString() {
        synchronized (mLock) {
            return "Surface(name=" + mName + ")/@0x" +
                    Integer.toHexString(System.identityHashCode(this));
            return "Surface(name=" + mName + " mNativeObject=" + mNativeObject + ")/@0x"
                    + Integer.toHexString(System.identityHashCode(this));
        }
    }

+7 −1
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ import static android.view.WindowManagerGlobal.RELAYOUT_RES_SURFACE_CHANGED;
import static android.view.accessibility.Flags.fixMergedContentChangeEventV2;
import static android.view.accessibility.Flags.forceInvertColor;
import static android.view.accessibility.Flags.reduceWindowContentChangedEventThrottle;
import static android.view.flags.Flags.addSchandleToVriSurface;
import static android.view.flags.Flags.sensitiveContentAppProtection;
import static android.view.flags.Flags.toolkitFrameRateFunctionEnablingReadOnly;
import static android.view.flags.Flags.toolkitFrameRateTypingReadOnly;
@@ -2624,7 +2625,12 @@ public final class ViewRootImpl implements ViewParent,
        mBlastBufferQueue = new BLASTBufferQueue(mTag, mSurfaceControl,
                mSurfaceSize.x, mSurfaceSize.y, mWindowAttributes.format);
        mBlastBufferQueue.setTransactionHangCallback(sTransactionHangCallback);
        Surface blastSurface = mBlastBufferQueue.createSurface();
        Surface blastSurface;
        if (addSchandleToVriSurface()) {
            blastSurface = mBlastBufferQueue.createSurfaceWithHandle();
        } else {
            blastSurface = mBlastBufferQueue.createSurface();
        }
        // Only call transferFrom if the surface has changed to prevent inc the generation ID and
        // causing EGL resources to be recreated.
        mSurface.transferFrom(blastSurface);
+11 −0
Original line number Diff line number Diff line
@@ -59,3 +59,14 @@ flag {
    bug: "333752000"
    is_fixed_read_only: true
}

flag {
    name: "add_schandle_to_vri_surface"
    namespace: "window_surfaces"
    description: "Add surface control handle to VRI Surface"
    bug: "320706287"
    is_fixed_read_only: true
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@ android_test {
    ],
    jni_libs: [
        "libpowermanagertest_jni",
        "libviewRootImplTest_jni",
        "libworksourceparceltest_jni",
    ],

+24 −0
Original line number Diff line number Diff line
@@ -67,3 +67,27 @@ cc_test_library {
    ],
    gtest: false,
}

cc_test_library {
    name: "libviewRootImplTest_jni",
    srcs: [
        "ViewRootImplTestJni.cpp",
    ],
    shared_libs: [
        "libandroid",
        "libandroid_runtime_lazy",
        "libbase",
        "libbinder",
        "liblog",
        "libnativehelper",
        "libpowermanager",
        "libutils",
    ],
    header_libs: ["jni_headers"],
    stl: "libc++_static",
    cflags: [
        "-Werror",
        "-Wall",
    ],
    gtest: false,
}
Loading