2013-09-09 05:57:36 -07:00
|
|
|
// GENERATED CODE
|
|
|
|
// Generated by the Java program at /build/annotationProcessors at compile time from
|
|
|
|
// annotations on Java methods. To update, change the annotations on the corresponding Java
|
|
|
|
// methods and rerun the build. Manually updating this file will cause your build to fail.
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
#include "GeneratedJNIWrappers.h"
|
|
|
|
#include "AndroidBridgeUtilities.h"
|
2013-09-09 05:57:36 -07:00
|
|
|
#include "nsXPCOMStrings.h"
|
|
|
|
#include "AndroidBridge.h"
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
namespace mozilla {
|
|
|
|
namespace widget {
|
|
|
|
namespace android {
|
2014-10-20 12:24:49 -07:00
|
|
|
jclass DownloadsIntegration::mDownloadsIntegrationClass = 0;
|
|
|
|
jmethodID DownloadsIntegration::jScanMedia = 0;
|
|
|
|
void DownloadsIntegration::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mDownloadsIntegrationClass = getClassGlobalRef("org/mozilla/gecko/DownloadsIntegration");
|
|
|
|
jScanMedia = getStaticMethod("scanMedia", "(Ljava/lang/String;Ljava/lang/String;)V");
|
|
|
|
}
|
|
|
|
|
|
|
|
DownloadsIntegration* DownloadsIntegration::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
DownloadsIntegration* ret = new DownloadsIntegration(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DownloadsIntegration::ScanMedia(const nsAString& a0, const nsAString& a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
|
|
|
}
|
|
|
|
|
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
jstring j1 = AndroidBridge::NewJavaString(env, a1);
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mDownloadsIntegrationClass, jScanMedia, j0, j1);
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
env->PopLocalFrame(nullptr);
|
|
|
|
}
|
2013-11-12 10:41:00 -08:00
|
|
|
jclass GeckoAppShell::mGeckoAppShellClass = 0;
|
|
|
|
jmethodID GeckoAppShell::jAcknowledgeEvent = 0;
|
|
|
|
jmethodID GeckoAppShell::jAddPluginViewWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jAlertsProgressListener_OnProgress = 0;
|
|
|
|
jmethodID GeckoAppShell::jCancelVibrate = 0;
|
|
|
|
jmethodID GeckoAppShell::jCheckURIVisited = 0;
|
|
|
|
jmethodID GeckoAppShell::jClearMessageList = 0;
|
|
|
|
jmethodID GeckoAppShell::jCloseCamera = 0;
|
|
|
|
jmethodID GeckoAppShell::jCloseNotification = 0;
|
2014-06-04 12:28:04 -07:00
|
|
|
jmethodID GeckoAppShell::jConnectionGetMimeType = 0;
|
|
|
|
jmethodID GeckoAppShell::jCreateInputStream = 0;
|
2013-11-12 10:41:00 -08:00
|
|
|
jmethodID GeckoAppShell::jCreateMessageListWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jCreateShortcut = 0;
|
|
|
|
jmethodID GeckoAppShell::jDeleteMessageWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jDisableBatteryNotifications = 0;
|
|
|
|
jmethodID GeckoAppShell::jDisableNetworkNotifications = 0;
|
|
|
|
jmethodID GeckoAppShell::jDisableScreenOrientationNotifications = 0;
|
|
|
|
jmethodID GeckoAppShell::jDisableSensor = 0;
|
|
|
|
jmethodID GeckoAppShell::jEnableBatteryNotifications = 0;
|
|
|
|
jmethodID GeckoAppShell::jEnableLocation = 0;
|
|
|
|
jmethodID GeckoAppShell::jEnableLocationHighAccuracy = 0;
|
|
|
|
jmethodID GeckoAppShell::jEnableNetworkNotifications = 0;
|
|
|
|
jmethodID GeckoAppShell::jEnableScreenOrientationNotifications = 0;
|
|
|
|
jmethodID GeckoAppShell::jEnableSensor = 0;
|
2014-04-22 07:53:48 -07:00
|
|
|
jmethodID GeckoAppShell::jGamepadAdded = 0;
|
2014-06-04 12:28:04 -07:00
|
|
|
jmethodID GeckoAppShell::jGetConnection = 0;
|
2013-11-12 10:41:00 -08:00
|
|
|
jmethodID GeckoAppShell::jGetContext = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetCurrentBatteryInformationWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetCurrentNetworkInformationWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetDensity = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetDpiWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetExtensionFromMimeTypeWrapper = 0;
|
2014-07-24 13:42:50 -07:00
|
|
|
jmethodID GeckoAppShell::jGetExternalPublicDirectory = 0;
|
2013-11-12 10:41:00 -08:00
|
|
|
jmethodID GeckoAppShell::jGetHandlersForMimeTypeWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetHandlersForURLWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetIconForExtensionWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetMessageWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetMimeTypeFromExtensionsWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetNextMessageInListWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetProxyForURIWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetScreenDepthWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetScreenOrientationWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetShowPasswordSetting = 0;
|
|
|
|
jmethodID GeckoAppShell::jGetSystemColoursWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jHandleGeckoMessageWrapper = 0;
|
2014-01-17 21:32:24 -08:00
|
|
|
jmethodID GeckoAppShell::jHandleUncaughtException = 0;
|
2013-11-12 10:41:00 -08:00
|
|
|
jmethodID GeckoAppShell::jHideProgressDialog = 0;
|
|
|
|
jmethodID GeckoAppShell::jInitCameraWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jIsNetworkLinkKnown = 0;
|
|
|
|
jmethodID GeckoAppShell::jIsNetworkLinkUp = 0;
|
|
|
|
jmethodID GeckoAppShell::jIsTablet = 0;
|
|
|
|
jmethodID GeckoAppShell::jKillAnyZombies = 0;
|
2013-12-11 13:53:06 -08:00
|
|
|
jmethodID GeckoAppShell::jLoadPluginClass = 0;
|
2013-11-12 10:41:00 -08:00
|
|
|
jmethodID GeckoAppShell::jLockScreenOrientation = 0;
|
|
|
|
jmethodID GeckoAppShell::jMarkURIVisited = 0;
|
|
|
|
jmethodID GeckoAppShell::jMoveTaskToBack = 0;
|
|
|
|
jmethodID GeckoAppShell::jNetworkLinkType = 0;
|
|
|
|
jmethodID GeckoAppShell::jNotifyDefaultPrevented = 0;
|
|
|
|
jmethodID GeckoAppShell::jNotifyIME = 0;
|
|
|
|
jmethodID GeckoAppShell::jNotifyIMEChange = 0;
|
|
|
|
jmethodID GeckoAppShell::jNotifyIMEContext = 0;
|
|
|
|
jmethodID GeckoAppShell::jNotifyWakeLockChanged = 0;
|
|
|
|
jmethodID GeckoAppShell::jNotifyXreExit = 0;
|
|
|
|
jmethodID GeckoAppShell::jOpenUriExternal = 0;
|
|
|
|
jmethodID GeckoAppShell::jPerformHapticFeedback = 0;
|
|
|
|
jmethodID GeckoAppShell::jPumpMessageLoop = 0;
|
|
|
|
jmethodID GeckoAppShell::jRegisterSurfaceTextureFrameListener = 0;
|
|
|
|
jmethodID GeckoAppShell::jRemovePluginView = 0;
|
2014-08-08 14:42:20 -07:00
|
|
|
jmethodID GeckoAppShell::jRequestUiThreadCallback = 0;
|
2013-11-12 10:41:00 -08:00
|
|
|
jmethodID GeckoAppShell::jScheduleRestart = 0;
|
|
|
|
jmethodID GeckoAppShell::jSendMessageWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jSetFullScreen = 0;
|
|
|
|
jmethodID GeckoAppShell::jSetKeepScreenOn = 0;
|
|
|
|
jmethodID GeckoAppShell::jSetURITitle = 0;
|
|
|
|
jmethodID GeckoAppShell::jShowAlertNotificationWrapper = 0;
|
|
|
|
jmethodID GeckoAppShell::jShowInputMethodPicker = 0;
|
2014-04-22 07:53:48 -07:00
|
|
|
jmethodID GeckoAppShell::jStartMonitoringGamepad = 0;
|
|
|
|
jmethodID GeckoAppShell::jStopMonitoringGamepad = 0;
|
2013-11-12 10:41:00 -08:00
|
|
|
jmethodID GeckoAppShell::jUnlockProfile = 0;
|
|
|
|
jmethodID GeckoAppShell::jUnlockScreenOrientation = 0;
|
|
|
|
jmethodID GeckoAppShell::jUnregisterSurfaceTextureFrameListener = 0;
|
|
|
|
jmethodID GeckoAppShell::jVibrate1 = 0;
|
|
|
|
jmethodID GeckoAppShell::jVibrateA = 0;
|
|
|
|
void GeckoAppShell::InitStubs(JNIEnv *jEnv) {
|
2013-09-09 05:57:36 -07:00
|
|
|
initInit();
|
|
|
|
|
|
|
|
mGeckoAppShellClass = getClassGlobalRef("org/mozilla/gecko/GeckoAppShell");
|
|
|
|
jAcknowledgeEvent = getStaticMethod("acknowledgeEvent", "()V");
|
|
|
|
jAddPluginViewWrapper = getStaticMethod("addPluginView", "(Landroid/view/View;FFFFZ)V");
|
|
|
|
jAlertsProgressListener_OnProgress = getStaticMethod("alertsProgressListener_OnProgress", "(Ljava/lang/String;JJLjava/lang/String;)V");
|
|
|
|
jCancelVibrate = getStaticMethod("cancelVibrate", "()V");
|
|
|
|
jCheckURIVisited = getStaticMethod("checkUriVisited", "(Ljava/lang/String;)V");
|
|
|
|
jClearMessageList = getStaticMethod("clearMessageList", "(I)V");
|
|
|
|
jCloseCamera = getStaticMethod("closeCamera", "()V");
|
|
|
|
jCloseNotification = getStaticMethod("closeNotification", "(Ljava/lang/String;)V");
|
2014-06-04 12:28:04 -07:00
|
|
|
jConnectionGetMimeType = getStaticMethod("connectionGetMimeType", "(Ljava/net/URLConnection;)Ljava/lang/String;");
|
|
|
|
jCreateInputStream = getStaticMethod("createInputStream", "(Ljava/net/URLConnection;)Ljava/io/InputStream;");
|
2014-08-27 20:00:03 -07:00
|
|
|
jCreateMessageListWrapper = getStaticMethod("createMessageList", "(JJ[Ljava/lang/String;ILjava/lang/String;ZZJZI)V");
|
2014-07-22 12:52:45 -07:00
|
|
|
jCreateShortcut = getStaticMethod("createShortcut", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
|
2013-09-09 05:57:36 -07:00
|
|
|
jDeleteMessageWrapper = getStaticMethod("deleteMessage", "(II)V");
|
|
|
|
jDisableBatteryNotifications = getStaticMethod("disableBatteryNotifications", "()V");
|
|
|
|
jDisableNetworkNotifications = getStaticMethod("disableNetworkNotifications", "()V");
|
|
|
|
jDisableScreenOrientationNotifications = getStaticMethod("disableScreenOrientationNotifications", "()V");
|
|
|
|
jDisableSensor = getStaticMethod("disableSensor", "(I)V");
|
|
|
|
jEnableBatteryNotifications = getStaticMethod("enableBatteryNotifications", "()V");
|
|
|
|
jEnableLocation = getStaticMethod("enableLocation", "(Z)V");
|
|
|
|
jEnableLocationHighAccuracy = getStaticMethod("enableLocationHighAccuracy", "(Z)V");
|
|
|
|
jEnableNetworkNotifications = getStaticMethod("enableNetworkNotifications", "()V");
|
|
|
|
jEnableScreenOrientationNotifications = getStaticMethod("enableScreenOrientationNotifications", "()V");
|
|
|
|
jEnableSensor = getStaticMethod("enableSensor", "(I)V");
|
2014-04-22 07:53:48 -07:00
|
|
|
jGamepadAdded = getStaticMethod("gamepadAdded", "(II)V");
|
2014-06-04 12:28:04 -07:00
|
|
|
jGetConnection = getStaticMethod("getConnection", "(Ljava/lang/String;)Ljava/net/URLConnection;");
|
2013-09-09 05:57:36 -07:00
|
|
|
jGetContext = getStaticMethod("getContext", "()Landroid/content/Context;");
|
|
|
|
jGetCurrentBatteryInformationWrapper = getStaticMethod("getCurrentBatteryInformation", "()[D");
|
|
|
|
jGetCurrentNetworkInformationWrapper = getStaticMethod("getCurrentNetworkInformation", "()[D");
|
2013-09-17 17:45:03 -07:00
|
|
|
jGetDensity = getStaticMethod("getDensity", "()F");
|
2013-09-09 05:57:36 -07:00
|
|
|
jGetDpiWrapper = getStaticMethod("getDpi", "()I");
|
|
|
|
jGetExtensionFromMimeTypeWrapper = getStaticMethod("getExtensionFromMimeType", "(Ljava/lang/String;)Ljava/lang/String;");
|
2014-07-24 13:42:50 -07:00
|
|
|
jGetExternalPublicDirectory = getStaticMethod("getExternalPublicDirectory", "(Ljava/lang/String;)Ljava/lang/String;");
|
2013-09-09 05:57:36 -07:00
|
|
|
jGetHandlersForMimeTypeWrapper = getStaticMethod("getHandlersForMimeType", "(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;");
|
|
|
|
jGetHandlersForURLWrapper = getStaticMethod("getHandlersForURL", "(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;");
|
|
|
|
jGetIconForExtensionWrapper = getStaticMethod("getIconForExtension", "(Ljava/lang/String;I)[B");
|
|
|
|
jGetMessageWrapper = getStaticMethod("getMessage", "(II)V");
|
|
|
|
jGetMimeTypeFromExtensionsWrapper = getStaticMethod("getMimeTypeFromExtensions", "(Ljava/lang/String;)Ljava/lang/String;");
|
|
|
|
jGetNextMessageInListWrapper = getStaticMethod("getNextMessageInList", "(II)V");
|
|
|
|
jGetProxyForURIWrapper = getStaticMethod("getProxyForURI", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;");
|
|
|
|
jGetScreenDepthWrapper = getStaticMethod("getScreenDepth", "()I");
|
|
|
|
jGetScreenOrientationWrapper = getStaticMethod("getScreenOrientation", "()S");
|
|
|
|
jGetShowPasswordSetting = getStaticMethod("getShowPasswordSetting", "()Z");
|
|
|
|
jGetSystemColoursWrapper = getStaticMethod("getSystemColors", "()[I");
|
2014-04-04 09:33:49 -07:00
|
|
|
jHandleGeckoMessageWrapper = getStaticMethod("handleGeckoMessage", "(Lorg/mozilla/gecko/util/NativeJSContainer;)V");
|
2014-01-17 21:32:24 -08:00
|
|
|
jHandleUncaughtException = getStaticMethod("handleUncaughtException", "(Ljava/lang/Thread;Ljava/lang/Throwable;)V");
|
2013-09-09 05:57:36 -07:00
|
|
|
jHideProgressDialog = getStaticMethod("hideProgressDialog", "()V");
|
|
|
|
jInitCameraWrapper = getStaticMethod("initCamera", "(Ljava/lang/String;III)[I");
|
|
|
|
jIsNetworkLinkKnown = getStaticMethod("isNetworkLinkKnown", "()Z");
|
|
|
|
jIsNetworkLinkUp = getStaticMethod("isNetworkLinkUp", "()Z");
|
|
|
|
jIsTablet = getStaticMethod("isTablet", "()Z");
|
|
|
|
jKillAnyZombies = getStaticMethod("killAnyZombies", "()V");
|
2013-12-11 13:53:06 -08:00
|
|
|
jLoadPluginClass = getStaticMethod("loadPluginClass", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Class;");
|
2013-09-09 05:57:36 -07:00
|
|
|
jLockScreenOrientation = getStaticMethod("lockScreenOrientation", "(I)V");
|
|
|
|
jMarkURIVisited = getStaticMethod("markUriVisited", "(Ljava/lang/String;)V");
|
|
|
|
jMoveTaskToBack = getStaticMethod("moveTaskToBack", "()V");
|
2013-11-18 20:43:09 -08:00
|
|
|
jNetworkLinkType = getStaticMethod("networkLinkType", "()I");
|
2013-09-09 05:57:36 -07:00
|
|
|
jNotifyDefaultPrevented = getStaticMethod("notifyDefaultPrevented", "(Z)V");
|
|
|
|
jNotifyIME = getStaticMethod("notifyIME", "(I)V");
|
|
|
|
jNotifyIMEChange = getStaticMethod("notifyIMEChange", "(Ljava/lang/String;III)V");
|
|
|
|
jNotifyIMEContext = getStaticMethod("notifyIMEContext", "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
|
|
|
|
jNotifyWakeLockChanged = getStaticMethod("notifyWakeLockChanged", "(Ljava/lang/String;Ljava/lang/String;)V");
|
|
|
|
jNotifyXreExit = getStaticMethod("onXreExit", "()V");
|
|
|
|
jOpenUriExternal = getStaticMethod("openUriExternal", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z");
|
|
|
|
jPerformHapticFeedback = getStaticMethod("performHapticFeedback", "(Z)V");
|
|
|
|
jPumpMessageLoop = getStaticMethod("pumpMessageLoop", "()Z");
|
|
|
|
jRegisterSurfaceTextureFrameListener = getStaticMethod("registerSurfaceTextureFrameListener", "(Ljava/lang/Object;I)V");
|
|
|
|
jRemovePluginView = getStaticMethod("removePluginView", "(Landroid/view/View;Z)V");
|
2014-08-08 14:42:20 -07:00
|
|
|
jRequestUiThreadCallback = getStaticMethod("requestUiThreadCallback", "(J)V");
|
2013-09-09 05:57:36 -07:00
|
|
|
jScheduleRestart = getStaticMethod("scheduleRestart", "()V");
|
|
|
|
jSendMessageWrapper = getStaticMethod("sendMessage", "(Ljava/lang/String;Ljava/lang/String;I)V");
|
|
|
|
jSetFullScreen = getStaticMethod("setFullScreen", "(Z)V");
|
|
|
|
jSetKeepScreenOn = getStaticMethod("setKeepScreenOn", "(Z)V");
|
|
|
|
jSetURITitle = getStaticMethod("setUriTitle", "(Ljava/lang/String;Ljava/lang/String;)V");
|
|
|
|
jShowAlertNotificationWrapper = getStaticMethod("showAlertNotification", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
|
|
|
|
jShowInputMethodPicker = getStaticMethod("showInputMethodPicker", "()V");
|
2014-04-22 07:53:48 -07:00
|
|
|
jStartMonitoringGamepad = getStaticMethod("startMonitoringGamepad", "()V");
|
|
|
|
jStopMonitoringGamepad = getStaticMethod("stopMonitoringGamepad", "()V");
|
2013-09-09 05:57:36 -07:00
|
|
|
jUnlockProfile = getStaticMethod("unlockProfile", "()Z");
|
|
|
|
jUnlockScreenOrientation = getStaticMethod("unlockScreenOrientation", "()V");
|
|
|
|
jUnregisterSurfaceTextureFrameListener = getStaticMethod("unregisterSurfaceTextureFrameListener", "(Ljava/lang/Object;)V");
|
|
|
|
jVibrate1 = getStaticMethod("vibrate", "(J)V");
|
|
|
|
jVibrateA = getStaticMethod("vibrate", "([JI)V");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
2013-09-09 05:57:36 -07:00
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
GeckoAppShell* GeckoAppShell::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
GeckoAppShell* ret = new GeckoAppShell(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::AcknowledgeEvent() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jAcknowledgeEvent);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::AddPluginViewWrapper(jobject a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, bool a5) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[6];
|
|
|
|
args[0].l = a0;
|
|
|
|
args[1].f = a1;
|
|
|
|
args[2].f = a2;
|
|
|
|
args[3].f = a3;
|
|
|
|
args[4].f = a4;
|
|
|
|
args[5].z = a5;
|
|
|
|
|
|
|
|
env->CallStaticVoidMethodA(mGeckoAppShellClass, jAddPluginViewWrapper, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::AlertsProgressListener_OnProgress(const nsAString& a0, int64_t a1, int64_t a2, const nsAString& a3) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[4];
|
2013-11-12 10:41:00 -08:00
|
|
|
args[0].l = AndroidBridge::NewJavaString(env, a0);
|
2013-09-09 05:57:36 -07:00
|
|
|
args[1].j = a1;
|
|
|
|
args[2].j = a2;
|
2013-11-12 10:41:00 -08:00
|
|
|
args[3].l = AndroidBridge::NewJavaString(env, a3);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
env->CallStaticVoidMethodA(mGeckoAppShellClass, jAlertsProgressListener_OnProgress, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::CancelVibrate() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jCancelVibrate);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::CheckURIVisited(const nsAString& a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jCheckURIVisited, j0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::ClearMessageList(int32_t a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jClearMessageList, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::CloseCamera() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jCloseCamera);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::CloseNotification(const nsAString& a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jCloseNotification, j0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2014-06-04 12:28:04 -07:00
|
|
|
jstring GeckoAppShell::ConnectionGetMimeType(jobject a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
|
|
|
}
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jConnectionGetMimeType, a0);
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
jobject GeckoAppShell::CreateInputStream(jobject a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
|
|
|
}
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jCreateInputStream, a0);
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2014-08-27 20:00:03 -07:00
|
|
|
void GeckoAppShell::CreateMessageListWrapper(int64_t a0, int64_t a1, jobjectArray a2, int32_t a3, const nsAString& a4, bool a5, bool a6, int64_t a7, bool a8, int32_t a9) {
|
2013-11-12 10:41:00 -08:00
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2014-08-27 20:00:03 -07:00
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2014-08-27 20:00:03 -07:00
|
|
|
jvalue args[10];
|
2013-09-09 05:57:36 -07:00
|
|
|
args[0].j = a0;
|
|
|
|
args[1].j = a1;
|
|
|
|
args[2].l = a2;
|
|
|
|
args[3].i = a3;
|
2014-08-27 20:00:03 -07:00
|
|
|
args[4].l = AndroidBridge::NewJavaString(env, a4);
|
2013-09-09 05:57:36 -07:00
|
|
|
args[5].z = a5;
|
2014-08-27 20:00:03 -07:00
|
|
|
args[6].z = a6;
|
|
|
|
args[7].j = a7;
|
|
|
|
args[8].z = a8;
|
|
|
|
args[9].i = a9;
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
env->CallStaticVoidMethodA(mGeckoAppShellClass, jCreateMessageListWrapper, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2014-07-22 12:52:45 -07:00
|
|
|
void GeckoAppShell::CreateShortcut(const nsAString& a0, const nsAString& a1, const nsAString& a2) {
|
2013-11-12 10:41:00 -08:00
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2014-07-22 12:52:45 -07:00
|
|
|
if (env->PushLocalFrame(3) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2014-07-22 12:52:45 -07:00
|
|
|
jvalue args[3];
|
2013-11-12 10:41:00 -08:00
|
|
|
args[0].l = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
args[1].l = AndroidBridge::NewJavaString(env, a1);
|
|
|
|
args[2].l = AndroidBridge::NewJavaString(env, a2);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
env->CallStaticVoidMethodA(mGeckoAppShellClass, jCreateShortcut, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::DeleteMessageWrapper(int32_t a0, int32_t a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jDeleteMessageWrapper, a0, a1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::DisableBatteryNotifications() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableBatteryNotifications);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::DisableNetworkNotifications() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableNetworkNotifications);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::DisableScreenOrientationNotifications() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableScreenOrientationNotifications);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::DisableSensor(int32_t a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableSensor, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::EnableBatteryNotifications() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableBatteryNotifications);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::EnableLocation(bool a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableLocation, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::EnableLocationHighAccuracy(bool a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableLocationHighAccuracy, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::EnableNetworkNotifications() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableNetworkNotifications);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::EnableScreenOrientationNotifications() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableScreenOrientationNotifications);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::EnableSensor(int32_t a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableSensor, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2014-04-22 07:53:48 -07:00
|
|
|
void GeckoAppShell::GamepadAdded(int32_t a0, int32_t a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jGamepadAdded, a0, a1);
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
env->PopLocalFrame(nullptr);
|
|
|
|
}
|
|
|
|
|
2014-06-04 12:28:04 -07:00
|
|
|
jobject GeckoAppShell::GetConnection(const nsACString& a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
|
|
|
}
|
|
|
|
|
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetConnection, j0);
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jobject GeckoAppShell::GetContext() {
|
2013-09-09 05:57:36 -07:00
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetContext);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-09-09 05:57:36 -07:00
|
|
|
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jdoubleArray GeckoAppShell::GetCurrentBatteryInformationWrapper() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetCurrentBatteryInformationWrapper);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-09-09 05:57:36 -07:00
|
|
|
jdoubleArray ret = static_cast<jdoubleArray>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jdoubleArray GeckoAppShell::GetCurrentNetworkInformationWrapper() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetCurrentNetworkInformationWrapper);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-09-09 05:57:36 -07:00
|
|
|
jdoubleArray ret = static_cast<jdoubleArray>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jfloat GeckoAppShell::GetDensity() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-17 17:45:03 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-17 17:45:03 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
jfloat temp = env->CallStaticFloatMethod(mGeckoAppShellClass, jGetDensity);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-17 17:45:03 -07:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
int32_t GeckoAppShell::GetDpiWrapper() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jGetDpiWrapper);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring GeckoAppShell::GetExtensionFromMimeTypeWrapper(const nsAString& a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetExtensionFromMimeTypeWrapper, j0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-09-09 05:57:36 -07:00
|
|
|
jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2014-07-24 13:42:50 -07:00
|
|
|
jstring GeckoAppShell::GetExternalPublicDirectory(const nsAString& a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
|
|
|
}
|
|
|
|
|
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetExternalPublicDirectory, j0);
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jobjectArray GeckoAppShell::GetHandlersForMimeTypeWrapper(const nsAString& a0, const nsAString& a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(3) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
jstring j1 = AndroidBridge::NewJavaString(env, a1);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetHandlersForMimeTypeWrapper, j0, j1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-09-09 05:57:36 -07:00
|
|
|
jobjectArray ret = static_cast<jobjectArray>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jobjectArray GeckoAppShell::GetHandlersForURLWrapper(const nsAString& a0, const nsAString& a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(3) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
jstring j1 = AndroidBridge::NewJavaString(env, a1);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetHandlersForURLWrapper, j0, j1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-09-09 05:57:36 -07:00
|
|
|
jobjectArray ret = static_cast<jobjectArray>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jbyteArray GeckoAppShell::GetIconForExtensionWrapper(const nsAString& a0, int32_t a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetIconForExtensionWrapper, j0, a1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-09-09 05:57:36 -07:00
|
|
|
jbyteArray ret = static_cast<jbyteArray>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::GetMessageWrapper(int32_t a0, int32_t a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jGetMessageWrapper, a0, a1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring GeckoAppShell::GetMimeTypeFromExtensionsWrapper(const nsAString& a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetMimeTypeFromExtensionsWrapper, j0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-09-09 05:57:36 -07:00
|
|
|
jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::GetNextMessageInListWrapper(int32_t a0, int32_t a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jGetNextMessageInListWrapper, a0, a1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring GeckoAppShell::GetProxyForURIWrapper(const nsAString& a0, const nsAString& a1, const nsAString& a2, int32_t a3) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(4) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[4];
|
2013-11-12 10:41:00 -08:00
|
|
|
args[0].l = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
args[1].l = AndroidBridge::NewJavaString(env, a1);
|
|
|
|
args[2].l = AndroidBridge::NewJavaString(env, a2);
|
2013-09-09 05:57:36 -07:00
|
|
|
args[3].i = a3;
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethodA(mGeckoAppShellClass, jGetProxyForURIWrapper, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-09-09 05:57:36 -07:00
|
|
|
jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
int32_t GeckoAppShell::GetScreenDepthWrapper() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jGetScreenDepthWrapper);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
int16_t GeckoAppShell::GetScreenOrientationWrapper() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int16_t temp = env->CallStaticShortMethod(mGeckoAppShellClass, jGetScreenOrientationWrapper);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
bool GeckoAppShell::GetShowPasswordSetting() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jGetShowPasswordSetting);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jintArray GeckoAppShell::GetSystemColoursWrapper() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetSystemColoursWrapper);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-09-09 05:57:36 -07:00
|
|
|
jintArray ret = static_cast<jintArray>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2014-04-04 09:33:49 -07:00
|
|
|
void GeckoAppShell::HandleGeckoMessageWrapper(jobject a0) {
|
2013-11-12 10:41:00 -08:00
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2014-02-11 09:16:00 -08:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2014-04-04 09:33:49 -07:00
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jHandleGeckoMessageWrapper, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-02-11 09:16:00 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2014-01-17 21:32:24 -08:00
|
|
|
void GeckoAppShell::HandleUncaughtException(jobject a0, jthrowable a1) {
|
2014-01-28 16:32:28 -08:00
|
|
|
JNIEnv *env = GetJNIForThread();
|
2014-01-17 21:32:24 -08:00
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jHandleUncaughtException, a0, a1);
|
|
|
|
env->PopLocalFrame(nullptr);
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::HideProgressDialog() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jHideProgressDialog);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jintArray GeckoAppShell::InitCameraWrapper(const nsAString& a0, int32_t a1, int32_t a2, int32_t a3) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[4];
|
2013-11-12 10:41:00 -08:00
|
|
|
args[0].l = AndroidBridge::NewJavaString(env, a0);
|
2013-09-09 05:57:36 -07:00
|
|
|
args[1].i = a1;
|
|
|
|
args[2].i = a2;
|
|
|
|
args[3].i = a3;
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethodA(mGeckoAppShellClass, jInitCameraWrapper, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-09-09 05:57:36 -07:00
|
|
|
jintArray ret = static_cast<jintArray>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
bool GeckoAppShell::IsNetworkLinkKnown() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsNetworkLinkKnown);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
bool GeckoAppShell::IsNetworkLinkUp() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsNetworkLinkUp);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
bool GeckoAppShell::IsTablet() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsTablet);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::KillAnyZombies() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jKillAnyZombies);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-12-11 13:53:06 -08:00
|
|
|
jclass GeckoAppShell::LoadPluginClass(const nsAString& a0, const nsAString& a1) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(3) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-12-11 13:53:06 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
jstring j1 = AndroidBridge::NewJavaString(env, a1);
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jLoadPluginClass, j0, j1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-12-11 13:53:06 -08:00
|
|
|
jclass ret = static_cast<jclass>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::LockScreenOrientation(int32_t a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jLockScreenOrientation, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::MarkURIVisited(const nsAString& a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jMarkURIVisited, j0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::MoveTaskToBack() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jMoveTaskToBack);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
int32_t GeckoAppShell::NetworkLinkType() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-11-18 20:43:09 -08:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-18 20:43:09 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jNetworkLinkType);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-18 20:43:09 -08:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::NotifyDefaultPrevented(bool a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyDefaultPrevented, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::NotifyIME(int32_t a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyIME, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::NotifyIMEChange(const nsAString& a0, int32_t a1, int32_t a2, int32_t a3) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[4];
|
2013-11-12 10:41:00 -08:00
|
|
|
args[0].l = AndroidBridge::NewJavaString(env, a0);
|
2013-09-09 05:57:36 -07:00
|
|
|
args[1].i = a1;
|
|
|
|
args[2].i = a2;
|
|
|
|
args[3].i = a3;
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
env->CallStaticVoidMethodA(mGeckoAppShellClass, jNotifyIMEChange, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::NotifyIMEContext(int32_t a0, const nsAString& a1, const nsAString& a2, const nsAString& a3) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(3) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[4];
|
|
|
|
args[0].i = a0;
|
2013-11-12 10:41:00 -08:00
|
|
|
args[1].l = AndroidBridge::NewJavaString(env, a1);
|
|
|
|
args[2].l = AndroidBridge::NewJavaString(env, a2);
|
|
|
|
args[3].l = AndroidBridge::NewJavaString(env, a3);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
env->CallStaticVoidMethodA(mGeckoAppShellClass, jNotifyIMEContext, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::NotifyWakeLockChanged(const nsAString& a0, const nsAString& a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
jstring j1 = AndroidBridge::NewJavaString(env, a1);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyWakeLockChanged, j0, j1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::NotifyXreExit() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyXreExit);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
bool GeckoAppShell::OpenUriExternal(const nsAString& a0, const nsAString& a1, const nsAString& a2, const nsAString& a3, const nsAString& a4, const nsAString& a5) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(6) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[6];
|
2013-11-12 10:41:00 -08:00
|
|
|
args[0].l = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
args[1].l = AndroidBridge::NewJavaString(env, a1);
|
|
|
|
args[2].l = AndroidBridge::NewJavaString(env, a2);
|
|
|
|
args[3].l = AndroidBridge::NewJavaString(env, a3);
|
|
|
|
args[4].l = AndroidBridge::NewJavaString(env, a4);
|
|
|
|
args[5].l = AndroidBridge::NewJavaString(env, a5);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
bool temp = env->CallStaticBooleanMethodA(mGeckoAppShellClass, jOpenUriExternal, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::PerformHapticFeedback(bool a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jPerformHapticFeedback, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
bool GeckoAppShell::PumpMessageLoop() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jPumpMessageLoop);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::RegisterSurfaceTextureFrameListener(jobject a0, int32_t a1) {
|
2014-10-21 06:53:01 -07:00
|
|
|
JNIEnv *env = GetJNIForThread();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jRegisterSurfaceTextureFrameListener, a0, a1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::RemovePluginView(jobject a0, bool a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jRemovePluginView, a0, a1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2014-08-08 14:42:20 -07:00
|
|
|
void GeckoAppShell::RequestUiThreadCallback(int64_t a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jRequestUiThreadCallback, a0);
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
env->PopLocalFrame(nullptr);
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::ScheduleRestart() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jScheduleRestart);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::SendMessageWrapper(const nsAString& a0, const nsAString& a1, int32_t a2) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[3];
|
2013-11-12 10:41:00 -08:00
|
|
|
args[0].l = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
args[1].l = AndroidBridge::NewJavaString(env, a1);
|
2013-09-09 05:57:36 -07:00
|
|
|
args[2].i = a2;
|
|
|
|
|
|
|
|
env->CallStaticVoidMethodA(mGeckoAppShellClass, jSendMessageWrapper, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::SetFullScreen(bool a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jSetFullScreen, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::SetKeepScreenOn(bool a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jSetKeepScreenOn, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::SetURITitle(const nsAString& a0, const nsAString& a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
jstring j1 = AndroidBridge::NewJavaString(env, a1);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jSetURITitle, j0, j1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::ShowAlertNotificationWrapper(const nsAString& a0, const nsAString& a1, const nsAString& a2, const nsAString& a3, const nsAString& a4) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(5) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[5];
|
2013-11-12 10:41:00 -08:00
|
|
|
args[0].l = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
args[1].l = AndroidBridge::NewJavaString(env, a1);
|
|
|
|
args[2].l = AndroidBridge::NewJavaString(env, a2);
|
|
|
|
args[3].l = AndroidBridge::NewJavaString(env, a3);
|
|
|
|
args[4].l = AndroidBridge::NewJavaString(env, a4);
|
2013-09-09 05:57:36 -07:00
|
|
|
|
|
|
|
env->CallStaticVoidMethodA(mGeckoAppShellClass, jShowAlertNotificationWrapper, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::ShowInputMethodPicker() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jShowInputMethodPicker);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-22 07:53:48 -07:00
|
|
|
env->PopLocalFrame(nullptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GeckoAppShell::StartMonitoringGamepad() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jStartMonitoringGamepad);
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
env->PopLocalFrame(nullptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GeckoAppShell::StopMonitoringGamepad() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jStopMonitoringGamepad);
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
bool GeckoAppShell::UnlockProfile() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jUnlockProfile);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::UnlockScreenOrientation() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jUnlockScreenOrientation);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::UnregisterSurfaceTextureFrameListener(jobject a0) {
|
2013-09-09 05:57:36 -07:00
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jUnregisterSurfaceTextureFrameListener, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::Vibrate1(int64_t a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jVibrate1, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoAppShell::VibrateA(jlongArray a0, int32_t a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoAppShellClass, jVibrateA, a0, a1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
2013-11-12 10:41:00 -08:00
|
|
|
jclass GeckoJavaSampler::mGeckoJavaSamplerClass = 0;
|
|
|
|
jmethodID GeckoJavaSampler::jGetFrameNameJavaProfilingWrapper = 0;
|
|
|
|
jmethodID GeckoJavaSampler::jGetSampleTimeJavaProfiling = 0;
|
|
|
|
jmethodID GeckoJavaSampler::jGetThreadNameJavaProfilingWrapper = 0;
|
|
|
|
jmethodID GeckoJavaSampler::jPauseJavaProfiling = 0;
|
|
|
|
jmethodID GeckoJavaSampler::jStartJavaProfiling = 0;
|
|
|
|
jmethodID GeckoJavaSampler::jStopJavaProfiling = 0;
|
|
|
|
jmethodID GeckoJavaSampler::jUnpauseJavaProfiling = 0;
|
|
|
|
void GeckoJavaSampler::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mGeckoJavaSamplerClass = getClassGlobalRef("org/mozilla/gecko/GeckoJavaSampler");
|
|
|
|
jGetFrameNameJavaProfilingWrapper = getStaticMethod("getFrameName", "(III)Ljava/lang/String;");
|
|
|
|
jGetSampleTimeJavaProfiling = getStaticMethod("getSampleTime", "(II)D");
|
|
|
|
jGetThreadNameJavaProfilingWrapper = getStaticMethod("getThreadName", "(I)Ljava/lang/String;");
|
|
|
|
jPauseJavaProfiling = getStaticMethod("pause", "()V");
|
|
|
|
jStartJavaProfiling = getStaticMethod("start", "(II)V");
|
|
|
|
jStopJavaProfiling = getStaticMethod("stop", "()V");
|
|
|
|
jUnpauseJavaProfiling = getStaticMethod("unpause", "()V");
|
|
|
|
}
|
|
|
|
|
|
|
|
GeckoJavaSampler* GeckoJavaSampler::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
GeckoJavaSampler* ret = new GeckoJavaSampler(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring GeckoJavaSampler::GetFrameNameJavaProfilingWrapper(int32_t a0, int32_t a1, int32_t a2) {
|
2013-09-09 05:57:36 -07:00
|
|
|
JNIEnv *env = GetJNIForThread();
|
2013-11-19 07:56:09 -08:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jvalue args[3];
|
|
|
|
args[0].i = a0;
|
|
|
|
args[1].i = a1;
|
|
|
|
args[2].i = a2;
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethodA(mGeckoJavaSamplerClass, jGetFrameNameJavaProfilingWrapper, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-11-19 07:56:09 -08:00
|
|
|
jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jdouble GeckoJavaSampler::GetSampleTimeJavaProfiling(int32_t a0, int32_t a1) {
|
2013-09-09 05:57:36 -07:00
|
|
|
JNIEnv *env = GetJNIForThread();
|
2013-11-19 07:56:09 -08:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jdouble temp = env->CallStaticDoubleMethod(mGeckoJavaSamplerClass, jGetSampleTimeJavaProfiling, a0, a1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
return temp;
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring GeckoJavaSampler::GetThreadNameJavaProfilingWrapper(int32_t a0) {
|
2013-09-09 05:57:36 -07:00
|
|
|
JNIEnv *env = GetJNIForThread();
|
2013-11-12 10:41:00 -08:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-19 07:56:09 -08:00
|
|
|
}
|
2013-09-09 05:57:36 -07:00
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jobject temp = env->CallStaticObjectMethod(mGeckoJavaSamplerClass, jGetThreadNameJavaProfilingWrapper, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void GeckoJavaSampler::PauseJavaProfiling() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jPauseJavaProfiling);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void GeckoJavaSampler::StartJavaProfiling(int32_t a0, int32_t a1) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jStartJavaProfiling, a0, a1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoJavaSampler::StopJavaProfiling() {
|
2013-09-09 05:57:36 -07:00
|
|
|
JNIEnv *env = GetJNIForThread();
|
2013-11-19 07:56:09 -08:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-19 07:56:09 -08:00
|
|
|
env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jStopJavaProfiling);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoJavaSampler::UnpauseJavaProfiling() {
|
2013-09-09 05:57:36 -07:00
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
2013-11-19 07:56:09 -08:00
|
|
|
env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jUnpauseJavaProfiling);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
2014-09-09 15:08:37 -07:00
|
|
|
jclass RestrictedProfiles::mRestrictedProfilesClass = 0;
|
|
|
|
jmethodID RestrictedProfiles::jGetUserRestrictions = 0;
|
|
|
|
jmethodID RestrictedProfiles::jIsAllowed = 0;
|
|
|
|
jmethodID RestrictedProfiles::jIsUserRestricted = 0;
|
|
|
|
void RestrictedProfiles::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mRestrictedProfilesClass = getClassGlobalRef("org/mozilla/gecko/RestrictedProfiles");
|
|
|
|
jGetUserRestrictions = getStaticMethod("getUserRestrictions", "()Ljava/lang/String;");
|
|
|
|
jIsAllowed = getStaticMethod("isAllowed", "(ILjava/lang/String;)Z");
|
|
|
|
jIsUserRestricted = getStaticMethod("isUserRestricted", "()Z");
|
|
|
|
}
|
|
|
|
|
|
|
|
RestrictedProfiles* RestrictedProfiles::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
RestrictedProfiles* ret = new RestrictedProfiles(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
jstring RestrictedProfiles::GetUserRestrictions() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
|
|
|
}
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mRestrictedProfilesClass, jGetUserRestrictions);
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool RestrictedProfiles::IsAllowed(int32_t a0, const nsAString& a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
|
|
|
}
|
|
|
|
|
|
|
|
jstring j1 = AndroidBridge::NewJavaString(env, a1);
|
|
|
|
|
|
|
|
bool temp = env->CallStaticBooleanMethod(mRestrictedProfilesClass, jIsAllowed, a0, j1);
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
env->PopLocalFrame(nullptr);
|
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool RestrictedProfiles::IsUserRestricted() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
|
|
|
}
|
|
|
|
|
|
|
|
bool temp = env->CallStaticBooleanMethod(mRestrictedProfilesClass, jIsUserRestricted);
|
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
|
|
|
env->PopLocalFrame(nullptr);
|
|
|
|
return temp;
|
|
|
|
}
|
2013-11-12 10:41:00 -08:00
|
|
|
jclass SurfaceBits::mSurfaceBitsClass = 0;
|
|
|
|
jmethodID SurfaceBits::jSurfaceBits = 0;
|
|
|
|
jfieldID SurfaceBits::jbuffer = 0;
|
|
|
|
jfieldID SurfaceBits::jformat = 0;
|
|
|
|
jfieldID SurfaceBits::jheight = 0;
|
|
|
|
jfieldID SurfaceBits::jwidth = 0;
|
|
|
|
void SurfaceBits::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mSurfaceBitsClass = getClassGlobalRef("org/mozilla/gecko/SurfaceBits");
|
|
|
|
jSurfaceBits = getMethod("<init>", "()V");
|
|
|
|
jbuffer = getField("buffer", "Ljava/nio/ByteBuffer;");
|
|
|
|
jformat = getField("format", "I");
|
|
|
|
jheight = getField("height", "I");
|
|
|
|
jwidth = getField("width", "I");
|
|
|
|
}
|
|
|
|
|
|
|
|
SurfaceBits* SurfaceBits::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
SurfaceBits* ret = new SurfaceBits(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
SurfaceBits::SurfaceBits() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
Init(env->NewObject(mSurfaceBitsClass, jSurfaceBits), env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jobject SurfaceBits::getbuffer() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return static_cast<jobject>(env->GetObjectField(wrapped_obj, jbuffer));
|
|
|
|
}
|
|
|
|
|
|
|
|
void SurfaceBits::setbuffer(jobject a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetObjectField(wrapped_obj, jbuffer, a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
int32_t SurfaceBits::getformat() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetIntField(wrapped_obj, jformat);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SurfaceBits::setformat(int32_t a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetIntField(wrapped_obj, jformat, a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
int32_t SurfaceBits::getheight() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetIntField(wrapped_obj, jheight);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SurfaceBits::setheight(int32_t a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetIntField(wrapped_obj, jheight, a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
int32_t SurfaceBits::getwidth() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetIntField(wrapped_obj, jwidth);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SurfaceBits::setwidth(int32_t a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetIntField(wrapped_obj, jwidth, a0);
|
|
|
|
}
|
|
|
|
jclass ThumbnailHelper::mThumbnailHelperClass = 0;
|
|
|
|
jmethodID ThumbnailHelper::jSendThumbnail = 0;
|
|
|
|
void ThumbnailHelper::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mThumbnailHelperClass = getClassGlobalRef("org/mozilla/gecko/ThumbnailHelper");
|
2014-05-05 22:33:29 -07:00
|
|
|
jSendThumbnail = getStaticMethod("notifyThumbnail", "(Ljava/nio/ByteBuffer;IZZ)V");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
ThumbnailHelper* ThumbnailHelper::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
ThumbnailHelper* ret = new ThumbnailHelper(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2014-05-05 22:33:29 -07:00
|
|
|
void ThumbnailHelper::SendThumbnail(jobject a0, int32_t a1, bool a2, bool a3) {
|
2013-11-12 10:41:00 -08:00
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2014-05-05 22:33:29 -07:00
|
|
|
jvalue args[4];
|
2013-11-19 07:56:09 -08:00
|
|
|
args[0].l = a0;
|
|
|
|
args[1].i = a1;
|
|
|
|
args[2].z = a2;
|
2014-05-05 22:33:29 -07:00
|
|
|
args[3].z = a3;
|
2013-11-12 10:41:00 -08:00
|
|
|
|
2013-11-19 07:56:09 -08:00
|
|
|
env->CallStaticVoidMethodA(mThumbnailHelperClass, jSendThumbnail, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
2013-11-12 10:41:00 -08:00
|
|
|
jclass DisplayPortMetrics::mDisplayPortMetricsClass = 0;
|
|
|
|
jmethodID DisplayPortMetrics::jDisplayPortMetrics = 0;
|
|
|
|
jfieldID DisplayPortMetrics::jMPosition = 0;
|
|
|
|
jfieldID DisplayPortMetrics::jResolution = 0;
|
|
|
|
void DisplayPortMetrics::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mDisplayPortMetricsClass = getClassGlobalRef("org/mozilla/gecko/gfx/DisplayPortMetrics");
|
|
|
|
jDisplayPortMetrics = getMethod("<init>", "(FFFFF)V");
|
|
|
|
jMPosition = getField("mPosition", "Landroid/graphics/RectF;");
|
|
|
|
jResolution = getField("resolution", "F");
|
|
|
|
}
|
2013-09-09 05:57:36 -07:00
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
DisplayPortMetrics* DisplayPortMetrics::Wrap(jobject obj) {
|
2013-11-19 07:56:09 -08:00
|
|
|
JNIEnv *env = GetJNIForThread();
|
2013-11-12 10:41:00 -08:00
|
|
|
DisplayPortMetrics* ret = new DisplayPortMetrics(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
DisplayPortMetrics::DisplayPortMetrics(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jvalue args[5];
|
|
|
|
args[0].f = a0;
|
|
|
|
args[1].f = a1;
|
|
|
|
args[2].f = a2;
|
|
|
|
args[3].f = a3;
|
|
|
|
args[4].f = a4;
|
2013-09-09 05:57:36 -07:00
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
Init(env->NewObjectA(mDisplayPortMetricsClass, jDisplayPortMetrics, args), env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jobject DisplayPortMetrics::getMPosition() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return static_cast<jobject>(env->GetObjectField(wrapped_obj, jMPosition));
|
|
|
|
}
|
|
|
|
|
|
|
|
jfloat DisplayPortMetrics::getResolution() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetFloatField(wrapped_obj, jResolution);
|
|
|
|
}
|
|
|
|
jclass GLController::mGLControllerClass = 0;
|
|
|
|
jmethodID GLController::jCreateEGLSurfaceForCompositorWrapper = 0;
|
|
|
|
void GLController::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mGLControllerClass = getClassGlobalRef("org/mozilla/gecko/gfx/GLController");
|
|
|
|
jCreateEGLSurfaceForCompositorWrapper = getMethod("createEGLSurfaceForCompositor", "()Ljavax/microedition/khronos/egl/EGLSurface;");
|
|
|
|
}
|
|
|
|
|
|
|
|
GLController* GLController::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
GLController* ret = new GLController(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
2013-11-19 07:56:09 -08:00
|
|
|
return ret;
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jobject GLController::CreateEGLSurfaceForCompositorWrapper() {
|
2013-11-19 07:56:09 -08:00
|
|
|
JNIEnv *env = GetJNIForThread();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jobject temp = env->CallObjectMethod(wrapped_obj, jCreateEGLSurfaceForCompositorWrapper);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-11-19 07:56:09 -08:00
|
|
|
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
|
2013-11-12 10:41:00 -08:00
|
|
|
return ret;
|
|
|
|
}
|
2013-11-12 10:41:00 -08:00
|
|
|
jclass GeckoLayerClient::mGeckoLayerClientClass = 0;
|
|
|
|
jmethodID GeckoLayerClient::jActivateProgram = 0;
|
|
|
|
jmethodID GeckoLayerClient::jContentDocumentChanged = 0;
|
|
|
|
jmethodID GeckoLayerClient::jCreateFrame = 0;
|
2014-08-20 07:38:51 -07:00
|
|
|
jmethodID GeckoLayerClient::jDeactivateProgramAndRestoreState = 0;
|
2013-11-12 10:41:00 -08:00
|
|
|
jmethodID GeckoLayerClient::jGetDisplayPort = 0;
|
|
|
|
jmethodID GeckoLayerClient::jIsContentDocumentDisplayed = 0;
|
|
|
|
jmethodID GeckoLayerClient::jProgressiveUpdateCallback = 0;
|
|
|
|
jmethodID GeckoLayerClient::jSetFirstPaintViewport = 0;
|
|
|
|
jmethodID GeckoLayerClient::jSetPageRect = 0;
|
|
|
|
jmethodID GeckoLayerClient::jSyncFrameMetrics = 0;
|
|
|
|
jmethodID GeckoLayerClient::jSyncViewportInfo = 0;
|
|
|
|
void GeckoLayerClient::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mGeckoLayerClientClass = getClassGlobalRef("org/mozilla/gecko/gfx/GeckoLayerClient");
|
|
|
|
jActivateProgram = getMethod("activateProgram", "()V");
|
|
|
|
jContentDocumentChanged = getMethod("contentDocumentChanged", "()V");
|
|
|
|
jCreateFrame = getMethod("createFrame", "()Lorg/mozilla/gecko/gfx/LayerRenderer$Frame;");
|
2014-08-20 07:38:51 -07:00
|
|
|
jDeactivateProgramAndRestoreState = getMethod("deactivateProgramAndRestoreState", "(ZIIII)V");
|
2013-11-12 10:41:00 -08:00
|
|
|
jGetDisplayPort = getMethod("getDisplayPort", "(ZZILorg/mozilla/gecko/gfx/ImmutableViewportMetrics;)Lorg/mozilla/gecko/gfx/DisplayPortMetrics;");
|
|
|
|
jIsContentDocumentDisplayed = getMethod("isContentDocumentDisplayed", "()Z");
|
|
|
|
jProgressiveUpdateCallback = getMethod("progressiveUpdateCallback", "(ZFFFFFZ)Lorg/mozilla/gecko/gfx/ProgressiveUpdateData;");
|
|
|
|
jSetFirstPaintViewport = getMethod("setFirstPaintViewport", "(FFFFFFF)V");
|
|
|
|
jSetPageRect = getMethod("setPageRect", "(FFFF)V");
|
|
|
|
jSyncFrameMetrics = getMethod("syncFrameMetrics", "(FFFFFFFZIIIIFZ)Lorg/mozilla/gecko/gfx/ViewTransform;");
|
|
|
|
jSyncViewportInfo = getMethod("syncViewportInfo", "(IIIIFZ)Lorg/mozilla/gecko/gfx/ViewTransform;");
|
|
|
|
}
|
|
|
|
|
|
|
|
GeckoLayerClient* GeckoLayerClient::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
GeckoLayerClient* ret = new GeckoLayerClient(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
2013-11-12 10:41:00 -08:00
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoLayerClient::ActivateProgram() {
|
2013-11-19 07:56:09 -08:00
|
|
|
JNIEnv *env = GetJNIForThread();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
env->CallVoidMethod(wrapped_obj, jActivateProgram);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
void GeckoLayerClient::ContentDocumentChanged() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
env->CallVoidMethod(wrapped_obj, jContentDocumentChanged);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jobject GeckoLayerClient::CreateFrame() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
2013-09-09 05:57:36 -07:00
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2013-11-12 10:41:00 -08:00
|
|
|
jobject temp = env->CallObjectMethod(wrapped_obj, jCreateFrame);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-11-12 10:41:00 -08:00
|
|
|
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
|
2013-09-09 05:57:36 -07:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2014-08-20 07:38:51 -07:00
|
|
|
void GeckoLayerClient::DeactivateProgramAndRestoreState(bool a0, int32_t a1, int32_t a2, int32_t a3, int32_t a4) {
|
2013-11-12 10:41:00 -08:00
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
|
|
|
|
2014-08-20 07:38:51 -07:00
|
|
|
jvalue args[5];
|
|
|
|
args[0].z = a0;
|
|
|
|
args[1].i = a1;
|
|
|
|
args[2].i = a2;
|
|
|
|
args[3].i = a3;
|
|
|
|
args[4].i = a4;
|
|
|
|
|
|
|
|
env->CallVoidMethodA(wrapped_obj, jDeactivateProgramAndRestoreState, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-09-09 05:57:36 -07:00
|
|
|
}
|
2013-11-12 10:41:00 -08:00
|
|
|
|
|
|
|
jobject GeckoLayerClient::GetDisplayPort(bool a0, bool a1, int32_t a2, jobject a3) {
|
2014-01-17 21:32:25 -08:00
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
2013-11-12 10:41:00 -08:00
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[4];
|
|
|
|
args[0].z = a0;
|
|
|
|
args[1].z = a1;
|
|
|
|
args[2].i = a2;
|
|
|
|
args[3].l = a3;
|
|
|
|
|
|
|
|
jobject temp = env->CallObjectMethodA(wrapped_obj, jGetDisplayPort, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-11-12 10:41:00 -08:00
|
|
|
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GeckoLayerClient::IsContentDocumentDisplayed() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool temp = env->CallBooleanMethod(wrapped_obj, jIsContentDocumentDisplayed);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
jobject GeckoLayerClient::ProgressiveUpdateCallback(bool a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, jfloat a5, bool a6) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[7];
|
|
|
|
args[0].z = a0;
|
|
|
|
args[1].f = a1;
|
|
|
|
args[2].f = a2;
|
|
|
|
args[3].f = a3;
|
|
|
|
args[4].f = a4;
|
|
|
|
args[5].f = a5;
|
|
|
|
args[6].z = a6;
|
|
|
|
|
|
|
|
jobject temp = env->CallObjectMethodA(wrapped_obj, jProgressiveUpdateCallback, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-11-12 10:41:00 -08:00
|
|
|
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void GeckoLayerClient::SetFirstPaintViewport(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, jfloat a5, jfloat a6) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[7];
|
|
|
|
args[0].f = a0;
|
|
|
|
args[1].f = a1;
|
|
|
|
args[2].f = a2;
|
|
|
|
args[3].f = a3;
|
|
|
|
args[4].f = a4;
|
|
|
|
args[5].f = a5;
|
|
|
|
args[6].f = a6;
|
|
|
|
|
|
|
|
env->CallVoidMethodA(wrapped_obj, jSetFirstPaintViewport, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void GeckoLayerClient::SetPageRect(jfloat a0, jfloat a1, jfloat a2, jfloat a3) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[4];
|
|
|
|
args[0].f = a0;
|
|
|
|
args[1].f = a1;
|
|
|
|
args[2].f = a2;
|
|
|
|
args[3].f = a3;
|
|
|
|
|
|
|
|
env->CallVoidMethodA(wrapped_obj, jSetPageRect, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jobject GeckoLayerClient::SyncFrameMetrics(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, jfloat a5, jfloat a6, bool a7, int32_t a8, int32_t a9, int32_t a10, int32_t a11, jfloat a12, bool a13) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[14];
|
|
|
|
args[0].f = a0;
|
|
|
|
args[1].f = a1;
|
|
|
|
args[2].f = a2;
|
|
|
|
args[3].f = a3;
|
|
|
|
args[4].f = a4;
|
|
|
|
args[5].f = a5;
|
|
|
|
args[6].f = a6;
|
|
|
|
args[7].z = a7;
|
|
|
|
args[8].i = a8;
|
|
|
|
args[9].i = a9;
|
|
|
|
args[10].i = a10;
|
|
|
|
args[11].i = a11;
|
|
|
|
args[12].f = a12;
|
|
|
|
args[13].z = a13;
|
|
|
|
|
|
|
|
jobject temp = env->CallObjectMethodA(wrapped_obj, jSyncFrameMetrics, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-11-12 10:41:00 -08:00
|
|
|
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
jobject GeckoLayerClient::SyncViewportInfo(int32_t a0, int32_t a1, int32_t a2, int32_t a3, jfloat a4, bool a5) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[6];
|
|
|
|
args[0].i = a0;
|
|
|
|
args[1].i = a1;
|
|
|
|
args[2].i = a2;
|
|
|
|
args[3].i = a3;
|
|
|
|
args[4].f = a4;
|
|
|
|
args[5].z = a5;
|
|
|
|
|
|
|
|
jobject temp = env->CallObjectMethodA(wrapped_obj, jSyncViewportInfo, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-11-12 10:41:00 -08:00
|
|
|
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
jclass ImmutableViewportMetrics::mImmutableViewportMetricsClass = 0;
|
|
|
|
jmethodID ImmutableViewportMetrics::jImmutableViewportMetrics = 0;
|
|
|
|
void ImmutableViewportMetrics::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mImmutableViewportMetricsClass = getClassGlobalRef("org/mozilla/gecko/gfx/ImmutableViewportMetrics");
|
|
|
|
jImmutableViewportMetrics = getMethod("<init>", "(FFFFFFFFFFFFF)V");
|
|
|
|
}
|
|
|
|
|
|
|
|
ImmutableViewportMetrics* ImmutableViewportMetrics::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
ImmutableViewportMetrics* ret = new ImmutableViewportMetrics(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
ImmutableViewportMetrics::ImmutableViewportMetrics(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, jfloat a5, jfloat a6, jfloat a7, jfloat a8, jfloat a9, jfloat a10, jfloat a11, jfloat a12) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[13];
|
|
|
|
args[0].f = a0;
|
|
|
|
args[1].f = a1;
|
|
|
|
args[2].f = a2;
|
|
|
|
args[3].f = a3;
|
|
|
|
args[4].f = a4;
|
|
|
|
args[5].f = a5;
|
|
|
|
args[6].f = a6;
|
|
|
|
args[7].f = a7;
|
|
|
|
args[8].f = a8;
|
|
|
|
args[9].f = a9;
|
|
|
|
args[10].f = a10;
|
|
|
|
args[11].f = a11;
|
|
|
|
args[12].f = a12;
|
|
|
|
|
|
|
|
Init(env->NewObjectA(mImmutableViewportMetricsClass, jImmutableViewportMetrics, args), env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
jclass LayerView::mLayerViewClass = 0;
|
|
|
|
jmethodID LayerView::jRegisterCompositorWrapper = 0;
|
|
|
|
void LayerView::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mLayerViewClass = getClassGlobalRef("org/mozilla/gecko/gfx/LayerView");
|
|
|
|
jRegisterCompositorWrapper = getStaticMethod("registerCxxCompositor", "()Lorg/mozilla/gecko/gfx/GLController;");
|
|
|
|
}
|
|
|
|
|
|
|
|
LayerView* LayerView::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
LayerView* ret = new LayerView(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
jobject LayerView::RegisterCompositorWrapper() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mLayerViewClass, jRegisterCompositorWrapper);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-11-12 10:41:00 -08:00
|
|
|
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
jclass NativePanZoomController::mNativePanZoomControllerClass = 0;
|
|
|
|
jmethodID NativePanZoomController::jRequestContentRepaintWrapper = 0;
|
|
|
|
void NativePanZoomController::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mNativePanZoomControllerClass = getClassGlobalRef("org/mozilla/gecko/gfx/NativePanZoomController");
|
|
|
|
jRequestContentRepaintWrapper = getMethod("requestContentRepaint", "(FFFFF)V");
|
|
|
|
}
|
|
|
|
|
|
|
|
NativePanZoomController* NativePanZoomController::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
NativePanZoomController* ret = new NativePanZoomController(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void NativePanZoomController::RequestContentRepaintWrapper(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[5];
|
|
|
|
args[0].f = a0;
|
|
|
|
args[1].f = a1;
|
|
|
|
args[2].f = a2;
|
|
|
|
args[3].f = a3;
|
|
|
|
args[4].f = a4;
|
|
|
|
|
|
|
|
env->CallVoidMethodA(wrapped_obj, jRequestContentRepaintWrapper, args);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
jclass ProgressiveUpdateData::mProgressiveUpdateDataClass = 0;
|
|
|
|
jmethodID ProgressiveUpdateData::jProgressiveUpdateData = 0;
|
|
|
|
jmethodID ProgressiveUpdateData::jsetViewport = 0;
|
|
|
|
jfieldID ProgressiveUpdateData::jabort = 0;
|
|
|
|
jfieldID ProgressiveUpdateData::jscale = 0;
|
|
|
|
jfieldID ProgressiveUpdateData::jx = 0;
|
|
|
|
jfieldID ProgressiveUpdateData::jy = 0;
|
|
|
|
void ProgressiveUpdateData::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mProgressiveUpdateDataClass = getClassGlobalRef("org/mozilla/gecko/gfx/ProgressiveUpdateData");
|
|
|
|
jProgressiveUpdateData = getMethod("<init>", "()V");
|
|
|
|
jsetViewport = getMethod("setViewport", "(Lorg/mozilla/gecko/gfx/ImmutableViewportMetrics;)V");
|
|
|
|
jabort = getField("abort", "Z");
|
|
|
|
jscale = getField("scale", "F");
|
|
|
|
jx = getField("x", "F");
|
|
|
|
jy = getField("y", "F");
|
|
|
|
}
|
|
|
|
|
|
|
|
ProgressiveUpdateData* ProgressiveUpdateData::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
ProgressiveUpdateData* ret = new ProgressiveUpdateData(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
ProgressiveUpdateData::ProgressiveUpdateData() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
Init(env->NewObject(mProgressiveUpdateDataClass, jProgressiveUpdateData), env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void ProgressiveUpdateData::setViewport(jobject a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallVoidMethod(wrapped_obj, jsetViewport, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ProgressiveUpdateData::getabort() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetBooleanField(wrapped_obj, jabort);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ProgressiveUpdateData::setabort(bool a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetBooleanField(wrapped_obj, jabort, a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
jfloat ProgressiveUpdateData::getscale() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetFloatField(wrapped_obj, jscale);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ProgressiveUpdateData::setscale(jfloat a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetFloatField(wrapped_obj, jscale, a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
jfloat ProgressiveUpdateData::getx() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetFloatField(wrapped_obj, jx);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ProgressiveUpdateData::setx(jfloat a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetFloatField(wrapped_obj, jx, a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
jfloat ProgressiveUpdateData::gety() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetFloatField(wrapped_obj, jy);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ProgressiveUpdateData::sety(jfloat a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetFloatField(wrapped_obj, jy, a0);
|
|
|
|
}
|
|
|
|
jclass ViewTransform::mViewTransformClass = 0;
|
|
|
|
jmethodID ViewTransform::jViewTransform = 0;
|
|
|
|
jfieldID ViewTransform::jfixedLayerMarginBottom = 0;
|
|
|
|
jfieldID ViewTransform::jfixedLayerMarginLeft = 0;
|
|
|
|
jfieldID ViewTransform::jfixedLayerMarginRight = 0;
|
|
|
|
jfieldID ViewTransform::jfixedLayerMarginTop = 0;
|
|
|
|
jfieldID ViewTransform::joffsetX = 0;
|
|
|
|
jfieldID ViewTransform::joffsetY = 0;
|
|
|
|
jfieldID ViewTransform::jscale = 0;
|
|
|
|
jfieldID ViewTransform::jx = 0;
|
|
|
|
jfieldID ViewTransform::jy = 0;
|
|
|
|
void ViewTransform::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mViewTransformClass = getClassGlobalRef("org/mozilla/gecko/gfx/ViewTransform");
|
|
|
|
jViewTransform = getMethod("<init>", "(FFF)V");
|
|
|
|
jfixedLayerMarginBottom = getField("fixedLayerMarginBottom", "F");
|
|
|
|
jfixedLayerMarginLeft = getField("fixedLayerMarginLeft", "F");
|
|
|
|
jfixedLayerMarginRight = getField("fixedLayerMarginRight", "F");
|
|
|
|
jfixedLayerMarginTop = getField("fixedLayerMarginTop", "F");
|
|
|
|
joffsetX = getField("offsetX", "F");
|
|
|
|
joffsetY = getField("offsetY", "F");
|
|
|
|
jscale = getField("scale", "F");
|
|
|
|
jx = getField("x", "F");
|
|
|
|
jy = getField("y", "F");
|
|
|
|
}
|
|
|
|
|
|
|
|
ViewTransform* ViewTransform::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
ViewTransform* ret = new ViewTransform(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
ViewTransform::ViewTransform(jfloat a0, jfloat a1, jfloat a2) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jvalue args[3];
|
|
|
|
args[0].f = a0;
|
|
|
|
args[1].f = a1;
|
|
|
|
args[2].f = a2;
|
|
|
|
|
|
|
|
Init(env->NewObjectA(mViewTransformClass, jViewTransform, args), env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jfloat ViewTransform::getfixedLayerMarginBottom() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetFloatField(wrapped_obj, jfixedLayerMarginBottom);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViewTransform::setfixedLayerMarginBottom(jfloat a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetFloatField(wrapped_obj, jfixedLayerMarginBottom, a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
jfloat ViewTransform::getfixedLayerMarginLeft() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetFloatField(wrapped_obj, jfixedLayerMarginLeft);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViewTransform::setfixedLayerMarginLeft(jfloat a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetFloatField(wrapped_obj, jfixedLayerMarginLeft, a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
jfloat ViewTransform::getfixedLayerMarginRight() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetFloatField(wrapped_obj, jfixedLayerMarginRight);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViewTransform::setfixedLayerMarginRight(jfloat a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetFloatField(wrapped_obj, jfixedLayerMarginRight, a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
jfloat ViewTransform::getfixedLayerMarginTop() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetFloatField(wrapped_obj, jfixedLayerMarginTop);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViewTransform::setfixedLayerMarginTop(jfloat a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetFloatField(wrapped_obj, jfixedLayerMarginTop, a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
jfloat ViewTransform::getoffsetX() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetFloatField(wrapped_obj, joffsetX);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViewTransform::setoffsetX(jfloat a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetFloatField(wrapped_obj, joffsetX, a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
jfloat ViewTransform::getoffsetY() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetFloatField(wrapped_obj, joffsetY);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViewTransform::setoffsetY(jfloat a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetFloatField(wrapped_obj, joffsetY, a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
jfloat ViewTransform::getscale() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetFloatField(wrapped_obj, jscale);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViewTransform::setscale(jfloat a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetFloatField(wrapped_obj, jscale, a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
jfloat ViewTransform::getx() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetFloatField(wrapped_obj, jx);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViewTransform::setx(jfloat a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetFloatField(wrapped_obj, jx, a0);
|
|
|
|
}
|
|
|
|
|
|
|
|
jfloat ViewTransform::gety() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetFloatField(wrapped_obj, jy);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ViewTransform::sety(jfloat a0) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
env->SetFloatField(wrapped_obj, jy, a0);
|
|
|
|
}
|
|
|
|
jclass NativeZip::mNativeZipClass = 0;
|
|
|
|
jmethodID NativeZip::jCreateInputStream = 0;
|
|
|
|
void NativeZip::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mNativeZipClass = getClassGlobalRef("org/mozilla/gecko/mozglue/NativeZip");
|
|
|
|
jCreateInputStream = getMethod("createInputStream", "(Ljava/nio/ByteBuffer;I)Ljava/io/InputStream;");
|
|
|
|
}
|
|
|
|
|
|
|
|
NativeZip* NativeZip::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
NativeZip* ret = new NativeZip(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
jobject NativeZip::CreateInputStream(jobject a0, int32_t a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(2) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jobject temp = env->CallObjectMethod(wrapped_obj, jCreateInputStream, a0, a1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-11-12 10:41:00 -08:00
|
|
|
jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
jclass MatrixBlobCursor::mMatrixBlobCursorClass = 0;
|
|
|
|
jmethodID MatrixBlobCursor::jMatrixBlobCursor = 0;
|
|
|
|
jmethodID MatrixBlobCursor::jMatrixBlobCursor0 = 0;
|
|
|
|
jmethodID MatrixBlobCursor::jAddRow = 0;
|
|
|
|
jmethodID MatrixBlobCursor::jAddRow1 = 0;
|
|
|
|
jmethodID MatrixBlobCursor::jAddRow2 = 0;
|
|
|
|
void MatrixBlobCursor::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mMatrixBlobCursorClass = getClassGlobalRef("org/mozilla/gecko/sqlite/MatrixBlobCursor");
|
|
|
|
jMatrixBlobCursor = getMethod("<init>", "([Ljava/lang/String;)V");
|
|
|
|
jMatrixBlobCursor0 = getMethod("<init>", "([Ljava/lang/String;I)V");
|
|
|
|
jAddRow = getMethod("addRow", "(Ljava/lang/Iterable;)V");
|
|
|
|
jAddRow1 = getMethod("addRow", "(Ljava/util/ArrayList;I)V");
|
|
|
|
jAddRow2 = getMethod("addRow", "([Ljava/lang/Object;)V");
|
|
|
|
}
|
|
|
|
|
|
|
|
MatrixBlobCursor* MatrixBlobCursor::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
MatrixBlobCursor* ret = new MatrixBlobCursor(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
MatrixBlobCursor::MatrixBlobCursor(jobjectArray a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
Init(env->NewObject(mMatrixBlobCursorClass, jMatrixBlobCursor, a0), env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
MatrixBlobCursor::MatrixBlobCursor(jobjectArray a0, int32_t a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
Init(env->NewObject(mMatrixBlobCursorClass, jMatrixBlobCursor0, a0, a1), env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void MatrixBlobCursor::AddRow(jobject a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallVoidMethod(wrapped_obj, jAddRow, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void MatrixBlobCursor::AddRow(jobject a0, int32_t a1) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallVoidMethod(wrapped_obj, jAddRow1, a0, a1);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void MatrixBlobCursor::AddRow(jobjectArray a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallVoidMethod(wrapped_obj, jAddRow2, a0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
jclass SQLiteBridgeException::mSQLiteBridgeExceptionClass = 0;
|
|
|
|
jmethodID SQLiteBridgeException::jSQLiteBridgeException = 0;
|
|
|
|
jmethodID SQLiteBridgeException::jSQLiteBridgeException0 = 0;
|
|
|
|
jfieldID SQLiteBridgeException::jserialVersionUID = 0;
|
|
|
|
void SQLiteBridgeException::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mSQLiteBridgeExceptionClass = getClassGlobalRef("org/mozilla/gecko/sqlite/SQLiteBridgeException");
|
|
|
|
jSQLiteBridgeException = getMethod("<init>", "()V");
|
|
|
|
jSQLiteBridgeException0 = getMethod("<init>", "(Ljava/lang/String;)V");
|
|
|
|
jserialVersionUID = getStaticField("serialVersionUID", "J");
|
|
|
|
}
|
|
|
|
|
|
|
|
SQLiteBridgeException* SQLiteBridgeException::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
SQLiteBridgeException* ret = new SQLiteBridgeException(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
SQLiteBridgeException::SQLiteBridgeException() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
Init(env->NewObject(mSQLiteBridgeExceptionClass, jSQLiteBridgeException), env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
SQLiteBridgeException::SQLiteBridgeException(const nsAString& a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
|
|
|
|
Init(env->NewObject(mSQLiteBridgeExceptionClass, jSQLiteBridgeException0, j0), env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
int64_t SQLiteBridgeException::getserialVersionUID() {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
return env->GetStaticLongField(mSQLiteBridgeExceptionClass, jserialVersionUID);
|
|
|
|
}
|
|
|
|
jclass Clipboard::mClipboardClass = 0;
|
|
|
|
jmethodID Clipboard::jClearText = 0;
|
|
|
|
jmethodID Clipboard::jGetClipboardTextWrapper = 0;
|
|
|
|
jmethodID Clipboard::jHasText = 0;
|
|
|
|
jmethodID Clipboard::jSetClipboardText = 0;
|
|
|
|
void Clipboard::InitStubs(JNIEnv *jEnv) {
|
|
|
|
initInit();
|
|
|
|
|
|
|
|
mClipboardClass = getClassGlobalRef("org/mozilla/gecko/util/Clipboard");
|
|
|
|
jClearText = getStaticMethod("clearText", "()V");
|
|
|
|
jGetClipboardTextWrapper = getStaticMethod("getText", "()Ljava/lang/String;");
|
|
|
|
jHasText = getStaticMethod("hasText", "()Z");
|
|
|
|
jSetClipboardText = getStaticMethod("setText", "(Ljava/lang/CharSequence;)V");
|
|
|
|
}
|
|
|
|
|
|
|
|
Clipboard* Clipboard::Wrap(jobject obj) {
|
|
|
|
JNIEnv *env = GetJNIForThread();
|
|
|
|
Clipboard* ret = new Clipboard(obj, env);
|
|
|
|
env->DeleteLocalRef(obj);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Clipboard::ClearText() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mClipboardClass, jClearText);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jstring Clipboard::GetClipboardTextWrapper() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jobject temp = env->CallStaticObjectMethod(mClipboardClass, jGetClipboardTextWrapper);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2013-11-12 10:41:00 -08:00
|
|
|
jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Clipboard::HasText() {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(0) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool temp = env->CallStaticBooleanMethod(mClipboardClass, jHasText);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Clipboard::SetClipboardText(const nsAString& a0) {
|
|
|
|
JNIEnv *env = AndroidBridge::GetJNIEnv();
|
|
|
|
if (env->PushLocalFrame(1) != 0) {
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-04-27 18:56:46 -07:00
|
|
|
MOZ_CRASH("Exception should have caused crash.");
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
jstring j0 = AndroidBridge::NewJavaString(env, a0);
|
|
|
|
|
|
|
|
env->CallStaticVoidMethod(mClipboardClass, jSetClipboardText, j0);
|
2014-01-17 21:32:25 -08:00
|
|
|
AndroidBridge::HandleUncaughtException(env);
|
2014-01-06 12:21:27 -08:00
|
|
|
env->PopLocalFrame(nullptr);
|
2013-11-12 10:41:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void InitStubs(JNIEnv *jEnv) {
|
2014-10-20 12:24:49 -07:00
|
|
|
DownloadsIntegration::InitStubs(jEnv);
|
2013-11-12 10:41:00 -08:00
|
|
|
GeckoAppShell::InitStubs(jEnv);
|
|
|
|
GeckoJavaSampler::InitStubs(jEnv);
|
2014-09-09 15:08:37 -07:00
|
|
|
RestrictedProfiles::InitStubs(jEnv);
|
2013-11-12 10:41:00 -08:00
|
|
|
SurfaceBits::InitStubs(jEnv);
|
|
|
|
ThumbnailHelper::InitStubs(jEnv);
|
|
|
|
DisplayPortMetrics::InitStubs(jEnv);
|
|
|
|
GLController::InitStubs(jEnv);
|
|
|
|
GeckoLayerClient::InitStubs(jEnv);
|
|
|
|
ImmutableViewportMetrics::InitStubs(jEnv);
|
|
|
|
LayerView::InitStubs(jEnv);
|
|
|
|
NativePanZoomController::InitStubs(jEnv);
|
|
|
|
ProgressiveUpdateData::InitStubs(jEnv);
|
|
|
|
ViewTransform::InitStubs(jEnv);
|
|
|
|
NativeZip::InitStubs(jEnv);
|
|
|
|
MatrixBlobCursor::InitStubs(jEnv);
|
|
|
|
SQLiteBridgeException::InitStubs(jEnv);
|
|
|
|
Clipboard::InitStubs(jEnv);
|
|
|
|
}
|
|
|
|
} /* android */
|
|
|
|
} /* widget */
|
|
|
|
} /* mozilla */
|