Bug 1117681 - Fix 'AKEYCODE_CTRL_*' is ambiguous when using --android-version=13 or higher. r=snorp
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Fri, 09 Jan 2015 13:23:12 +0900
changeset 222889 02de139764d987a467ed1fecd02f320091f31c02
parent 222888 86924ac6a94a9147bcae518239d7a33b5981062b
child 222890 ee220d48eab7cfb878c9b70e73371c7ba46fd40a
push id10731
push usercbook@mozilla.com
push dateFri, 09 Jan 2015 14:51:37 +0000
treeherderfx-team@e6756043d930 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1117681
milestone37.0a1
Bug 1117681 - Fix 'AKEYCODE_CTRL_*' is ambiguous when using --android-version=13 or higher. r=snorp
widget/android/AndroidJavaWrappers.h
--- a/widget/android/AndroidJavaWrappers.h
+++ b/widget/android/AndroidJavaWrappers.h
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef AndroidJavaWrappers_h__
 #define AndroidJavaWrappers_h__
 
 #include <jni.h>
 #include <android/input.h>
 #include <android/log.h>
+#include <android/api-level.h>
 
 #include "nsGeoPosition.h"
 #include "nsRect.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsIObserver.h"
 #include "nsIAndroidBridge.h"
 #include "mozilla/gfx/Rect.h"
@@ -228,16 +229,17 @@ private:
     static jmethodID jBeginDrawingMethod;
     static jmethodID jDrawBackgroundMethod;
     static jmethodID jDrawForegroundMethod;
     static jmethodID jEndDrawingMethod;
 };
 
 enum {
     // These keycode masks are not defined in android/keycodes.h:
+#if __ANDROID_API__ < 13
     AKEYCODE_ESCAPE             = 111,
     AKEYCODE_FORWARD_DEL        = 112,
     AKEYCODE_CTRL_LEFT          = 113,
     AKEYCODE_CTRL_RIGHT         = 114,
     AKEYCODE_CAPS_LOCK          = 115,
     AKEYCODE_SCROLL_LOCK        = 116,
     AKEYCODE_META_LEFT          = 117,
     AKEYCODE_META_RIGHT         = 118,
@@ -321,32 +323,39 @@ enum {
     AKEYCODE_BUTTON_9           = 196,
     AKEYCODE_BUTTON_10          = 197,
     AKEYCODE_BUTTON_11          = 198,
     AKEYCODE_BUTTON_12          = 199,
     AKEYCODE_BUTTON_13          = 200,
     AKEYCODE_BUTTON_14          = 201,
     AKEYCODE_BUTTON_15          = 202,
     AKEYCODE_BUTTON_16          = 203,
+#endif
+#if __ANDROID_API__ < 14
     AKEYCODE_LANGUAGE_SWITCH    = 204,
     AKEYCODE_MANNER_MODE        = 205,
     AKEYCODE_3D_MODE            = 206,
+#endif
+#if __ANDROID_API__ < 15
     AKEYCODE_CONTACTS           = 207,
     AKEYCODE_CALENDAR           = 208,
     AKEYCODE_MUSIC              = 209,
     AKEYCODE_CALCULATOR         = 210,
+#endif
+#if __ANDROID_API__ < 16
     AKEYCODE_ZENKAKU_HANKAKU    = 211,
     AKEYCODE_EISU               = 212,
     AKEYCODE_MUHENKAN           = 213,
     AKEYCODE_HENKAN             = 214,
     AKEYCODE_KATAKANA_HIRAGANA  = 215,
     AKEYCODE_YEN                = 216,
     AKEYCODE_RO                 = 217,
     AKEYCODE_KANA               = 218,
     AKEYCODE_ASSIST             = 219,
+#endif
 
     AMETA_FUNCTION_ON           = 0x00000008,
     AMETA_CTRL_ON               = 0x00001000,
     AMETA_CTRL_LEFT_ON          = 0x00002000,
     AMETA_CTRL_RIGHT_ON         = 0x00004000,
     AMETA_META_ON               = 0x00010000,
     AMETA_META_LEFT_ON          = 0x00020000,
     AMETA_META_RIGHT_ON         = 0x00040000,