src/core/android/SDL_android.c
changeset 12024 3688283680b1
parent 12012 6de756c9975a
child 12059 320b43d5e5a7
     1.1 --- a/src/core/android/SDL_android.c	Mon Jun 18 13:14:00 2018 -0700
     1.2 +++ b/src/core/android/SDL_android.c	Mon Jun 18 13:14:02 2018 -0700
     1.3 @@ -215,6 +215,7 @@
     1.4  static jmethodID midGetContext;
     1.5  static jmethodID midIsAndroidTV;
     1.6  static jmethodID midIsChromebook;
     1.7 +static jmethodID midIsDeXMode;
     1.8  static jmethodID midInputGetInputDeviceIds;
     1.9  static jmethodID midSendMessage;
    1.10  static jmethodID midShowTextInput;
    1.11 @@ -320,6 +321,8 @@
    1.12                                  "isAndroidTV","()Z");
    1.13      midIsChromebook = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    1.14                                  "isChromebook", "()Z");
    1.15 +    midIsDeXMode = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    1.16 +                                "isDeXMode", "()Z");
    1.17      midInputGetInputDeviceIds = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    1.18                                  "inputGetInputDeviceIds", "(I)[I");
    1.19      midSendMessage = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    1.20 @@ -354,7 +357,7 @@
    1.21         !midClipboardSetText || !midClipboardGetText || !midClipboardHasText ||
    1.22         !midOpenAPKExpansionInputStream || !midGetManifestEnvironmentVariables || !midGetDisplayDPI ||
    1.23         !midCreateCustomCursor || !midSetCustomCursor || !midSetSystemCursor || !midSupportsRelativeMouse || !midSetRelativeMouseEnabled ||
    1.24 -       !midIsChromebook) {
    1.25 +       !midIsChromebook || !midIsDeXMode) {
    1.26          __android_log_print(ANDROID_LOG_WARN, "SDL", "Missing some Java callbacks, do you have the latest version of SDLActivity.java?");
    1.27      }
    1.28  
    1.29 @@ -2036,6 +2039,12 @@
    1.30      return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsChromebook);
    1.31  }
    1.32  
    1.33 +SDL_bool SDL_IsDeXMode(void)
    1.34 +{
    1.35 +    JNIEnv *env = Android_JNI_GetEnv();
    1.36 +    return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsDeXMode);
    1.37 +}
    1.38 +
    1.39  const char * SDL_AndroidGetInternalStoragePath(void)
    1.40  {
    1.41      static char *s_AndroidInternalFilesPath = NULL;