diff --git a/ion/src/simulator/android/src/cpp/haptics_enabled.cpp b/ion/src/simulator/android/src/cpp/haptics_enabled.cpp index ea73fad07..5c1fa0b74 100644 --- a/ion/src/simulator/android/src/cpp/haptics_enabled.cpp +++ b/ion/src/simulator/android/src/cpp/haptics_enabled.cpp @@ -1,6 +1,7 @@ #include "../../../shared/haptics.h" #include #include +#include namespace Ion { namespace Simulator { @@ -10,11 +11,8 @@ bool isEnabled() { JNIEnv * env = static_cast(SDL_AndroidGetJNIEnv()); jobject activity = static_cast(SDL_AndroidGetActivity()); jclass j_class = env->FindClass("com/numworks/calculator/EpsilonActivity"); - // TODO : GetMethodID is relatively costly, and could be performed only once. jmethodID j_methodId = env->GetMethodID(j_class,"hapticFeedbackIsEnabled", "()Z"); - if (j_methodId == 0) { - return false; - } + assert(j_methodId != 0); bool result = (env->CallBooleanMethod(activity, j_methodId) != JNI_FALSE); /* Local references are automatically deleted if a native function called from * Java side returns. For SDL this native function is main() itself. Therefore