Back out 940194c616f2 (bug 729237) on suspicion of Android XUL bustage.

This commit is contained in:
Ryan VanderMeulen 2012-02-25 22:09:23 -05:00
Родитель d40929842f
Коммит 74f3f4c464
3 изменённых файлов: 17 добавлений и 24 удалений

Просмотреть файл

@ -1871,7 +1871,7 @@ public class GeckoAppShell
return false; return false;
} }
public static void emitGeckoAccessibilityEvent (int eventType, String[] textList, String description, boolean enabled, boolean checked, boolean password) { public static void emitGeckoAccessibilityEvent (int eventType, String role, String text, String description, boolean enabled, boolean checked, boolean password) {
AccessibilityManager accessibilityManager = AccessibilityManager accessibilityManager =
(AccessibilityManager) GeckoApp.mAppContext.getSystemService(Context.ACCESSIBILITY_SERVICE); (AccessibilityManager) GeckoApp.mAppContext.getSystemService(Context.ACCESSIBILITY_SERVICE);
@ -1882,13 +1882,12 @@ public class GeckoAppShell
LayerView layerView = layerController.getView(); LayerView layerView = layerController.getView();
AccessibilityEvent event = AccessibilityEvent.obtain(eventType); AccessibilityEvent event = AccessibilityEvent.obtain(eventType);
event.setClassName(layerView.getClass().getName()); event.setClassName(layerView.getClass().getName() + "$" + role);
event.setPackageName(GeckoApp.mAppContext.getPackageName()); event.setPackageName(GeckoApp.mAppContext.getPackageName());
event.setEnabled(enabled); event.setEnabled(enabled);
event.setChecked(checked); event.setChecked(checked);
event.setPassword(password); event.setPassword(password);
event.setContentDescription(description); event.setContentDescription(description);
for (String text: textList)
event.getText().add(text); event.getText().add(text);
accessibilityManager.sendAccessibilityEvent(event); accessibilityManager.sendAccessibilityEvent(event);

Просмотреть файл

@ -178,7 +178,6 @@ AndroidBridge::Init(JNIEnv *jEnv,
jGetCurrentNetworkInformation = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "getCurrentNetworkInformation", "()[D"); jGetCurrentNetworkInformation = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "getCurrentNetworkInformation", "()[D");
jEnableNetworkNotifications = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "enableNetworkNotifications", "()V"); jEnableNetworkNotifications = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "enableNetworkNotifications", "()V");
jDisableNetworkNotifications = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "disableNetworkNotifications", "()V"); jDisableNetworkNotifications = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "disableNetworkNotifications", "()V");
jEmitGeckoAccessibilityEvent = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "emitGeckoAccessibilityEvent", "(I[Ljava/lang/String;Ljava/lang/String;ZZZ)V");
jEGLContextClass = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("javax/microedition/khronos/egl/EGLContext")); jEGLContextClass = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("javax/microedition/khronos/egl/EGLContext"));
jEGL10Class = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("javax/microedition/khronos/egl/EGL10")); jEGL10Class = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("javax/microedition/khronos/egl/EGL10"));
@ -187,8 +186,6 @@ AndroidBridge::Init(JNIEnv *jEnv,
jEGLConfigImplClass = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("com/google/android/gles_jni/EGLConfigImpl")); jEGLConfigImplClass = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("com/google/android/gles_jni/EGLConfigImpl"));
jEGLDisplayImplClass = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("com/google/android/gles_jni/EGLDisplayImpl")); jEGLDisplayImplClass = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("com/google/android/gles_jni/EGLDisplayImpl"));
jStringClass = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("java/lang/String"));
InitAndroidJavaWrappers(jEnv); InitAndroidJavaWrappers(jEnv);
// jEnv should NOT be cached here by anything -- the jEnv here // jEnv should NOT be cached here by anything -- the jEnv here
@ -1490,17 +1487,17 @@ AndroidBridge::MarkURIVisited(const nsAString& aURI)
env->CallStaticVoidMethod(mGeckoAppShellClass, jMarkUriVisited, jstrURI); env->CallStaticVoidMethod(mGeckoAppShellClass, jMarkUriVisited, jstrURI);
} }
void AndroidBridge::EmitGeckoAccessibilityEvent (PRInt32 eventType, const nsTArray<nsString>& text, const nsAString& description, bool enabled, bool checked, bool password) { void AndroidBridge::EmitGeckoAccessibilityEvent (PRInt32 eventType, const nsAString& role, const nsAString& text, const nsAString& description, bool enabled, bool checked, bool password) {
AutoLocalJNIFrame jniFrame;
jobjectArray jarrayText = mJNIEnv->NewObjectArray(text.Length(), JNIEnv *env = GetJNIEnv();
jStringClass, 0); if (!env)
for (PRUint32 i = 0; i < text.Length() ; i++) { return;
jstring jstrText = mJNIEnv->NewString(nsPromiseFlatString(text[i]).get(),
text[i].Length()); AutoLocalJNIFrame jniFrame(env);
mJNIEnv->SetObjectArrayElement(jarrayText, i, jstrText); jstring jstrRole = env->NewString(nsPromiseFlatString(role).get(), role.Length());
} jstring jstrText = env->NewString(nsPromiseFlatString(text).get(), text.Length());
jstring jstrDescription = mJNIEnv->NewString(nsPromiseFlatString(description).get(), description.Length()); jstring jstrDescription = env->NewString(nsPromiseFlatString(description).get(), description.Length());
mJNIEnv->CallStaticVoidMethod(mGeckoAppShellClass, jEmitGeckoAccessibilityEvent, eventType, jarrayText, jstrDescription, enabled, checked, password); env->CallStaticVoidMethod(mGeckoAppShellClass, jEmitGeckoAccessibilityEvent, eventType, jstrRole, jstrText, jstrDescription, enabled, checked, password);
} }
PRUint16 PRUint16
@ -1587,7 +1584,7 @@ AndroidBridge::CreateMessageList(const dom::sms::SmsFilterData& aFilter, bool aR
jobjectArray numbers = jobjectArray numbers =
(jobjectArray)env->NewObjectArray(aFilter.numbers().Length(), (jobjectArray)env->NewObjectArray(aFilter.numbers().Length(),
jStringClass, env->FindClass("java/lang/String"),
env->NewStringUTF("")); env->NewStringUTF(""));
for (PRUint32 i = 0; i < aFilter.numbers().Length(); ++i) { for (PRUint32 i = 0; i < aFilter.numbers().Length(); ++i) {

Просмотреть файл

@ -357,7 +357,7 @@ public:
nsCOMPtr<nsIAndroidDrawMetadataProvider> GetDrawMetadataProvider(); nsCOMPtr<nsIAndroidDrawMetadataProvider> GetDrawMetadataProvider();
void EmitGeckoAccessibilityEvent (PRInt32 eventType, const nsTArray<nsString>& text, const nsAString& description, bool enabled, bool checked, bool password); void EmitGeckoAccessibilityEvent (PRInt32 eventType, const nsAString& role, const nsAString& text, const nsAString& description, bool enabled, bool checked, bool password);
void CheckURIVisited(const nsAString& uri); void CheckURIVisited(const nsAString& uri);
void MarkURIVisited(const nsAString& uri); void MarkURIVisited(const nsAString& uri);
@ -498,9 +498,6 @@ protected:
jclass jEGLContextClass; jclass jEGLContextClass;
jclass jEGL10Class; jclass jEGL10Class;
// some convinient types to have around
jclass jStringClass;
// calls we've dlopened from libjnigraphics.so // calls we've dlopened from libjnigraphics.so
int (* AndroidBitmap_getInfo)(JNIEnv *env, jobject bitmap, void *info); int (* AndroidBitmap_getInfo)(JNIEnv *env, jobject bitmap, void *info);
int (* AndroidBitmap_lockPixels)(JNIEnv *env, jobject bitmap, void **buffer); int (* AndroidBitmap_lockPixels)(JNIEnv *env, jobject bitmap, void **buffer);