зеркало из https://github.com/mozilla/pjs.git
Back out 940194c616f2 (bug 729237) on suspicion of Android XUL bustage.
This commit is contained in:
Родитель
d40929842f
Коммит
74f3f4c464
|
@ -1871,7 +1871,7 @@ public class GeckoAppShell
|
|||
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) GeckoApp.mAppContext.getSystemService(Context.ACCESSIBILITY_SERVICE);
|
||||
|
||||
|
@ -1882,14 +1882,13 @@ public class GeckoAppShell
|
|||
LayerView layerView = layerController.getView();
|
||||
|
||||
AccessibilityEvent event = AccessibilityEvent.obtain(eventType);
|
||||
event.setClassName(layerView.getClass().getName());
|
||||
event.setClassName(layerView.getClass().getName() + "$" + role);
|
||||
event.setPackageName(GeckoApp.mAppContext.getPackageName());
|
||||
event.setEnabled(enabled);
|
||||
event.setChecked(checked);
|
||||
event.setPassword(password);
|
||||
event.setContentDescription(description);
|
||||
for (String text: textList)
|
||||
event.getText().add(text);
|
||||
event.getText().add(text);
|
||||
|
||||
accessibilityManager.sendAccessibilityEvent(event);
|
||||
}
|
||||
|
|
|
@ -178,7 +178,6 @@ AndroidBridge::Init(JNIEnv *jEnv,
|
|||
jGetCurrentNetworkInformation = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "getCurrentNetworkInformation", "()[D");
|
||||
jEnableNetworkNotifications = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "enableNetworkNotifications", "()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"));
|
||||
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"));
|
||||
jEGLDisplayImplClass = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("com/google/android/gles_jni/EGLDisplayImpl"));
|
||||
|
||||
jStringClass = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("java/lang/String"));
|
||||
|
||||
InitAndroidJavaWrappers(jEnv);
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
void AndroidBridge::EmitGeckoAccessibilityEvent (PRInt32 eventType, const nsTArray<nsString>& text, const nsAString& description, bool enabled, bool checked, bool password) {
|
||||
AutoLocalJNIFrame jniFrame;
|
||||
jobjectArray jarrayText = mJNIEnv->NewObjectArray(text.Length(),
|
||||
jStringClass, 0);
|
||||
for (PRUint32 i = 0; i < text.Length() ; i++) {
|
||||
jstring jstrText = mJNIEnv->NewString(nsPromiseFlatString(text[i]).get(),
|
||||
text[i].Length());
|
||||
mJNIEnv->SetObjectArrayElement(jarrayText, i, jstrText);
|
||||
}
|
||||
jstring jstrDescription = mJNIEnv->NewString(nsPromiseFlatString(description).get(), description.Length());
|
||||
mJNIEnv->CallStaticVoidMethod(mGeckoAppShellClass, jEmitGeckoAccessibilityEvent, eventType, jarrayText, jstrDescription, enabled, checked, password);
|
||||
void AndroidBridge::EmitGeckoAccessibilityEvent (PRInt32 eventType, const nsAString& role, const nsAString& text, const nsAString& description, bool enabled, bool checked, bool password) {
|
||||
|
||||
JNIEnv *env = GetJNIEnv();
|
||||
if (!env)
|
||||
return;
|
||||
|
||||
AutoLocalJNIFrame jniFrame(env);
|
||||
jstring jstrRole = env->NewString(nsPromiseFlatString(role).get(), role.Length());
|
||||
jstring jstrText = env->NewString(nsPromiseFlatString(text).get(), text.Length());
|
||||
jstring jstrDescription = env->NewString(nsPromiseFlatString(description).get(), description.Length());
|
||||
env->CallStaticVoidMethod(mGeckoAppShellClass, jEmitGeckoAccessibilityEvent, eventType, jstrRole, jstrText, jstrDescription, enabled, checked, password);
|
||||
}
|
||||
|
||||
PRUint16
|
||||
|
@ -1587,8 +1584,8 @@ AndroidBridge::CreateMessageList(const dom::sms::SmsFilterData& aFilter, bool aR
|
|||
|
||||
jobjectArray numbers =
|
||||
(jobjectArray)env->NewObjectArray(aFilter.numbers().Length(),
|
||||
jStringClass,
|
||||
env->NewStringUTF(""));
|
||||
env->FindClass("java/lang/String"),
|
||||
env->NewStringUTF(""));
|
||||
|
||||
for (PRUint32 i = 0; i < aFilter.numbers().Length(); ++i) {
|
||||
env->SetObjectArrayElement(numbers, i,
|
||||
|
|
|
@ -357,7 +357,7 @@ public:
|
|||
|
||||
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 MarkURIVisited(const nsAString& uri);
|
||||
|
@ -498,9 +498,6 @@ protected:
|
|||
jclass jEGLContextClass;
|
||||
jclass jEGL10Class;
|
||||
|
||||
// some convinient types to have around
|
||||
jclass jStringClass;
|
||||
|
||||
// calls we've dlopened from libjnigraphics.so
|
||||
int (* AndroidBitmap_getInfo)(JNIEnv *env, jobject bitmap, void *info);
|
||||
int (* AndroidBitmap_lockPixels)(JNIEnv *env, jobject bitmap, void **buffer);
|
||||
|
|
Загрузка…
Ссылка в новой задаче