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

Commit 11be4ce6 authored by Devin Moore's avatar Devin Moore
Browse files

Remove android.hardware.vr

With the deprecation of Android R FCM, this interface is no longer
supported by Android. So it is being deleted.

Flag: EXEMPT clean up
Test: m
Bug: 409404482

Change-Id: I776d93829f1fb4d51ae17955da7dded218d4b8d8
parent 9d026b14
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",
    ],
}