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

Commit d1787737 authored by Devin Moore's avatar Devin Moore Committed by Android (Google) Code Review
Browse files

Merge "Remove android.hardware.vr" into main

parents f8173b9e 11be4ce6
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -192,7 +192,6 @@ cc_defaults {
        "android.hardware.tv.input@1.0",
        "android.hardware.tv.input-V3-ndk",
        "android.hardware.vibrator-V3-ndk",
        "android.hardware.vr@1.0",
        "android.hidl.token@1.0-utils",
        "android.frameworks.schedulerservice@1.0",
        "android.frameworks.sensorservice@1.0",
+4 −27
Original line number Diff line number Diff line
@@ -19,44 +19,21 @@
#include <android_runtime/AndroidRuntime.h>
#include <jni.h>
#include <nativehelper/JNIHelp.h>

#include <android/hardware/vr/1.0/IVr.h>
#include <utils/Errors.h>
#include <utils/Log.h>

namespace android {

using ::android::hardware::vr::V1_0::IVr;

static sp<IVr> gVr;

static void init_native(JNIEnv* /* env */, jclass /* clazz */) {
    // TODO(b/31632518)
    if (gVr != nullptr) {
        // This call path should never be hit.
        ALOGE("%s: May not initialize IVr interface module more than once!", __FUNCTION__);
        return;
    }

    gVr = IVr::getService();
    if (gVr == nullptr) {
        ALOGW("%s: Could not open IVr interface", __FUNCTION__);
    ALOGW("%s: Could not open IVr interface as it no longer supported", __FUNCTION__);
    return;
}

    gVr->init();
}

static void setVrMode_native(JNIEnv* /* env */, jclass /* clazz */, jboolean enabled) {
    if (gVr == nullptr) {
        // There is no VR hardware module implemented, do nothing.
    ALOGW("%s: Could not use IVr interface as it no longer supported", __FUNCTION__);
    return;
}

    // Call set_vr_mode method, this must be implemented if the HAL exists.
    gVr->setVrMode(static_cast<bool>(enabled));
}

static const JNINativeMethod method_table[] = {
    { "initializeNative", "()V", (void*)init_native },
    { "setVrModeNative", "(Z)V", (void*)setVrMode_native },
+0 −1
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ cc_library_shared {
        "android.hardware.graphics.common@1.2",
        "android.hardware.graphics.mapper@4.0",
        "android.hardware.ir@1.0",
        "android.hardware.vr@1.0",
        "android.hidl.token@1.0-utils",
    ],
}
+0 −1
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ cc_library_shared {
        "android.hardware.graphics.common@1.2",
        "android.hardware.graphics.mapper@4.0",
        "android.hardware.ir@1.0",
        "android.hardware.vr@1.0",
        "android.hidl.token@1.0-utils",
    ],
}