src/core/android/SDL_android.c
changeset 12137 161f67f4a7c6
parent 12127 f92fd2c57780
child 12150 f958f3c2e006
     1.1 --- a/src/core/android/SDL_android.c	Tue Aug 21 19:42:19 2018 -0700
     1.2 +++ b/src/core/android/SDL_android.c	Tue Aug 21 20:03:54 2018 -0700
     1.3 @@ -213,6 +213,7 @@
     1.4  static jmethodID midSetWindowStyle;
     1.5  static jmethodID midSetOrientation;
     1.6  static jmethodID midGetContext;
     1.7 +static jmethodID midIsTablet;
     1.8  static jmethodID midIsAndroidTV;
     1.9  static jmethodID midIsChromebook;
    1.10  static jmethodID midIsDeXMode;
    1.11 @@ -232,7 +233,6 @@
    1.12  static jmethodID midSetSystemCursor;
    1.13  static jmethodID midSupportsRelativeMouse;
    1.14  static jmethodID midSetRelativeMouseEnabled;
    1.15 -static jmethodID midIsTablet;
    1.16  
    1.17  /* audio manager */
    1.18  static jclass mAudioManagerClass;
    1.19 @@ -319,6 +319,8 @@
    1.20                                  "setOrientation","(IIZLjava/lang/String;)V");
    1.21      midGetContext = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    1.22                                  "getContext","()Landroid/content/Context;");
    1.23 +    midIsTablet = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    1.24 +                                "isTablet", "()Z");
    1.25      midIsAndroidTV = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    1.26                                  "isAndroidTV","()Z");
    1.27      midIsChromebook = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    1.28 @@ -355,15 +357,14 @@
    1.29      midSupportsRelativeMouse = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, "supportsRelativeMouse", "()Z");
    1.30      midSetRelativeMouseEnabled = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, "setRelativeMouseEnabled", "(Z)Z");
    1.31  
    1.32 -    midIsTablet = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, "isTablet", "()Z");
    1.33  
    1.34      if (!midGetNativeSurface ||
    1.35 -       !midSetActivityTitle || !midSetWindowStyle || !midSetOrientation || !midGetContext || !midIsAndroidTV || !midInputGetInputDeviceIds ||
    1.36 +       !midSetActivityTitle || !midSetWindowStyle || !midSetOrientation || !midGetContext || !midIsTablet || !midIsAndroidTV || !midInputGetInputDeviceIds ||
    1.37         !midSendMessage || !midShowTextInput || !midIsScreenKeyboardShown ||
    1.38         !midClipboardSetText || !midClipboardGetText || !midClipboardHasText ||
    1.39         !midOpenAPKExpansionInputStream || !midGetManifestEnvironmentVariables || !midGetDisplayDPI ||
    1.40         !midCreateCustomCursor || !midSetCustomCursor || !midSetSystemCursor || !midSupportsRelativeMouse || !midSetRelativeMouseEnabled ||
    1.41 -       !midIsChromebook || !midIsDeXMode || !midManualBackButton || !midIsTablet) {
    1.42 +       !midIsChromebook || !midIsDeXMode || !midManualBackButton) {
    1.43          __android_log_print(ANDROID_LOG_WARN, "SDL", "Missing some Java callbacks, do you have the latest version of SDLActivity.java?");
    1.44      }
    1.45  
    1.46 @@ -2033,6 +2034,12 @@
    1.47      return (*env)->CallStaticObjectMethod(env, mActivityClass, midGetContext);
    1.48  }
    1.49  
    1.50 +SDL_bool SDL_IsAndroidTablet(void)
    1.51 +{
    1.52 +    JNIEnv *env = Android_JNI_GetEnv();
    1.53 +    return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsTablet);
    1.54 +}
    1.55 +
    1.56  SDL_bool SDL_IsAndroidTV(void)
    1.57  {
    1.58      JNIEnv *env = Android_JNI_GetEnv();
    1.59 @@ -2051,12 +2058,6 @@
    1.60      return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsDeXMode);
    1.61  }
    1.62  
    1.63 -SDL_bool SDL_IsTablet(void)
    1.64 -{
    1.65 -    JNIEnv *env = Android_JNI_GetEnv();
    1.66 -    return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsTablet);
    1.67 -}
    1.68 -
    1.69  void SDL_AndroidBackButton(void)
    1.70  {
    1.71      JNIEnv *env = Android_JNI_GetEnv();