src/core/android/SDL_android.c
changeset 12008 91f9b8f22b17
parent 12007 ecfb6a793c30
child 12012 6de756c9975a
     1.1 --- a/src/core/android/SDL_android.c	Tue Jun 05 12:46:11 2018 -0700
     1.2 +++ b/src/core/android/SDL_android.c	Tue Jun 05 12:46:13 2018 -0700
     1.3 @@ -213,6 +213,7 @@
     1.4  static jmethodID midSetOrientation;
     1.5  static jmethodID midGetContext;
     1.6  static jmethodID midIsAndroidTV;
     1.7 +static jmethodID midIsChromebook;
     1.8  static jmethodID midInputGetInputDeviceIds;
     1.9  static jmethodID midSendMessage;
    1.10  static jmethodID midShowTextInput;
    1.11 @@ -316,6 +317,8 @@
    1.12                                  "getContext","()Landroid/content/Context;");
    1.13      midIsAndroidTV = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    1.14                                  "isAndroidTV","()Z");
    1.15 +    midIsChromebook = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    1.16 +                                "isChromebook", "()Z");
    1.17      midInputGetInputDeviceIds = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    1.18                                  "inputGetInputDeviceIds", "(I)[I");
    1.19      midSendMessage = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    1.20 @@ -349,7 +352,8 @@
    1.21         !midSendMessage || !midShowTextInput || !midIsScreenKeyboardShown ||
    1.22         !midClipboardSetText || !midClipboardGetText || !midClipboardHasText ||
    1.23         !midOpenAPKExpansionInputStream || !midGetManifestEnvironmentVariables || !midGetDisplayDPI ||
    1.24 -       !midCreateCustomCursor || !midSetCustomCursor || !midSetSystemCursor || !midSupportsRelativeMouse || !midSetRelativeMouseEnabled) {
    1.25 +       !midCreateCustomCursor || !midSetCustomCursor || !midSetSystemCursor || !midSupportsRelativeMouse || !midSetRelativeMouseEnabled ||
    1.26 +       !midIsChromebook) {
    1.27          __android_log_print(ANDROID_LOG_WARN, "SDL", "Missing some Java callbacks, do you have the latest version of SDLActivity.java?");
    1.28      }
    1.29  
    1.30 @@ -2024,6 +2028,12 @@
    1.31      return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsAndroidTV);
    1.32  }
    1.33  
    1.34 +SDL_bool SDL_IsChromebook(void)
    1.35 +{
    1.36 +    JNIEnv *env = Android_JNI_GetEnv();
    1.37 +    return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsChromebook);
    1.38 +}
    1.39 +
    1.40  const char * SDL_AndroidGetInternalStoragePath(void)
    1.41  {
    1.42      static char *s_AndroidInternalFilesPath = NULL;