src/core/android/SDL_android.c
changeset 12152 cb129c06aa86
parent 12150 f958f3c2e006
child 12201 8bdc4d340419
child 12349 a67dedb293c8
     1.1 --- a/src/core/android/SDL_android.c	Fri Aug 24 09:49:48 2018 -0400
     1.2 +++ b/src/core/android/SDL_android.c	Fri Aug 24 10:41:57 2018 -0700
     1.3 @@ -258,6 +258,7 @@
     1.4  static jmethodID midPollInputDevices;
     1.5  static jmethodID midPollHapticDevices;
     1.6  static jmethodID midHapticRun;
     1.7 +static jmethodID midHapticStop;
     1.8  
     1.9  /* static fields */
    1.10  static jfieldID fidSeparateMouseAndTouch;
    1.11 @@ -430,8 +431,10 @@
    1.12                                  "pollHapticDevices", "()V");
    1.13      midHapticRun = (*mEnv)->GetStaticMethodID(mEnv, mControllerManagerClass,
    1.14                                  "hapticRun", "(II)V");
    1.15 +    midHapticStop = (*mEnv)->GetStaticMethodID(mEnv, mControllerManagerClass,
    1.16 +                                "hapticStop", "(I)V");
    1.17  
    1.18 -    if (!midPollInputDevices || !midPollHapticDevices || !midHapticRun) {
    1.19 +    if (!midPollInputDevices || !midPollHapticDevices || !midHapticRun || !midHapticStop) {
    1.20          __android_log_print(ANDROID_LOG_WARN, "SDL", "Missing some Java callbacks, do you have the latest version of SDLControllerManager.java?");
    1.21      }
    1.22  
    1.23 @@ -1892,6 +1895,11 @@
    1.24      (*env)->CallStaticVoidMethod(env, mControllerManagerClass, midHapticRun, device_id, length);
    1.25  }
    1.26  
    1.27 +void Android_JNI_HapticStop(int device_id)
    1.28 +{
    1.29 +    JNIEnv *env = Android_JNI_GetEnv();
    1.30 +    (*env)->CallStaticVoidMethod(env, mControllerManagerClass, midHapticStop, device_id);
    1.31 +}
    1.32  
    1.33  /* See SDLActivity.java for constants. */
    1.34  #define COMMAND_SET_KEEP_SCREEN_ON    5