Bug 1499182 - Make Android role class names enums. r=jchen,Jamie
authorEitan Isaacson <eitan@monotonous.org>
Wed, 17 Oct 2018 20:43:49 +0000
changeset 500299 222a23f1044ac44b3c2defb9b816bb80b90fd0b6
parent 500298 c9da89f17cf9426dbfad7af2940ebc9f05225c3a
child 500300 ca4774548edb6ce092a600e246865e6111cee3d5
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjchen, Jamie
bugs1499182
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1499182 - Make Android role class names enums. r=jchen,Jamie Differential Revision: https://phabricator.services.mozilla.com/D8764
accessible/android/AccessibleWrap.cpp
accessible/android/AccessibleWrap.h
accessible/base/RoleMap.h
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
--- a/accessible/android/AccessibleWrap.cpp
+++ b/accessible/android/AccessibleWrap.cpp
@@ -223,26 +223,28 @@ AccessibleWrap::CreateBundle(int32_t aPa
   GECKOBUNDLE_START(nodeInfo);
   GECKOBUNDLE_PUT(nodeInfo, "id", java::sdk::Integer::ValueOf(VirtualViewID()));
   GECKOBUNDLE_PUT(nodeInfo, "parentId", java::sdk::Integer::ValueOf(aParentID));
   uint64_t flags = GetFlags(aRole, aState);
   GECKOBUNDLE_PUT(nodeInfo, "flags", java::sdk::Integer::ValueOf(flags));
 
   nsAutoString geckoRole;
   nsAutoString roleDescription;
-  nsAutoString className;
-  GetAndroidRoleAndClass(aRole, geckoRole, roleDescription, className);
+  int32_t androidClass = java::SessionAccessibility::CLASSNAME_VIEW;
   if (VirtualViewID() == kNoID) {
-    className.AssignLiteral("android.webkit.WebView");
-    roleDescription.AssignLiteral("");
+    androidClass = java::SessionAccessibility::CLASSNAME_WEBVIEW;
+  } else {
+    GetRoleDescription(aRole, geckoRole, roleDescription);
+    androidClass = GetAndroidClass(aRole);
   }
+
   GECKOBUNDLE_PUT(
     nodeInfo, "roleDescription", jni::StringParam(roleDescription));
   GECKOBUNDLE_PUT(nodeInfo, "geckoRole", jni::StringParam(geckoRole));
-  GECKOBUNDLE_PUT(nodeInfo, "className", jni::StringParam(className));
+  GECKOBUNDLE_PUT(nodeInfo, "className", java::sdk::Integer::ValueOf(androidClass));
 
   if (!aTextValue.IsEmpty() &&
       (flags & java::SessionAccessibility::FLAG_EDITABLE)) {
     GECKOBUNDLE_PUT(nodeInfo, "hint", jni::StringParam(aName));
     GECKOBUNDLE_PUT(nodeInfo, "text", jni::StringParam(aTextValue));
   } else {
     GECKOBUNDLE_PUT(nodeInfo, "text", jni::StringParam(aName));
   }
@@ -405,20 +407,19 @@ AccessibleWrap::GetFlags(role aRole, uin
   if (aRole == roles::PASSWORD_TEXT) {
     flags |= java::SessionAccessibility::FLAG_PASSWORD;
   }
 
   return flags;
 }
 
 void
-AccessibleWrap::GetAndroidRoleAndClass(role aRole,
-                                       nsAString& aGeckoRole,
-                                       nsAString& aRoleDescription,
-                                       nsAString& aClassStr)
+AccessibleWrap::GetRoleDescription(role aRole,
+                                   nsAString& aGeckoRole,
+                                   nsAString& aRoleDescription)
 {
   nsresult rv = NS_OK;
 
   nsCOMPtr<nsIStringBundleService> sbs =
     do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
   if (NS_FAILED(rv)) {
     NS_WARNING("Failed to get string bundle service");
     return;
@@ -426,39 +427,41 @@ AccessibleWrap::GetAndroidRoleAndClass(r
 
   nsCOMPtr<nsIStringBundle> bundle;
   rv = sbs->CreateBundle(ROLE_STRINGS_URL, getter_AddRefs(bundle));
   if (NS_FAILED(rv)) {
     NS_WARNING("Failed to get string bundle");
     return;
   }
 
+  GetAccService()->GetStringRole(aRole, aGeckoRole);
+  rv = bundle->GetStringFromName(NS_ConvertUTF16toUTF8(aGeckoRole).get(), aRoleDescription);
+  if (NS_FAILED(rv)) {
+    aRoleDescription.AssignLiteral("");
+  }
+}
+
+int32_t
+AccessibleWrap::GetAndroidClass(role aRole)
+{
 #define ROLE(geckoRole,                                                        \
              stringRole,                                                       \
              atkRole,                                                          \
              macRole,                                                          \
              msaaRole,                                                         \
              ia2Role,                                                          \
              androidClass,                                                     \
              nameRule)                                                         \
   case roles::geckoRole:                                                       \
-    rv = bundle->GetStringFromName(stringRole, aRoleDescription);              \
-    if (NS_FAILED(rv))                                                         \
-      aRoleDescription.AssignLiteral("");                                      \
-    aGeckoRole.AssignLiteral(stringRole);                                      \
-    aClassStr.AssignLiteral(androidClass);                                     \
-    break;
+    return androidClass;
 
   switch (aRole) {
 #include "RoleMap.h"
     default:
-      aRoleDescription.AssignLiteral("");
-      aGeckoRole.AssignLiteral("nothing");
-      aClassStr.AssignLiteral("android.view.View");
-      return;
+      return java::SessionAccessibility::CLASSNAME_VIEW;
   }
 
 #undef ROLE
 }
 
 void
 AccessibleWrap::DOMNodeID(nsString& aDOMNodeID)
 {
--- a/accessible/android/AccessibleWrap.h
+++ b/accessible/android/AccessibleWrap.h
@@ -50,25 +50,26 @@ protected:
     double aStep,
     nsIPersistentProperties* aAttributes,
     const nsTArray<int32_t>& aChildren) const;
 
   // IDs should be a positive 32bit integer.
   static int32_t AcquireID();
   static void ReleaseID(int32_t aID);
 
+  static int32_t GetAndroidClass(role aRole);
+
   int32_t mID;
 
 private:
   void DOMNodeID(nsString& aDOMNodeID);
 
-  static void GetAndroidRoleAndClass(role aRole,
-                                     nsAString& aGeckoRole,
-                                     nsAString& aRoleDescription,
-                                     nsAString& aClassStr);
+  static void GetRoleDescription(role aRole,
+                                 nsAString& aGeckoRole,
+                                 nsAString& aRoleDescription);
 
   static uint64_t GetFlags(role aRole, uint64_t aState);
 };
 
 static inline AccessibleWrap*
 WrapperFor(const ProxyAccessible* aProxy)
 {
   return reinterpret_cast<AccessibleWrap*>(aProxy->GetWrapper());
--- a/accessible/base/RoleMap.h
+++ b/accessible/base/RoleMap.h
@@ -8,152 +8,152 @@
  */
 
 ROLE(NOTHING,
      "nothing",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityUnknownRole,
      USE_ROLE_STRING,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeIfReqRule)
 
 ROLE(TITLEBAR,
      "titlebar",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityUnknownRole,  //Irrelevant on OS X; windows are always native.
      ROLE_SYSTEM_TITLEBAR,
      ROLE_SYSTEM_TITLEBAR,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MENUBAR,
      "menubar",
      ATK_ROLE_MENU_BAR,
      NSAccessibilityMenuBarRole,  //Irrelevant on OS X; the menubar will always be native and on the top of the screen.
      ROLE_SYSTEM_MENUBAR,
      ROLE_SYSTEM_MENUBAR,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(SCROLLBAR,
      "scrollbar",
      ATK_ROLE_SCROLL_BAR,
      NSAccessibilityScrollBarRole,  //We might need to make this its own mozAccessible, to support the children objects (valueindicator, down/up buttons).
      ROLE_SYSTEM_SCROLLBAR,
      ROLE_SYSTEM_SCROLLBAR,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromValueRule)
 
 ROLE(GRIP,
      "grip",
      ATK_ROLE_UNKNOWN,
      NSAccessibilitySplitterRole,
      ROLE_SYSTEM_GRIP,
      ROLE_SYSTEM_GRIP,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(SOUND,
      "sound",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityUnknownRole,  //Unused on OS X.
      ROLE_SYSTEM_SOUND,
      ROLE_SYSTEM_SOUND,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(CURSOR,
      "cursor",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityUnknownRole,  //Unused on OS X.
      ROLE_SYSTEM_CURSOR,
      ROLE_SYSTEM_CURSOR,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(CARET,
      "caret",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityUnknownRole,  //Unused on OS X.
      ROLE_SYSTEM_CARET,
      ROLE_SYSTEM_CARET,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(ALERT,
      "alert",
      ATK_ROLE_ALERT,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_ALERT,
      ROLE_SYSTEM_ALERT,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(WINDOW,
      "window",
      ATK_ROLE_WINDOW,
      NSAccessibilityWindowRole,  //Irrelevant on OS X; all window a11y is handled by the system.
      ROLE_SYSTEM_WINDOW,
      ROLE_SYSTEM_WINDOW,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(INTERNAL_FRAME,
      "internal frame",
      ATK_ROLE_INTERNAL_FRAME,
      NSAccessibilityScrollAreaRole,
      USE_ROLE_STRING,
      IA2_ROLE_INTERNAL_FRAME,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MENUPOPUP,
      "menupopup",
      ATK_ROLE_MENU,
      NSAccessibilityMenuRole,  //The parent of menuitems.
      ROLE_SYSTEM_MENUPOPUP,
      ROLE_SYSTEM_MENUPOPUP,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MENUITEM,
      "menuitem",
      ATK_ROLE_MENU_ITEM,
      NSAccessibilityMenuItemRole,
      ROLE_SYSTEM_MENUITEM,
      ROLE_SYSTEM_MENUITEM,
-     "android.view.MenuItem",
+     java::SessionAccessibility::CLASSNAME_MENUITEM,
      eNameFromSubtreeRule)
 
 ROLE(TOOLTIP,
      "tooltip",
      ATK_ROLE_TOOL_TIP,
      @"AXHelpTag",  //10.4+ only, so we re-define the constant.
      ROLE_SYSTEM_TOOLTIP,
      ROLE_SYSTEM_TOOLTIP,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(APPLICATION,
      "application",
      ATK_ROLE_EMBEDDED,
      NSAccessibilityGroupRole,  //Unused on OS X. the system will take care of this.
      ROLE_SYSTEM_APPLICATION,
      ROLE_SYSTEM_APPLICATION,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(DOCUMENT,
      "document",
      ATK_ROLE_DOCUMENT_WEB,
      @"AXWebArea",
      ROLE_SYSTEM_DOCUMENT,
      ROLE_SYSTEM_DOCUMENT,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 /**
  *  msaa comment:
  *   We used to map to ROLE_SYSTEM_PANE, but JAWS would
  *   not read the accessible name for the contaning pane.
  *   However, JAWS will read the accessible name for a groupbox.
  *   By mapping a PANE to a GROUPING, we get no undesirable effects,
@@ -161,1462 +161,1462 @@ ROLE(DOCUMENT,
  *   when an inner control gets focused.
  */
 ROLE(PANE,
      "pane",
      ATK_ROLE_PANEL,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_GROUPING,
      ROLE_SYSTEM_GROUPING,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(CHART,
      "chart",
      ATK_ROLE_CHART,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_CHART,
      ROLE_SYSTEM_CHART,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(DIALOG,
      "dialog",
      ATK_ROLE_DIALOG,
      NSAccessibilityWindowRole,  //There's a dialog subrole.
      ROLE_SYSTEM_DIALOG,
      ROLE_SYSTEM_DIALOG,
-     "android.app.Dialog",
+     java::SessionAccessibility::CLASSNAME_DIALOG,
      eNoNameRule)
 
 ROLE(BORDER,
      "border",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityUnknownRole,  //Unused on OS X.
      ROLE_SYSTEM_BORDER,
      ROLE_SYSTEM_BORDER,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(GROUPING,
      "grouping",
      ATK_ROLE_PANEL,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_GROUPING,
      ROLE_SYSTEM_GROUPING,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(SEPARATOR,
      "separator",
      ATK_ROLE_SEPARATOR,
      NSAccessibilitySplitterRole,
      ROLE_SYSTEM_SEPARATOR,
      ROLE_SYSTEM_SEPARATOR,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(TOOLBAR,
      "toolbar",
      ATK_ROLE_TOOL_BAR,
      NSAccessibilityToolbarRole,
      ROLE_SYSTEM_TOOLBAR,
      ROLE_SYSTEM_TOOLBAR,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(STATUSBAR,
      "statusbar",
      ATK_ROLE_STATUSBAR,
      NSAccessibilityUnknownRole,  //Doesn't exist on OS X (a status bar is its parts; a progressbar, a label, etc.)
      ROLE_SYSTEM_STATUSBAR,
      ROLE_SYSTEM_STATUSBAR,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(TABLE,
      "table",
      ATK_ROLE_TABLE,
      NSAccessibilityTableRole,
      ROLE_SYSTEM_TABLE,
      ROLE_SYSTEM_TABLE,
-     "android.widget.GridView",
+     java::SessionAccessibility::CLASSNAME_GRIDVIEW,
      eNameFromSubtreeIfReqRule)
 
 ROLE(COLUMNHEADER,
      "columnheader",
      ATK_ROLE_COLUMN_HEADER,
      NSAccessibilityCellRole,
      ROLE_SYSTEM_COLUMNHEADER,
      ROLE_SYSTEM_COLUMNHEADER,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(ROWHEADER,
      "rowheader",
      ATK_ROLE_ROW_HEADER,
      NSAccessibilityCellRole,
      ROLE_SYSTEM_ROWHEADER,
      ROLE_SYSTEM_ROWHEADER,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(COLUMN,
      "column",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityColumnRole,
      ROLE_SYSTEM_COLUMN,
      ROLE_SYSTEM_COLUMN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(ROW,
      "row",
      ATK_ROLE_TABLE_ROW,
      NSAccessibilityRowRole,
      ROLE_SYSTEM_ROW,
      ROLE_SYSTEM_ROW,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(CELL,
      "cell",
      ATK_ROLE_TABLE_CELL,
      NSAccessibilityCellRole,
      ROLE_SYSTEM_CELL,
      ROLE_SYSTEM_CELL,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeIfReqRule)
 
 ROLE(LINK,
      "link",
      ATK_ROLE_LINK,
      @"AXLink",  //10.4+ the attr first define in SDK 10.4, so we define it here too. ROLE_LINK
      ROLE_SYSTEM_LINK,
      ROLE_SYSTEM_LINK,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(HELPBALLOON,
      "helpballoon",
      ATK_ROLE_UNKNOWN,
      @"AXHelpTag",
      ROLE_SYSTEM_HELPBALLOON,
      ROLE_SYSTEM_HELPBALLOON,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(CHARACTER,
      "character",
      ATK_ROLE_IMAGE,
      NSAccessibilityUnknownRole,  //Unused on OS X.
      ROLE_SYSTEM_CHARACTER,
      ROLE_SYSTEM_CHARACTER,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(LIST,
      "list",
      ATK_ROLE_LIST,
      NSAccessibilityListRole,
      ROLE_SYSTEM_LIST,
      ROLE_SYSTEM_LIST,
-     "android.widget.ListView",
+     java::SessionAccessibility::CLASSNAME_LISTVIEW,
      eNameFromSubtreeIfReqRule)
 
 ROLE(LISTITEM,
      "listitem",
      ATK_ROLE_LIST_ITEM,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_LISTITEM,
      ROLE_SYSTEM_LISTITEM,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(OUTLINE,
      "outline",
      ATK_ROLE_TREE,
      NSAccessibilityOutlineRole,
      ROLE_SYSTEM_OUTLINE,
      ROLE_SYSTEM_OUTLINE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(OUTLINEITEM,
      "outlineitem",
      ATK_ROLE_TREE_ITEM,
      NSAccessibilityRowRole,
      ROLE_SYSTEM_OUTLINEITEM,
      ROLE_SYSTEM_OUTLINEITEM,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(PAGETAB,
      "pagetab",
      ATK_ROLE_PAGE_TAB,
      NSAccessibilityRadioButtonRole,
      ROLE_SYSTEM_PAGETAB,
      ROLE_SYSTEM_PAGETAB,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(PROPERTYPAGE,
      "propertypage",
      ATK_ROLE_SCROLL_PANE,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_PROPERTYPAGE,
      ROLE_SYSTEM_PROPERTYPAGE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(INDICATOR,
      "indicator",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_INDICATOR,
      ROLE_SYSTEM_INDICATOR,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(GRAPHIC,
      "graphic",
      ATK_ROLE_IMAGE,
      NSAccessibilityImageRole,
      ROLE_SYSTEM_GRAPHIC,
      ROLE_SYSTEM_GRAPHIC,
-     "android.widget.Image",
+     java::SessionAccessibility::CLASSNAME_IMAGE,
      eNoNameRule)
 
 ROLE(STATICTEXT,
      "statictext",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityStaticTextRole,
      ROLE_SYSTEM_STATICTEXT,
      ROLE_SYSTEM_STATICTEXT,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(TEXT_LEAF,
      "text leaf",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityStaticTextRole,
      ROLE_SYSTEM_TEXT,
      ROLE_SYSTEM_TEXT,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(PUSHBUTTON,
      "pushbutton",
      ATK_ROLE_PUSH_BUTTON,
      NSAccessibilityButtonRole,
      ROLE_SYSTEM_PUSHBUTTON,
      ROLE_SYSTEM_PUSHBUTTON,
-     "android.widget.Button",
+     java::SessionAccessibility::CLASSNAME_BUTTON,
      eNameFromSubtreeRule)
 
 ROLE(CHECKBUTTON,
      "checkbutton",
      ATK_ROLE_CHECK_BOX,
      NSAccessibilityCheckBoxRole,
      ROLE_SYSTEM_CHECKBUTTON,
      ROLE_SYSTEM_CHECKBUTTON,
-     "android.widget.CheckBox",
+     java::SessionAccessibility::CLASSNAME_CHECKBOX,
      eNameFromSubtreeRule)
 
 ROLE(RADIOBUTTON,
      "radiobutton",
      ATK_ROLE_RADIO_BUTTON,
      NSAccessibilityRadioButtonRole,
      ROLE_SYSTEM_RADIOBUTTON,
      ROLE_SYSTEM_RADIOBUTTON,
-     "android.widget.RadioButton",
+     java::SessionAccessibility::CLASSNAME_RADIOBUTTON,
      eNameFromSubtreeRule)
 
 // Equivalent of HTML select element with size="1". See also EDITCOMBOBOX.
 ROLE(COMBOBOX,
      "combobox",
      ATK_ROLE_COMBO_BOX,
      NSAccessibilityPopUpButtonRole,
      ROLE_SYSTEM_COMBOBOX,
      ROLE_SYSTEM_COMBOBOX,
-     "android.widget.Spinner",
+     java::SessionAccessibility::CLASSNAME_SPINNER,
      eNameFromValueRule)
 
 ROLE(DROPLIST,
      "droplist",
      ATK_ROLE_COMBO_BOX,
      NSAccessibilityPopUpButtonRole,
      ROLE_SYSTEM_DROPLIST,
      ROLE_SYSTEM_DROPLIST,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(PROGRESSBAR,
      "progressbar",
      ATK_ROLE_PROGRESS_BAR,
      NSAccessibilityProgressIndicatorRole,
      ROLE_SYSTEM_PROGRESSBAR,
      ROLE_SYSTEM_PROGRESSBAR,
-     "android.widget.ProgressBar",
+     java::SessionAccessibility::CLASSNAME_PROGRESSBAR,
      eNameFromValueRule)
 
 ROLE(DIAL,
      "dial",
      ATK_ROLE_DIAL,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_DIAL,
      ROLE_SYSTEM_DIAL,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(HOTKEYFIELD,
      "hotkeyfield",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_HOTKEYFIELD,
      ROLE_SYSTEM_HOTKEYFIELD,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(SLIDER,
      "slider",
      ATK_ROLE_SLIDER,
      NSAccessibilitySliderRole,
      ROLE_SYSTEM_SLIDER,
      ROLE_SYSTEM_SLIDER,
-     "android.widget.SeekBar",
+     java::SessionAccessibility::CLASSNAME_SEEKBAR,
      eNameFromValueRule)
 
 ROLE(SPINBUTTON,
      "spinbutton",
      ATK_ROLE_SPIN_BUTTON,
      NSAccessibilityIncrementorRole,  //Subroles: Increment/Decrement.
      ROLE_SYSTEM_SPINBUTTON,
      ROLE_SYSTEM_SPINBUTTON,
-     "android.view.View", // A composite widget
+     java::SessionAccessibility::CLASSNAME_VIEW, // A composite widget
      eNameFromValueRule)
 
 ROLE(DIAGRAM,
      "diagram",
      ATK_ROLE_IMAGE,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_DIAGRAM,
      ROLE_SYSTEM_DIAGRAM,
-     "android.widget.Image",
+     java::SessionAccessibility::CLASSNAME_IMAGE,
      eNoNameRule)
 
 ROLE(ANIMATION,
      "animation",
      ATK_ROLE_ANIMATION,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_ANIMATION,
      ROLE_SYSTEM_ANIMATION,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(EQUATION,
      "equation",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_EQUATION,
      ROLE_SYSTEM_EQUATION,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(BUTTONDROPDOWN,
      "buttondropdown",
      ATK_ROLE_PUSH_BUTTON,
      NSAccessibilityPopUpButtonRole,
      ROLE_SYSTEM_BUTTONDROPDOWN,
      ROLE_SYSTEM_BUTTONDROPDOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(BUTTONMENU,
      "buttonmenu",
      ATK_ROLE_PUSH_BUTTON,
      NSAccessibilityMenuButtonRole,
      ROLE_SYSTEM_BUTTONMENU,
      ROLE_SYSTEM_BUTTONMENU,
-     "android.widget.Spinner",
+     java::SessionAccessibility::CLASSNAME_SPINNER,
      eNameFromSubtreeRule)
 
 ROLE(BUTTONDROPDOWNGRID,
      "buttondropdowngrid",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_BUTTONDROPDOWNGRID,
      ROLE_SYSTEM_BUTTONDROPDOWNGRID,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(WHITESPACE,
      "whitespace",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_WHITESPACE,
      ROLE_SYSTEM_WHITESPACE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(PAGETABLIST,
      "pagetablist",
      ATK_ROLE_PAGE_TAB_LIST,
      NSAccessibilityTabGroupRole,
      ROLE_SYSTEM_PAGETABLIST,
      ROLE_SYSTEM_PAGETABLIST,
-     "android.widget.TabWidget",
+     java::SessionAccessibility::CLASSNAME_TABWIDGET,
      eNoNameRule)
 
 ROLE(CLOCK,
      "clock",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityUnknownRole,  //Unused on OS X
      ROLE_SYSTEM_CLOCK,
      ROLE_SYSTEM_CLOCK,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(SPLITBUTTON,
      "splitbutton",
      ATK_ROLE_PUSH_BUTTON,
      NSAccessibilityButtonRole,
      ROLE_SYSTEM_SPLITBUTTON,
      ROLE_SYSTEM_SPLITBUTTON,
-     "android.widget.Button",
+     java::SessionAccessibility::CLASSNAME_BUTTON,
      eNoNameRule)
 
 ROLE(IPADDRESS,
      "ipaddress",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_IPADDRESS,
      ROLE_SYSTEM_IPADDRESS,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(ACCEL_LABEL,
      "accel label",
      ATK_ROLE_ACCEL_LABEL,
      NSAccessibilityStaticTextRole,
      ROLE_SYSTEM_STATICTEXT,
      ROLE_SYSTEM_STATICTEXT,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(ARROW,
      "arrow",
      ATK_ROLE_ARROW,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_INDICATOR,
      ROLE_SYSTEM_INDICATOR,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(CANVAS,
      "canvas",
      ATK_ROLE_CANVAS,
      NSAccessibilityImageRole,
      USE_ROLE_STRING,
      IA2_ROLE_CANVAS,
-     "android.widget.Image",
+     java::SessionAccessibility::CLASSNAME_IMAGE,
      eNoNameRule)
 
 ROLE(CHECK_MENU_ITEM,
      "check menu item",
      ATK_ROLE_CHECK_MENU_ITEM,
      NSAccessibilityMenuItemRole,
      ROLE_SYSTEM_MENUITEM,
      IA2_ROLE_CHECK_MENU_ITEM,
-     "android.view.MenuItem",
+     java::SessionAccessibility::CLASSNAME_MENUITEM,
      eNameFromSubtreeRule)
 
 ROLE(COLOR_CHOOSER,
      "color chooser",
      ATK_ROLE_COLOR_CHOOSER,
      NSAccessibilityColorWellRole,
      ROLE_SYSTEM_DIALOG,
      IA2_ROLE_COLOR_CHOOSER,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(DATE_EDITOR,
      "date editor",
      ATK_ROLE_DATE_EDITOR,
      NSAccessibilityUnknownRole,
      USE_ROLE_STRING,
      IA2_ROLE_DATE_EDITOR,
-     "android.widget.Spinner",
+     java::SessionAccessibility::CLASSNAME_SPINNER,
      eNoNameRule)
 
 ROLE(DESKTOP_ICON,
      "desktop icon",
      ATK_ROLE_DESKTOP_ICON,
      NSAccessibilityImageRole,
      USE_ROLE_STRING,
      IA2_ROLE_DESKTOP_ICON,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(DESKTOP_FRAME,
      "desktop frame",
      ATK_ROLE_DESKTOP_FRAME,
      NSAccessibilityUnknownRole,
      USE_ROLE_STRING,
      IA2_ROLE_DESKTOP_PANE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(DIRECTORY_PANE,
      "directory pane",
      ATK_ROLE_DIRECTORY_PANE,
      NSAccessibilityBrowserRole,
      USE_ROLE_STRING,
      IA2_ROLE_DIRECTORY_PANE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(FILE_CHOOSER,
      "file chooser",
      ATK_ROLE_FILE_CHOOSER,
      NSAccessibilityUnknownRole,  //Unused on OS X
      USE_ROLE_STRING,
      IA2_ROLE_FILE_CHOOSER,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(FONT_CHOOSER,
      "font chooser",
      ATK_ROLE_FONT_CHOOSER,
      NSAccessibilityUnknownRole,
      USE_ROLE_STRING,
      IA2_ROLE_FONT_CHOOSER,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(CHROME_WINDOW,
      "chrome window",
      ATK_ROLE_FRAME,
      NSAccessibilityGroupRole,  //Contains the main Firefox UI
      ROLE_SYSTEM_APPLICATION,
      IA2_ROLE_FRAME,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(GLASS_PANE,
      "glass pane",
      ATK_ROLE_GLASS_PANE,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_GLASS_PANE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(HTML_CONTAINER,
      "html container",
      ATK_ROLE_HTML_CONTAINER,
      NSAccessibilityUnknownRole,
      USE_ROLE_STRING,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeIfReqRule)
 
 ROLE(ICON,
      "icon",
      ATK_ROLE_ICON,
      NSAccessibilityImageRole,
      ROLE_SYSTEM_PUSHBUTTON,
      IA2_ROLE_ICON,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(LABEL,
      "label",
      ATK_ROLE_LABEL,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_STATICTEXT,
      IA2_ROLE_LABEL,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(LAYERED_PANE,
      "layered pane",
      ATK_ROLE_LAYERED_PANE,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_LAYERED_PANE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(OPTION_PANE,
      "option pane",
      ATK_ROLE_OPTION_PANE,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_OPTION_PANE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(PASSWORD_TEXT,
      "password text",
      ATK_ROLE_PASSWORD_TEXT,
      NSAccessibilityTextFieldRole,
      ROLE_SYSTEM_TEXT,
      ROLE_SYSTEM_TEXT,
-     "android.widget.EditText",
+     java::SessionAccessibility::CLASSNAME_EDITTEXT,
      eNoNameRule)
 
 ROLE(POPUP_MENU,
      "popup menu",
      ATK_ROLE_POPUP_MENU,
      NSAccessibilityUnknownRole,  //Unused
      ROLE_SYSTEM_MENUPOPUP,
      ROLE_SYSTEM_MENUPOPUP,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(RADIO_MENU_ITEM,
      "radio menu item",
      ATK_ROLE_RADIO_MENU_ITEM,
      NSAccessibilityMenuItemRole,
      ROLE_SYSTEM_MENUITEM,
      IA2_ROLE_RADIO_MENU_ITEM,
-     "android.view.MenuItem",
+     java::SessionAccessibility::CLASSNAME_MENUITEM,
      eNameFromSubtreeRule)
 
 ROLE(ROOT_PANE,
      "root pane",
      ATK_ROLE_ROOT_PANE,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_ROOT_PANE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(SCROLL_PANE,
      "scroll pane",
      ATK_ROLE_SCROLL_PANE,
      NSAccessibilityScrollAreaRole,
      USE_ROLE_STRING,
      IA2_ROLE_SCROLL_PANE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(SPLIT_PANE,
      "split pane",
      ATK_ROLE_SPLIT_PANE,
      NSAccessibilitySplitGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_SPLIT_PANE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(TABLE_COLUMN_HEADER,
      "table column header",
      ATK_ROLE_TABLE_COLUMN_HEADER,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_COLUMNHEADER,
      ROLE_SYSTEM_COLUMNHEADER,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(TABLE_ROW_HEADER,
      "table row header",
      ATK_ROLE_TABLE_ROW_HEADER,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_ROWHEADER,
      ROLE_SYSTEM_ROWHEADER,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(TEAR_OFF_MENU_ITEM,
      "tear off menu item",
      ATK_ROLE_TEAR_OFF_MENU_ITEM,
      NSAccessibilityMenuItemRole,
      ROLE_SYSTEM_MENUITEM,
      IA2_ROLE_TEAR_OFF_MENU,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(TERMINAL,
      "terminal",
      ATK_ROLE_TERMINAL,
      NSAccessibilityUnknownRole,
      USE_ROLE_STRING,
      IA2_ROLE_TERMINAL,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(TEXT_CONTAINER,
      "text container",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_TEXT_FRAME,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeIfReqRule)
 
 ROLE(TOGGLE_BUTTON,
      "toggle button",
      ATK_ROLE_TOGGLE_BUTTON,
      NSAccessibilityButtonRole,
      ROLE_SYSTEM_PUSHBUTTON,
      IA2_ROLE_TOGGLE_BUTTON,
-     "android.widget.ToggleButton",
+     java::SessionAccessibility::CLASSNAME_TOGGLEBUTTON,
      eNameFromSubtreeRule)
 
 ROLE(TREE_TABLE,
      "tree table",
      ATK_ROLE_TREE_TABLE,
      NSAccessibilityTableRole,
      ROLE_SYSTEM_OUTLINE,
      ROLE_SYSTEM_OUTLINE,
-     "android.widget.GridView",
+     java::SessionAccessibility::CLASSNAME_GRIDVIEW,
      eNoNameRule)
 
 ROLE(VIEWPORT,
      "viewport",
      ATK_ROLE_VIEWPORT,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_PANE,
      IA2_ROLE_VIEW_PORT,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(HEADER,
      "header",
      ATK_ROLE_HEADER,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_HEADER,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(FOOTER,
      "footer",
      ATK_ROLE_FOOTER,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_FOOTER,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(PARAGRAPH,
      "paragraph",
      ATK_ROLE_PARAGRAPH,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_PARAGRAPH,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeIfReqRule)
 
 ROLE(RULER,
      "ruler",
      ATK_ROLE_RULER,
      @"AXRuler",  //10.4+ only, so we re-define the constant.
      USE_ROLE_STRING,
      IA2_ROLE_RULER,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(AUTOCOMPLETE,
      "autocomplete",
      ATK_ROLE_AUTOCOMPLETE,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_COMBOBOX,
      ROLE_SYSTEM_COMBOBOX,
-     "android.widget.EditText",
+     java::SessionAccessibility::CLASSNAME_EDITTEXT,
      eNoNameRule)
 
 ROLE(EDITBAR,
      "editbar",
      ATK_ROLE_EDITBAR,
      NSAccessibilityTextFieldRole,
      ROLE_SYSTEM_TEXT,
      IA2_ROLE_EDITBAR,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(ENTRY,
      "entry",
      ATK_ROLE_ENTRY,
      NSAccessibilityTextFieldRole,
      ROLE_SYSTEM_TEXT,
      ROLE_SYSTEM_TEXT,
-     "android.widget.EditText",
+     java::SessionAccessibility::CLASSNAME_EDITTEXT,
      eNameFromValueRule)
 
 ROLE(CAPTION,
      "caption",
      ATK_ROLE_CAPTION,
      NSAccessibilityStaticTextRole,
      USE_ROLE_STRING,
      IA2_ROLE_CAPTION,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeIfReqRule)
 
 ROLE(NON_NATIVE_DOCUMENT,
      "non-native document",
      ATK_ROLE_DOCUMENT_FRAME,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      ROLE_SYSTEM_DOCUMENT,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(HEADING,
      "heading",
      ATK_ROLE_HEADING,
      @"AXHeading",
      USE_ROLE_STRING,
      IA2_ROLE_HEADING,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(PAGE,
      "page",
      ATK_ROLE_PAGE,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_PAGE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(SECTION,
      "section",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_SECTION,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeIfReqRule)
 
 ROLE(REDUNDANT_OBJECT,
      "redundant object",
      ATK_ROLE_REDUNDANT_OBJECT,
      NSAccessibilityUnknownRole,
      USE_ROLE_STRING,
      IA2_ROLE_REDUNDANT_OBJECT,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(FORM,
      "form",
      ATK_ROLE_FORM,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_FORM,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(IME,
      "ime",
      ATK_ROLE_INPUT_METHOD_WINDOW,
      NSAccessibilityUnknownRole,
      USE_ROLE_STRING,
      IA2_ROLE_INPUT_METHOD_WINDOW,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(APP_ROOT,
      "app root",
      ATK_ROLE_APPLICATION,
      NSAccessibilityUnknownRole,  //Unused on OS X
      ROLE_SYSTEM_APPLICATION,
      ROLE_SYSTEM_APPLICATION,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(PARENT_MENUITEM,
      "parent menuitem",
      ATK_ROLE_MENU,
      NSAccessibilityMenuItemRole,
      ROLE_SYSTEM_MENUITEM,
      ROLE_SYSTEM_MENUITEM,
-     "android.view.MenuItem",
+     java::SessionAccessibility::CLASSNAME_MENUITEM,
      eNameFromSubtreeRule)
 
 ROLE(CALENDAR,
      "calendar",
      ATK_ROLE_CALENDAR,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_CLIENT,
      ROLE_SYSTEM_CLIENT,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(COMBOBOX_LIST,
      "combobox list",
      ATK_ROLE_MENU,
      NSAccessibilityMenuRole,
      ROLE_SYSTEM_LIST,
      ROLE_SYSTEM_LIST,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(COMBOBOX_OPTION,
      "combobox option",
      ATK_ROLE_MENU_ITEM,
      NSAccessibilityMenuItemRole,
      ROLE_SYSTEM_LISTITEM,
      ROLE_SYSTEM_LISTITEM,
-     "android.view.MenuItem",
+     java::SessionAccessibility::CLASSNAME_MENUITEM,
      eNameFromSubtreeRule)
 
 ROLE(IMAGE_MAP,
      "image map",
      ATK_ROLE_IMAGE,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_GRAPHIC,
      ROLE_SYSTEM_GRAPHIC,
-     "android.widget.Image",
+     java::SessionAccessibility::CLASSNAME_IMAGE,
      eNoNameRule)
 
 ROLE(OPTION,
      "listbox option",
      ATK_ROLE_LIST_ITEM,
      NSAccessibilityStaticTextRole,
      ROLE_SYSTEM_LISTITEM,
      ROLE_SYSTEM_LISTITEM,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(RICH_OPTION,
      "listbox rich option",
      ATK_ROLE_LIST_ITEM,
      NSAccessibilityRowRole,
      ROLE_SYSTEM_LISTITEM,
      ROLE_SYSTEM_LISTITEM,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(LISTBOX,
      "listbox",
      ATK_ROLE_LIST_BOX,
      NSAccessibilityListRole,
      ROLE_SYSTEM_LIST,
      ROLE_SYSTEM_LIST,
-     "android.widget.ListView",
+     java::SessionAccessibility::CLASSNAME_LISTVIEW,
      eNoNameRule)
 
 ROLE(FLAT_EQUATION,
      "flat equation",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityUnknownRole,
      ROLE_SYSTEM_EQUATION,
      ROLE_SYSTEM_EQUATION,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(GRID_CELL,
      "gridcell",
      ATK_ROLE_TABLE_CELL,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_CELL,
      ROLE_SYSTEM_CELL,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(EMBEDDED_OBJECT,
      "embedded object",
      ATK_ROLE_PANEL,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_EMBEDDED_OBJECT,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(NOTE,
      "note",
      ATK_ROLE_COMMENT,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_NOTE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeIfReqRule)
 
 ROLE(FIGURE,
      "figure",
      ATK_ROLE_PANEL,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_GROUPING,
      ROLE_SYSTEM_GROUPING,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(CHECK_RICH_OPTION,
      "check rich option",
      ATK_ROLE_CHECK_BOX,
      NSAccessibilityCheckBoxRole,
      ROLE_SYSTEM_CHECKBUTTON,
      ROLE_SYSTEM_CHECKBUTTON,
-     "android.widget.CheckBox",
+     java::SessionAccessibility::CLASSNAME_CHECKBOX,
      eNameFromSubtreeRule)
 
 ROLE(DEFINITION_LIST,
      "definitionlist",
      ATK_ROLE_LIST,
      NSAccessibilityListRole,
      ROLE_SYSTEM_LIST,
      ROLE_SYSTEM_LIST,
-     "android.widget.ListView",
+     java::SessionAccessibility::CLASSNAME_LISTVIEW,
      eNameFromSubtreeIfReqRule)
 
 ROLE(TERM,
      "term",
      ATK_ROLE_DESCRIPTION_TERM,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_LISTITEM,
      ROLE_SYSTEM_LISTITEM,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(DEFINITION,
      "definition",
      ATK_ROLE_PARAGRAPH,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_PARAGRAPH,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(KEY,
      "key",
      ATK_ROLE_PUSH_BUTTON,
      NSAccessibilityButtonRole,
      ROLE_SYSTEM_PUSHBUTTON,
      ROLE_SYSTEM_PUSHBUTTON,
-     "android.widget.Button",
+     java::SessionAccessibility::CLASSNAME_BUTTON,
      eNameFromSubtreeRule)
 
 ROLE(SWITCH,
      "switch",
      ATK_ROLE_TOGGLE_BUTTON,
      NSAccessibilityCheckBoxRole,
      ROLE_SYSTEM_CHECKBUTTON,
      IA2_ROLE_TOGGLE_BUTTON,
-     "android.widget.CheckBox",
+     java::SessionAccessibility::CLASSNAME_CHECKBOX,
      eNameFromSubtreeRule)
 
 ROLE(MATHML_MATH,
      "math",
      ATK_ROLE_MATH,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_EQUATION,
      ROLE_SYSTEM_EQUATION,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_IDENTIFIER,
      "mathml identifier",
      ATK_ROLE_STATIC,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(MATHML_NUMBER,
      "mathml number",
      ATK_ROLE_STATIC,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(MATHML_OPERATOR,
      "mathml operator",
      ATK_ROLE_STATIC,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(MATHML_TEXT,
      "mathml text",
      ATK_ROLE_STATIC,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(MATHML_STRING_LITERAL,
      "mathml string literal",
      ATK_ROLE_STATIC,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeRule)
 
 ROLE(MATHML_GLYPH,
      "mathml glyph",
      ATK_ROLE_IMAGE,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.widget.Image",
+     java::SessionAccessibility::CLASSNAME_IMAGE,
      eNameFromSubtreeRule)
 
 ROLE(MATHML_ROW,
      "mathml row",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_FRACTION,
      "mathml fraction",
      ATK_ROLE_MATH_FRACTION,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_SQUARE_ROOT,
      "mathml square root",
      ATK_ROLE_MATH_ROOT,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_ROOT,
      "mathml root",
      ATK_ROLE_MATH_ROOT,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_FENCED,
      "mathml fenced",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_ENCLOSED,
      "mathml enclosed",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_STYLE,
      "mathml style",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_SUB,
      "mathml sub",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_SUP,
      "mathml sup",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_SUB_SUP,
      "mathml sub sup",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_UNDER,
      "mathml under",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_OVER,
      "mathml over",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_UNDER_OVER,
      "mathml under over",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_MULTISCRIPTS,
      "mathml multiscripts",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_TABLE,
      "mathml table",
      ATK_ROLE_TABLE,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.widget.GridView",
+     java::SessionAccessibility::CLASSNAME_GRIDVIEW,
      eNoNameRule)
 
 ROLE(MATHML_LABELED_ROW,
      "mathml labeled row",
      ATK_ROLE_TABLE_ROW,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_TABLE_ROW,
      "mathml table row",
      ATK_ROLE_TABLE_ROW,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_CELL,
      "mathml cell",
      ATK_ROLE_TABLE_CELL,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_ACTION,
      "mathml action",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_ERROR,
      "mathml error",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_STACK,
      "mathml stack",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_LONG_DIVISION,
      "mathml long division",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_STACK_GROUP,
      "mathml stack group",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_STACK_ROW,
      "mathml stack row",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_STACK_CARRIES,
      "mathml stack carries",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_STACK_CARRY,
      "mathml stack carry",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(MATHML_STACK_LINE,
      "mathml stack line",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityGroupRole,
      0,
      IA2_ROLE_UNKNOWN,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(RADIO_GROUP,
      "grouping",
      ATK_ROLE_PANEL,
      NSAccessibilityRadioGroupRole,
      ROLE_SYSTEM_GROUPING,
      ROLE_SYSTEM_GROUPING,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(TEXT,
      "text",
      ATK_ROLE_STATIC,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_TEXT_FRAME,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNameFromSubtreeIfReqRule)
 
 ROLE(DETAILS,
      "details",
      ATK_ROLE_PANEL,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_GROUPING,
      ROLE_SYSTEM_GROUPING,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(SUMMARY,
      "summary",
      ATK_ROLE_PUSH_BUTTON,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_PUSHBUTTON,
      ROLE_SYSTEM_PUSHBUTTON,
-     "android.widget.Button",
+     java::SessionAccessibility::CLASSNAME_BUTTON,
      eNameFromSubtreeRule)
 
 ROLE(LANDMARK,
      "landmark",
      ATK_ROLE_LANDMARK,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_LANDMARK,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(NAVIGATION,
      "navigation",
      ATK_ROLE_LANDMARK,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_LANDMARK,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(FOOTNOTE,
      "footnote",
      ATK_ROLE_FOOTNOTE,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_FOOTNOTE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(ARTICLE,
      "article",
      ATK_ROLE_ARTICLE,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_DOCUMENT,
      ROLE_SYSTEM_DOCUMENT,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(REGION,
      "region",
      ATK_ROLE_LANDMARK,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_LANDMARK,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 // A composite widget with a text input and popup. Used for ARIA role combobox.
 // See also COMBOBOX.
 ROLE(EDITCOMBOBOX,
      "editcombobox",
      ATK_ROLE_COMBO_BOX,
      NSAccessibilityComboBoxRole,
      ROLE_SYSTEM_COMBOBOX,
      ROLE_SYSTEM_COMBOBOX,
-     "android.widget.EditText",
+     java::SessionAccessibility::CLASSNAME_EDITTEXT,
      eNameFromValueRule)
 
 ROLE(BLOCKQUOTE,
      "blockquote",
      ATK_ROLE_BLOCK_QUOTE,
      NSAccessibilityGroupRole,
      ROLE_SYSTEM_GROUPING,
      IA2_ROLE_BLOCK_QUOTE,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(CONTENT_DELETION,
      "content deletion",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_CONTENT_DELETION,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
 
 ROLE(CONTENT_INSERTION,
      "content insertion",
      ATK_ROLE_SECTION,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_CONTENT_INSERTION,
-     "android.view.View",
+     java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
@@ -15,16 +15,17 @@ import org.mozilla.gecko.util.ThreadUtil
 import org.mozilla.gecko.mozglue.JNIObject;
 
 import android.content.Context;
 import android.graphics.Matrix;
 import android.graphics.Rect;
 import android.os.Build;
 import android.os.Bundle;
 import android.text.InputType;
+import android.util.Log;
 import android.view.InputDevice;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewParent;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityManager;
 import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.accessibility.AccessibilityNodeInfo.RangeInfo;
@@ -53,16 +54,60 @@ public class SessionAccessibility {
     @WrapForJNI static final int FLAG_LONG_CLICKABLE = 1 << 10;
     @WrapForJNI static final int FLAG_MULTI_LINE = 1 << 11;
     @WrapForJNI static final int FLAG_PASSWORD = 1 << 12;
     @WrapForJNI static final int FLAG_SCROLLABLE = 1 << 13;
     @WrapForJNI static final int FLAG_SELECTED = 1 << 14;
     @WrapForJNI static final int FLAG_VISIBLE_TO_USER = 1 << 15;
     @WrapForJNI static final int FLAG_SELECTABLE = 1 << 16;
 
+    @WrapForJNI static final int CLASSNAME_VIEW = 0;
+    @WrapForJNI static final int CLASSNAME_BUTTON = 1;
+    @WrapForJNI static final int CLASSNAME_CHECKBOX = 2;
+    @WrapForJNI static final int CLASSNAME_DIALOG = 3;
+    @WrapForJNI static final int CLASSNAME_EDITTEXT = 4;
+    @WrapForJNI static final int CLASSNAME_GRIDVIEW = 5;
+    @WrapForJNI static final int CLASSNAME_IMAGE = 6;
+    @WrapForJNI static final int CLASSNAME_LISTVIEW = 7;
+    @WrapForJNI static final int CLASSNAME_MENUITEM = 8;
+    @WrapForJNI static final int CLASSNAME_PROGRESSBAR = 9;
+    @WrapForJNI static final int CLASSNAME_RADIOBUTTON = 10;
+    @WrapForJNI static final int CLASSNAME_SEEKBAR = 11;
+    @WrapForJNI static final int CLASSNAME_SPINNER = 12;
+    @WrapForJNI static final int CLASSNAME_TABWIDGET = 13;
+    @WrapForJNI static final int CLASSNAME_TOGGLEBUTTON = 14;
+    @WrapForJNI static final int CLASSNAME_WEBVIEW = 15;
+
+    private static final String[] CLASSNAMES = {
+            "android.view.View",
+            "android.widget.Button",
+            "android.widget.CheckBox",
+            "android.app.Dialog",
+            "android.widget.EditText",
+            "android.widget.GridView",
+            "android.widget.Image",
+            "android.widget.ListView",
+            "android.view.MenuItem",
+            "android.widget.ProgressBar",
+            "android.widget.RadioButton",
+            "android.widget.SeekBar",
+            "android.widget.Spinner",
+            "android.widget.TabWidget",
+            "android.widget.ToggleButton",
+            "android.webkit.WebView"
+    };
+
+    static private String getClassName(final int index) {
+        if (index < CLASSNAMES.length) {
+            return CLASSNAMES[index];
+        }
+
+        Log.e(LOGTAG, "Index " + index + " our of CLASSNAME bounds.");
+        return "android.view.View"; // Fallback class is View
+    }
 
     /* package */ final class NodeProvider extends AccessibilityNodeProvider {
         @Override
         public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualDescendantId) {
             AccessibilityNodeInfo node = AccessibilityNodeInfo.obtain(mView, virtualDescendantId);
             if (mAttached) {
                 populateNodeFromBundle(node, nativeProvider.getNodeInfo(virtualDescendantId));
             } else {
@@ -207,17 +252,17 @@ public class SessionAccessibility {
             } else {
                 node.setParent(mView, nodeInfo.getInt("parentId", View.NO_ID));
             }
 
             final int flags = nodeInfo.getInt("flags");
 
             // The basics
             node.setPackageName(GeckoAppShell.getApplicationContext().getPackageName());
-            node.setClassName(nodeInfo.getString("className", "android.view.View"));
+            node.setClassName(getClassName(nodeInfo.getInt("className")));
             node.setText(nodeInfo.getString("text", ""));
 
             // Add actions
             node.addAction(AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT);
             node.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT);
             node.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
             node.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
             node.addAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY);
@@ -568,17 +613,17 @@ public class SessionAccessibility {
 
         final AccessibilityEvent event = AccessibilityEvent.obtain(eventType);
         event.setPackageName(GeckoAppShell.getApplicationContext().getPackageName());
         event.setSource(mView, sourceId);
         event.setEnabled(true);
 
         if (sourceInfo != null) {
             final int flags = sourceInfo.getInt("flags");
-            event.setClassName(sourceInfo.getString("className", "android.view.View"));
+            event.setClassName(getClassName(sourceInfo.getInt("className")));
             event.setChecked((flags & FLAG_CHECKED) != 0);
             event.getText().add(sourceInfo.getString("text", ""));
         }
 
         if (eventData != null) {
             if (eventData.containsKey("text")) {
                 event.getText().add(eventData.getString("text"));
             }