Bug 730890 - Set up an Android Looper on the main Gecko thread r=cjones

This commit is contained in:
James Willcox
2012-04-11 11:43:08 -04:00
parent b49088b066
commit 102c4acb1e
5 changed files with 50 additions and 12 deletions

View File

@@ -191,6 +191,7 @@ AndroidBridge::Init(JNIEnv *jEnv,
jDisableScreenOrientationNotifications = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "disableScreenOrientationNotifications", "()V");
jLockScreenOrientation = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "lockScreenOrientation", "(I)V");
jUnlockScreenOrientation = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "unlockScreenOrientation", "()V");
jPumpMessageLoop = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "pumpMessageLoop", "()V");
jEGLContextClass = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("javax/microedition/khronos/egl/EGLContext"));
jEGL10Class = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("javax/microedition/khronos/egl/EGL10"));
@@ -2130,6 +2131,15 @@ AndroidBridge::UnlockScreenOrientation()
mJNIEnv->CallStaticVoidMethod(mGeckoAppShellClass, jUnlockScreenOrientation);
}
void
AndroidBridge::PumpMessageLoop()
{
if (!mJNIEnv)
return;
mJNIEnv->CallStaticVoidMethod(mGeckoAppShellClass, jPumpMessageLoop);
}
/* attribute nsIAndroidBrowserApp browserApp; */
NS_IMETHODIMP nsAndroidBridge::GetBrowserApp(nsIAndroidBrowserApp * *aBrowserApp)
{