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

Commit c43dfdf0 authored by Adrian Roos's avatar Adrian Roos
Browse files

Surface: Fix bad casts

Fixes bad reinterpret_casts to ANativeWindow* where the reinterpreted pointer is
actually a Surface*

Test: make droid
Bug: 72492508
Change-Id: Iadc92e8e82efab26be584f5a1c83c678e4496505
parent 240ad971
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -524,15 +524,15 @@ static jint nativeAttachAndQueueBuffer(JNIEnv *env, jclass clazz, jlong nativeOb
static jint nativeSetSharedBufferModeEnabled(JNIEnv* env, jclass clazz, jlong nativeObject,
        jboolean enabled) {
    Surface* surface = reinterpret_cast<Surface*>(nativeObject);
    return ((ANativeWindow*) nativeObject)->perform(surface,
            NATIVE_WINDOW_SET_SHARED_BUFFER_MODE, enabled);
    ANativeWindow* anw = static_cast<ANativeWindow*>(surface);
    return anw->perform(surface, NATIVE_WINDOW_SET_SHARED_BUFFER_MODE, int(enabled));
}

static jint nativeSetAutoRefreshEnabled(JNIEnv* env, jclass clazz, jlong nativeObject,
        jboolean enabled) {
    Surface* surface = reinterpret_cast<Surface*>(nativeObject);
    return ((ANativeWindow*) nativeObject)->perform(surface,
            NATIVE_WINDOW_SET_AUTO_REFRESH, enabled);
    ANativeWindow* anw = static_cast<ANativeWindow*>(surface);
    return anw->perform(surface, NATIVE_WINDOW_SET_AUTO_REFRESH, int(enabled));
}

namespace uirenderer {