mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
no bug - make quit work r=dougt
This commit is contained in:
parent
3d1008c0f8
commit
72ea013272
@ -406,7 +406,8 @@ abstract public class GeckoApp
|
||||
Log.i(LOG_FILE_NAME, "pleaseKillMe");
|
||||
if (surfaceView != null)
|
||||
surfaceView.saveLast(true);
|
||||
System.exit(0);
|
||||
GeckoAppShell.nativeQuit();
|
||||
finish();
|
||||
}
|
||||
|
||||
void handleLocationChange(final int tabId, final String uri) {
|
||||
|
@ -110,6 +110,7 @@ public class GeckoAppShell
|
||||
// Initialization methods
|
||||
public static native void nativeInit();
|
||||
public static native void nativeRun(String args);
|
||||
public static native void nativeQuit();
|
||||
|
||||
// helper methods
|
||||
public static native void setSurfaceView(GeckoSurfaceView sv);
|
||||
|
@ -230,6 +230,7 @@ Java_org_mozilla_gecko_GeckoAppShell_ ## name(JNIEnv *jenv, jclass jc, type1 one
|
||||
|
||||
SHELL_WRAPPER0(nativeInit)
|
||||
SHELL_WRAPPER1(nativeRun, jstring)
|
||||
SHELL_WRAPPER0(nativeQuit)
|
||||
SHELL_WRAPPER1(notifyGeckoOfEvent, jobject)
|
||||
SHELL_WRAPPER0(processNextNativeEvent)
|
||||
SHELL_WRAPPER1(setSurfaceView, jobject)
|
||||
@ -635,6 +636,7 @@ loadLibs(const char *apkName)
|
||||
#define GETFUNC(name) f_ ## name = (name ## _t) __wrap_dlsym(xul_handle, "Java_org_mozilla_gecko_GeckoAppShell_" #name)
|
||||
GETFUNC(nativeInit);
|
||||
GETFUNC(nativeRun);
|
||||
GETFUNC(nativeQuit);
|
||||
GETFUNC(notifyGeckoOfEvent);
|
||||
GETFUNC(processNextNativeEvent);
|
||||
GETFUNC(setSurfaceView);
|
||||
|
@ -54,6 +54,8 @@
|
||||
#include "AndroidBridge.h"
|
||||
#include "APKOpen.h"
|
||||
#include "nsExceptionHandler.h"
|
||||
#include "nsIAppStartup.h"
|
||||
#include "nsToolkitCompsCID.h"
|
||||
|
||||
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, MOZ_APP_NAME, args)
|
||||
|
||||
@ -168,3 +170,11 @@ Java_org_mozilla_gecko_GeckoAppShell_nativeRun(JNIEnv *jenv, jclass jc, jstring
|
||||
GeckoStart(args);
|
||||
}
|
||||
|
||||
extern "C" NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_nativeQuit(JNIEnv*, jclass)
|
||||
{
|
||||
nsCOMPtr<nsIAppStartup> appStartup =
|
||||
do_GetService(NS_APPSTARTUP_CONTRACTID);
|
||||
if (appStartup)
|
||||
appStartup->Quit(nsIAppStartup::eAttemptQuit);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user