mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 661978 - Android file input activity deadlocks. r=blassey
This commit is contained in:
parent
2dde74e60d
commit
c6d0970106
@ -684,8 +684,12 @@ abstract public class GeckoApp
|
||||
Intent.createChooser(intent, getString(R.string.choose_file)),
|
||||
FILE_PICKER_REQUEST);
|
||||
String filePickerResult = "";
|
||||
|
||||
try {
|
||||
filePickerResult = mFilePickerResult.take();
|
||||
while (null == (filePickerResult = mFilePickerResult.poll(1, TimeUnit.MILLISECONDS))) {
|
||||
Log.i("GeckoApp", "processing events from showFilePicker ");
|
||||
GeckoAppShell.processNextNativeEvent();
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
Log.i(LOG_FILE_NAME, "showing file picker ", e);
|
||||
}
|
||||
|
@ -119,6 +119,8 @@ public class GeckoAppShell
|
||||
public static native void onChangeNetworkLinkStatus(String status, String type);
|
||||
public static native void reportJavaCrash(String stack);
|
||||
|
||||
public static native void processNextNativeEvent();
|
||||
|
||||
// A looper thread, accessed by GeckoAppShell.getHandler
|
||||
private static class LooperThread extends Thread {
|
||||
public SynchronousQueue<Handler> mHandlerQueue =
|
||||
|
@ -233,6 +233,7 @@ Java_org_mozilla_gecko_GeckoAppShell_ ## name(JNIEnv *jenv, jclass jc, type1 one
|
||||
SHELL_WRAPPER0(nativeInit)
|
||||
SHELL_WRAPPER1(nativeRun, jstring)
|
||||
SHELL_WRAPPER1(notifyGeckoOfEvent, jobject)
|
||||
SHELL_WRAPPER0(processNextNativeEvent)
|
||||
SHELL_WRAPPER1(setSurfaceView, jobject)
|
||||
SHELL_WRAPPER0(onResume)
|
||||
SHELL_WRAPPER0(onLowMemory)
|
||||
@ -676,6 +677,7 @@ loadLibs(const char *apkName)
|
||||
GETFUNC(nativeInit);
|
||||
GETFUNC(nativeRun);
|
||||
GETFUNC(notifyGeckoOfEvent);
|
||||
GETFUNC(processNextNativeEvent);
|
||||
GETFUNC(setSurfaceView);
|
||||
GETFUNC(onResume);
|
||||
GETFUNC(onLowMemory);
|
||||
|
@ -64,6 +64,7 @@ using namespace mozilla;
|
||||
extern "C" {
|
||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_nativeInit(JNIEnv *, jclass);
|
||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_notifyGeckoOfEvent(JNIEnv *, jclass, jobject event);
|
||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent(JNIEnv *, jclass);
|
||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_setSurfaceView(JNIEnv *jenv, jclass, jobject sv);
|
||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onResume(JNIEnv *, jclass);
|
||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onLowMemory(JNIEnv *, jclass);
|
||||
@ -92,6 +93,14 @@ Java_org_mozilla_gecko_GeckoAppShell_notifyGeckoOfEvent(JNIEnv *jenv, jclass jc,
|
||||
nsAppShell::gAppShell->PostEvent(new AndroidGeckoEvent(jenv, event));
|
||||
}
|
||||
|
||||
NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_processNextNativeEvent(JNIEnv *jenv, jclass)
|
||||
{
|
||||
// poke the appshell
|
||||
if (nsAppShell::gAppShell)
|
||||
nsAppShell::gAppShell->ProcessNextNativeEvent(PR_FALSE);
|
||||
}
|
||||
|
||||
NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_setSurfaceView(JNIEnv *jenv, jclass, jobject obj)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user