Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 // GENERATED CODE
2 // Generated by the Java program at /build/annotationProcessors at compile time from
3 // annotations on Java methods. To update, change the annotations on the corresponding Java
4 // methods and rerun the build. Manually updating this file will cause your build to fail.
6 #include "GeneratedJNIWrappers.h"
7 #include "AndroidBridgeUtilities.h"
8 #include "nsXPCOMStrings.h"
9 #include "AndroidBridge.h"
11 namespace mozilla {
12 namespace widget {
13 namespace android {
14 jclass GeckoAppShell::mGeckoAppShellClass = 0;
15 jmethodID GeckoAppShell::jAcknowledgeEvent = 0;
16 jmethodID GeckoAppShell::jAddPluginViewWrapper = 0;
17 jmethodID GeckoAppShell::jAlertsProgressListener_OnProgress = 0;
18 jmethodID GeckoAppShell::jCancelVibrate = 0;
19 jmethodID GeckoAppShell::jCheckURIVisited = 0;
20 jmethodID GeckoAppShell::jClearMessageList = 0;
21 jmethodID GeckoAppShell::jCloseCamera = 0;
22 jmethodID GeckoAppShell::jCloseNotification = 0;
23 jmethodID GeckoAppShell::jCreateMessageListWrapper = 0;
24 jmethodID GeckoAppShell::jCreateShortcut = 0;
25 jmethodID GeckoAppShell::jDeleteMessageWrapper = 0;
26 jmethodID GeckoAppShell::jDisableBatteryNotifications = 0;
27 jmethodID GeckoAppShell::jDisableNetworkNotifications = 0;
28 jmethodID GeckoAppShell::jDisableScreenOrientationNotifications = 0;
29 jmethodID GeckoAppShell::jDisableSensor = 0;
30 jmethodID GeckoAppShell::jEnableBatteryNotifications = 0;
31 jmethodID GeckoAppShell::jEnableLocation = 0;
32 jmethodID GeckoAppShell::jEnableLocationHighAccuracy = 0;
33 jmethodID GeckoAppShell::jEnableNetworkNotifications = 0;
34 jmethodID GeckoAppShell::jEnableScreenOrientationNotifications = 0;
35 jmethodID GeckoAppShell::jEnableSensor = 0;
36 jmethodID GeckoAppShell::jGetContext = 0;
37 jmethodID GeckoAppShell::jGetCurrentBatteryInformationWrapper = 0;
38 jmethodID GeckoAppShell::jGetCurrentNetworkInformationWrapper = 0;
39 jmethodID GeckoAppShell::jGetDensity = 0;
40 jmethodID GeckoAppShell::jGetDpiWrapper = 0;
41 jmethodID GeckoAppShell::jGetExtensionFromMimeTypeWrapper = 0;
42 jmethodID GeckoAppShell::jGetHandlersForMimeTypeWrapper = 0;
43 jmethodID GeckoAppShell::jGetHandlersForURLWrapper = 0;
44 jmethodID GeckoAppShell::jGetIconForExtensionWrapper = 0;
45 jmethodID GeckoAppShell::jGetMessageWrapper = 0;
46 jmethodID GeckoAppShell::jGetMimeTypeFromExtensionsWrapper = 0;
47 jmethodID GeckoAppShell::jGetNextMessageInListWrapper = 0;
48 jmethodID GeckoAppShell::jGetProxyForURIWrapper = 0;
49 jmethodID GeckoAppShell::jGetScreenDepthWrapper = 0;
50 jmethodID GeckoAppShell::jGetScreenOrientationWrapper = 0;
51 jmethodID GeckoAppShell::jGetShowPasswordSetting = 0;
52 jmethodID GeckoAppShell::jGetSystemColoursWrapper = 0;
53 jmethodID GeckoAppShell::jHandleGeckoMessageWrapper = 0;
54 jmethodID GeckoAppShell::jHandleUncaughtException = 0;
55 jmethodID GeckoAppShell::jHideProgressDialog = 0;
56 jmethodID GeckoAppShell::jInitCameraWrapper = 0;
57 jmethodID GeckoAppShell::jIsNetworkLinkKnown = 0;
58 jmethodID GeckoAppShell::jIsNetworkLinkUp = 0;
59 jmethodID GeckoAppShell::jIsTablet = 0;
60 jmethodID GeckoAppShell::jKillAnyZombies = 0;
61 jmethodID GeckoAppShell::jLoadPluginClass = 0;
62 jmethodID GeckoAppShell::jLockScreenOrientation = 0;
63 jmethodID GeckoAppShell::jMarkURIVisited = 0;
64 jmethodID GeckoAppShell::jMoveTaskToBack = 0;
65 jmethodID GeckoAppShell::jNetworkLinkType = 0;
66 jmethodID GeckoAppShell::jNotifyDefaultPrevented = 0;
67 jmethodID GeckoAppShell::jNotifyIME = 0;
68 jmethodID GeckoAppShell::jNotifyIMEChange = 0;
69 jmethodID GeckoAppShell::jNotifyIMEContext = 0;
70 jmethodID GeckoAppShell::jNotifyWakeLockChanged = 0;
71 jmethodID GeckoAppShell::jNotifyXreExit = 0;
72 jmethodID GeckoAppShell::jOpenUriExternal = 0;
73 jmethodID GeckoAppShell::jPerformHapticFeedback = 0;
74 jmethodID GeckoAppShell::jPumpMessageLoop = 0;
75 jmethodID GeckoAppShell::jRegisterSurfaceTextureFrameListener = 0;
76 jmethodID GeckoAppShell::jRemovePluginView = 0;
77 jmethodID GeckoAppShell::jScanMedia = 0;
78 jmethodID GeckoAppShell::jScheduleRestart = 0;
79 jmethodID GeckoAppShell::jSendMessageWrapper = 0;
80 jmethodID GeckoAppShell::jSetFullScreen = 0;
81 jmethodID GeckoAppShell::jSetKeepScreenOn = 0;
82 jmethodID GeckoAppShell::jSetURITitle = 0;
83 jmethodID GeckoAppShell::jShowAlertNotificationWrapper = 0;
84 jmethodID GeckoAppShell::jShowInputMethodPicker = 0;
85 jmethodID GeckoAppShell::jUnlockProfile = 0;
86 jmethodID GeckoAppShell::jUnlockScreenOrientation = 0;
87 jmethodID GeckoAppShell::jUnregisterSurfaceTextureFrameListener = 0;
88 jmethodID GeckoAppShell::jVibrate1 = 0;
89 jmethodID GeckoAppShell::jVibrateA = 0;
90 void GeckoAppShell::InitStubs(JNIEnv *jEnv) {
91 initInit();
93 mGeckoAppShellClass = getClassGlobalRef("org/mozilla/gecko/GeckoAppShell");
94 jAcknowledgeEvent = getStaticMethod("acknowledgeEvent", "()V");
95 jAddPluginViewWrapper = getStaticMethod("addPluginView", "(Landroid/view/View;FFFFZ)V");
96 jAlertsProgressListener_OnProgress = getStaticMethod("alertsProgressListener_OnProgress", "(Ljava/lang/String;JJLjava/lang/String;)V");
97 jCancelVibrate = getStaticMethod("cancelVibrate", "()V");
98 jCheckURIVisited = getStaticMethod("checkUriVisited", "(Ljava/lang/String;)V");
99 jClearMessageList = getStaticMethod("clearMessageList", "(I)V");
100 jCloseCamera = getStaticMethod("closeCamera", "()V");
101 jCloseNotification = getStaticMethod("closeNotification", "(Ljava/lang/String;)V");
102 jCreateMessageListWrapper = getStaticMethod("createMessageList", "(JJ[Ljava/lang/String;IIZI)V");
103 jCreateShortcut = getStaticMethod("createShortcut", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
104 jDeleteMessageWrapper = getStaticMethod("deleteMessage", "(II)V");
105 jDisableBatteryNotifications = getStaticMethod("disableBatteryNotifications", "()V");
106 jDisableNetworkNotifications = getStaticMethod("disableNetworkNotifications", "()V");
107 jDisableScreenOrientationNotifications = getStaticMethod("disableScreenOrientationNotifications", "()V");
108 jDisableSensor = getStaticMethod("disableSensor", "(I)V");
109 jEnableBatteryNotifications = getStaticMethod("enableBatteryNotifications", "()V");
110 jEnableLocation = getStaticMethod("enableLocation", "(Z)V");
111 jEnableLocationHighAccuracy = getStaticMethod("enableLocationHighAccuracy", "(Z)V");
112 jEnableNetworkNotifications = getStaticMethod("enableNetworkNotifications", "()V");
113 jEnableScreenOrientationNotifications = getStaticMethod("enableScreenOrientationNotifications", "()V");
114 jEnableSensor = getStaticMethod("enableSensor", "(I)V");
115 jGetContext = getStaticMethod("getContext", "()Landroid/content/Context;");
116 jGetCurrentBatteryInformationWrapper = getStaticMethod("getCurrentBatteryInformation", "()[D");
117 jGetCurrentNetworkInformationWrapper = getStaticMethod("getCurrentNetworkInformation", "()[D");
118 jGetDensity = getStaticMethod("getDensity", "()F");
119 jGetDpiWrapper = getStaticMethod("getDpi", "()I");
120 jGetExtensionFromMimeTypeWrapper = getStaticMethod("getExtensionFromMimeType", "(Ljava/lang/String;)Ljava/lang/String;");
121 jGetHandlersForMimeTypeWrapper = getStaticMethod("getHandlersForMimeType", "(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;");
122 jGetHandlersForURLWrapper = getStaticMethod("getHandlersForURL", "(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;");
123 jGetIconForExtensionWrapper = getStaticMethod("getIconForExtension", "(Ljava/lang/String;I)[B");
124 jGetMessageWrapper = getStaticMethod("getMessage", "(II)V");
125 jGetMimeTypeFromExtensionsWrapper = getStaticMethod("getMimeTypeFromExtensions", "(Ljava/lang/String;)Ljava/lang/String;");
126 jGetNextMessageInListWrapper = getStaticMethod("getNextMessageInList", "(II)V");
127 jGetProxyForURIWrapper = getStaticMethod("getProxyForURI", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;");
128 jGetScreenDepthWrapper = getStaticMethod("getScreenDepth", "()I");
129 jGetScreenOrientationWrapper = getStaticMethod("getScreenOrientation", "()S");
130 jGetShowPasswordSetting = getStaticMethod("getShowPasswordSetting", "()Z");
131 jGetSystemColoursWrapper = getStaticMethod("getSystemColors", "()[I");
132 jHandleGeckoMessageWrapper = getStaticMethod("handleGeckoMessage", "(Lorg/mozilla/gecko/util/NativeJSContainer;)V");
133 jHandleUncaughtException = getStaticMethod("handleUncaughtException", "(Ljava/lang/Thread;Ljava/lang/Throwable;)V");
134 jHideProgressDialog = getStaticMethod("hideProgressDialog", "()V");
135 jInitCameraWrapper = getStaticMethod("initCamera", "(Ljava/lang/String;III)[I");
136 jIsNetworkLinkKnown = getStaticMethod("isNetworkLinkKnown", "()Z");
137 jIsNetworkLinkUp = getStaticMethod("isNetworkLinkUp", "()Z");
138 jIsTablet = getStaticMethod("isTablet", "()Z");
139 jKillAnyZombies = getStaticMethod("killAnyZombies", "()V");
140 jLoadPluginClass = getStaticMethod("loadPluginClass", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Class;");
141 jLockScreenOrientation = getStaticMethod("lockScreenOrientation", "(I)V");
142 jMarkURIVisited = getStaticMethod("markUriVisited", "(Ljava/lang/String;)V");
143 jMoveTaskToBack = getStaticMethod("moveTaskToBack", "()V");
144 jNetworkLinkType = getStaticMethod("networkLinkType", "()I");
145 jNotifyDefaultPrevented = getStaticMethod("notifyDefaultPrevented", "(Z)V");
146 jNotifyIME = getStaticMethod("notifyIME", "(I)V");
147 jNotifyIMEChange = getStaticMethod("notifyIMEChange", "(Ljava/lang/String;III)V");
148 jNotifyIMEContext = getStaticMethod("notifyIMEContext", "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
149 jNotifyWakeLockChanged = getStaticMethod("notifyWakeLockChanged", "(Ljava/lang/String;Ljava/lang/String;)V");
150 jNotifyXreExit = getStaticMethod("onXreExit", "()V");
151 jOpenUriExternal = getStaticMethod("openUriExternal", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z");
152 jPerformHapticFeedback = getStaticMethod("performHapticFeedback", "(Z)V");
153 jPumpMessageLoop = getStaticMethod("pumpMessageLoop", "()Z");
154 jRegisterSurfaceTextureFrameListener = getStaticMethod("registerSurfaceTextureFrameListener", "(Ljava/lang/Object;I)V");
155 jRemovePluginView = getStaticMethod("removePluginView", "(Landroid/view/View;Z)V");
156 jScanMedia = getStaticMethod("scanMedia", "(Ljava/lang/String;Ljava/lang/String;)V");
157 jScheduleRestart = getStaticMethod("scheduleRestart", "()V");
158 jSendMessageWrapper = getStaticMethod("sendMessage", "(Ljava/lang/String;Ljava/lang/String;I)V");
159 jSetFullScreen = getStaticMethod("setFullScreen", "(Z)V");
160 jSetKeepScreenOn = getStaticMethod("setKeepScreenOn", "(Z)V");
161 jSetURITitle = getStaticMethod("setUriTitle", "(Ljava/lang/String;Ljava/lang/String;)V");
162 jShowAlertNotificationWrapper = getStaticMethod("showAlertNotification", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
163 jShowInputMethodPicker = getStaticMethod("showInputMethodPicker", "()V");
164 jUnlockProfile = getStaticMethod("unlockProfile", "()Z");
165 jUnlockScreenOrientation = getStaticMethod("unlockScreenOrientation", "()V");
166 jUnregisterSurfaceTextureFrameListener = getStaticMethod("unregisterSurfaceTextureFrameListener", "(Ljava/lang/Object;)V");
167 jVibrate1 = getStaticMethod("vibrate", "(J)V");
168 jVibrateA = getStaticMethod("vibrate", "([JI)V");
169 }
171 GeckoAppShell* GeckoAppShell::Wrap(jobject obj) {
172 JNIEnv *env = GetJNIForThread();
173 GeckoAppShell* ret = new GeckoAppShell(obj, env);
174 env->DeleteLocalRef(obj);
175 return ret;
176 }
178 void GeckoAppShell::AcknowledgeEvent() {
179 JNIEnv *env = AndroidBridge::GetJNIEnv();
180 if (env->PushLocalFrame(0) != 0) {
181 AndroidBridge::HandleUncaughtException(env);
182 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
183 }
185 env->CallStaticVoidMethod(mGeckoAppShellClass, jAcknowledgeEvent);
186 AndroidBridge::HandleUncaughtException(env);
187 env->PopLocalFrame(nullptr);
188 }
190 void GeckoAppShell::AddPluginViewWrapper(jobject a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, bool a5) {
191 JNIEnv *env = AndroidBridge::GetJNIEnv();
192 if (env->PushLocalFrame(1) != 0) {
193 AndroidBridge::HandleUncaughtException(env);
194 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
195 }
197 jvalue args[6];
198 args[0].l = a0;
199 args[1].f = a1;
200 args[2].f = a2;
201 args[3].f = a3;
202 args[4].f = a4;
203 args[5].z = a5;
205 env->CallStaticVoidMethodA(mGeckoAppShellClass, jAddPluginViewWrapper, args);
206 AndroidBridge::HandleUncaughtException(env);
207 env->PopLocalFrame(nullptr);
208 }
210 void GeckoAppShell::AlertsProgressListener_OnProgress(const nsAString& a0, int64_t a1, int64_t a2, const nsAString& a3) {
211 JNIEnv *env = AndroidBridge::GetJNIEnv();
212 if (env->PushLocalFrame(2) != 0) {
213 AndroidBridge::HandleUncaughtException(env);
214 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
215 }
217 jvalue args[4];
218 args[0].l = AndroidBridge::NewJavaString(env, a0);
219 args[1].j = a1;
220 args[2].j = a2;
221 args[3].l = AndroidBridge::NewJavaString(env, a3);
223 env->CallStaticVoidMethodA(mGeckoAppShellClass, jAlertsProgressListener_OnProgress, args);
224 AndroidBridge::HandleUncaughtException(env);
225 env->PopLocalFrame(nullptr);
226 }
228 void GeckoAppShell::CancelVibrate() {
229 JNIEnv *env = AndroidBridge::GetJNIEnv();
230 if (env->PushLocalFrame(0) != 0) {
231 AndroidBridge::HandleUncaughtException(env);
232 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
233 }
235 env->CallStaticVoidMethod(mGeckoAppShellClass, jCancelVibrate);
236 AndroidBridge::HandleUncaughtException(env);
237 env->PopLocalFrame(nullptr);
238 }
240 void GeckoAppShell::CheckURIVisited(const nsAString& a0) {
241 JNIEnv *env = AndroidBridge::GetJNIEnv();
242 if (env->PushLocalFrame(1) != 0) {
243 AndroidBridge::HandleUncaughtException(env);
244 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
245 }
247 jstring j0 = AndroidBridge::NewJavaString(env, a0);
249 env->CallStaticVoidMethod(mGeckoAppShellClass, jCheckURIVisited, j0);
250 AndroidBridge::HandleUncaughtException(env);
251 env->PopLocalFrame(nullptr);
252 }
254 void GeckoAppShell::ClearMessageList(int32_t a0) {
255 JNIEnv *env = AndroidBridge::GetJNIEnv();
256 if (env->PushLocalFrame(0) != 0) {
257 AndroidBridge::HandleUncaughtException(env);
258 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
259 }
261 env->CallStaticVoidMethod(mGeckoAppShellClass, jClearMessageList, a0);
262 AndroidBridge::HandleUncaughtException(env);
263 env->PopLocalFrame(nullptr);
264 }
266 void GeckoAppShell::CloseCamera() {
267 JNIEnv *env = AndroidBridge::GetJNIEnv();
268 if (env->PushLocalFrame(0) != 0) {
269 AndroidBridge::HandleUncaughtException(env);
270 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
271 }
273 env->CallStaticVoidMethod(mGeckoAppShellClass, jCloseCamera);
274 AndroidBridge::HandleUncaughtException(env);
275 env->PopLocalFrame(nullptr);
276 }
278 void GeckoAppShell::CloseNotification(const nsAString& a0) {
279 JNIEnv *env = AndroidBridge::GetJNIEnv();
280 if (env->PushLocalFrame(1) != 0) {
281 AndroidBridge::HandleUncaughtException(env);
282 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
283 }
285 jstring j0 = AndroidBridge::NewJavaString(env, a0);
287 env->CallStaticVoidMethod(mGeckoAppShellClass, jCloseNotification, j0);
288 AndroidBridge::HandleUncaughtException(env);
289 env->PopLocalFrame(nullptr);
290 }
292 void GeckoAppShell::CreateMessageListWrapper(int64_t a0, int64_t a1, jobjectArray a2, int32_t a3, int32_t a4, bool a5, int32_t a6) {
293 JNIEnv *env = AndroidBridge::GetJNIEnv();
294 if (env->PushLocalFrame(1) != 0) {
295 AndroidBridge::HandleUncaughtException(env);
296 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
297 }
299 jvalue args[7];
300 args[0].j = a0;
301 args[1].j = a1;
302 args[2].l = a2;
303 args[3].i = a3;
304 args[4].i = a4;
305 args[5].z = a5;
306 args[6].i = a6;
308 env->CallStaticVoidMethodA(mGeckoAppShellClass, jCreateMessageListWrapper, args);
309 AndroidBridge::HandleUncaughtException(env);
310 env->PopLocalFrame(nullptr);
311 }
313 void GeckoAppShell::CreateShortcut(const nsAString& a0, const nsAString& a1, const nsAString& a2, const nsAString& a3) {
314 JNIEnv *env = AndroidBridge::GetJNIEnv();
315 if (env->PushLocalFrame(4) != 0) {
316 AndroidBridge::HandleUncaughtException(env);
317 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
318 }
320 jvalue args[4];
321 args[0].l = AndroidBridge::NewJavaString(env, a0);
322 args[1].l = AndroidBridge::NewJavaString(env, a1);
323 args[2].l = AndroidBridge::NewJavaString(env, a2);
324 args[3].l = AndroidBridge::NewJavaString(env, a3);
326 env->CallStaticVoidMethodA(mGeckoAppShellClass, jCreateShortcut, args);
327 AndroidBridge::HandleUncaughtException(env);
328 env->PopLocalFrame(nullptr);
329 }
331 void GeckoAppShell::DeleteMessageWrapper(int32_t a0, int32_t a1) {
332 JNIEnv *env = AndroidBridge::GetJNIEnv();
333 if (env->PushLocalFrame(0) != 0) {
334 AndroidBridge::HandleUncaughtException(env);
335 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
336 }
338 env->CallStaticVoidMethod(mGeckoAppShellClass, jDeleteMessageWrapper, a0, a1);
339 AndroidBridge::HandleUncaughtException(env);
340 env->PopLocalFrame(nullptr);
341 }
343 void GeckoAppShell::DisableBatteryNotifications() {
344 JNIEnv *env = AndroidBridge::GetJNIEnv();
345 if (env->PushLocalFrame(0) != 0) {
346 AndroidBridge::HandleUncaughtException(env);
347 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
348 }
350 env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableBatteryNotifications);
351 AndroidBridge::HandleUncaughtException(env);
352 env->PopLocalFrame(nullptr);
353 }
355 void GeckoAppShell::DisableNetworkNotifications() {
356 JNIEnv *env = AndroidBridge::GetJNIEnv();
357 if (env->PushLocalFrame(0) != 0) {
358 AndroidBridge::HandleUncaughtException(env);
359 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
360 }
362 env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableNetworkNotifications);
363 AndroidBridge::HandleUncaughtException(env);
364 env->PopLocalFrame(nullptr);
365 }
367 void GeckoAppShell::DisableScreenOrientationNotifications() {
368 JNIEnv *env = AndroidBridge::GetJNIEnv();
369 if (env->PushLocalFrame(0) != 0) {
370 AndroidBridge::HandleUncaughtException(env);
371 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
372 }
374 env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableScreenOrientationNotifications);
375 AndroidBridge::HandleUncaughtException(env);
376 env->PopLocalFrame(nullptr);
377 }
379 void GeckoAppShell::DisableSensor(int32_t a0) {
380 JNIEnv *env = AndroidBridge::GetJNIEnv();
381 if (env->PushLocalFrame(0) != 0) {
382 AndroidBridge::HandleUncaughtException(env);
383 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
384 }
386 env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableSensor, a0);
387 AndroidBridge::HandleUncaughtException(env);
388 env->PopLocalFrame(nullptr);
389 }
391 void GeckoAppShell::EnableBatteryNotifications() {
392 JNIEnv *env = AndroidBridge::GetJNIEnv();
393 if (env->PushLocalFrame(0) != 0) {
394 AndroidBridge::HandleUncaughtException(env);
395 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
396 }
398 env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableBatteryNotifications);
399 AndroidBridge::HandleUncaughtException(env);
400 env->PopLocalFrame(nullptr);
401 }
403 void GeckoAppShell::EnableLocation(bool a0) {
404 JNIEnv *env = AndroidBridge::GetJNIEnv();
405 if (env->PushLocalFrame(0) != 0) {
406 AndroidBridge::HandleUncaughtException(env);
407 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
408 }
410 env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableLocation, a0);
411 AndroidBridge::HandleUncaughtException(env);
412 env->PopLocalFrame(nullptr);
413 }
415 void GeckoAppShell::EnableLocationHighAccuracy(bool a0) {
416 JNIEnv *env = AndroidBridge::GetJNIEnv();
417 if (env->PushLocalFrame(0) != 0) {
418 AndroidBridge::HandleUncaughtException(env);
419 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
420 }
422 env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableLocationHighAccuracy, a0);
423 AndroidBridge::HandleUncaughtException(env);
424 env->PopLocalFrame(nullptr);
425 }
427 void GeckoAppShell::EnableNetworkNotifications() {
428 JNIEnv *env = AndroidBridge::GetJNIEnv();
429 if (env->PushLocalFrame(0) != 0) {
430 AndroidBridge::HandleUncaughtException(env);
431 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
432 }
434 env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableNetworkNotifications);
435 AndroidBridge::HandleUncaughtException(env);
436 env->PopLocalFrame(nullptr);
437 }
439 void GeckoAppShell::EnableScreenOrientationNotifications() {
440 JNIEnv *env = AndroidBridge::GetJNIEnv();
441 if (env->PushLocalFrame(0) != 0) {
442 AndroidBridge::HandleUncaughtException(env);
443 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
444 }
446 env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableScreenOrientationNotifications);
447 AndroidBridge::HandleUncaughtException(env);
448 env->PopLocalFrame(nullptr);
449 }
451 void GeckoAppShell::EnableSensor(int32_t a0) {
452 JNIEnv *env = AndroidBridge::GetJNIEnv();
453 if (env->PushLocalFrame(0) != 0) {
454 AndroidBridge::HandleUncaughtException(env);
455 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
456 }
458 env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableSensor, a0);
459 AndroidBridge::HandleUncaughtException(env);
460 env->PopLocalFrame(nullptr);
461 }
463 jobject GeckoAppShell::GetContext() {
464 JNIEnv *env = GetJNIForThread();
465 if (env->PushLocalFrame(1) != 0) {
466 AndroidBridge::HandleUncaughtException(env);
467 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
468 }
470 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetContext);
471 AndroidBridge::HandleUncaughtException(env);
472 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
473 return ret;
474 }
476 jdoubleArray GeckoAppShell::GetCurrentBatteryInformationWrapper() {
477 JNIEnv *env = AndroidBridge::GetJNIEnv();
478 if (env->PushLocalFrame(1) != 0) {
479 AndroidBridge::HandleUncaughtException(env);
480 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
481 }
483 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetCurrentBatteryInformationWrapper);
484 AndroidBridge::HandleUncaughtException(env);
485 jdoubleArray ret = static_cast<jdoubleArray>(env->PopLocalFrame(temp));
486 return ret;
487 }
489 jdoubleArray GeckoAppShell::GetCurrentNetworkInformationWrapper() {
490 JNIEnv *env = AndroidBridge::GetJNIEnv();
491 if (env->PushLocalFrame(1) != 0) {
492 AndroidBridge::HandleUncaughtException(env);
493 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
494 }
496 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetCurrentNetworkInformationWrapper);
497 AndroidBridge::HandleUncaughtException(env);
498 jdoubleArray ret = static_cast<jdoubleArray>(env->PopLocalFrame(temp));
499 return ret;
500 }
502 jfloat GeckoAppShell::GetDensity() {
503 JNIEnv *env = AndroidBridge::GetJNIEnv();
504 if (env->PushLocalFrame(0) != 0) {
505 AndroidBridge::HandleUncaughtException(env);
506 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
507 }
509 jfloat temp = env->CallStaticFloatMethod(mGeckoAppShellClass, jGetDensity);
510 AndroidBridge::HandleUncaughtException(env);
511 env->PopLocalFrame(nullptr);
512 return temp;
513 }
515 int32_t GeckoAppShell::GetDpiWrapper() {
516 JNIEnv *env = AndroidBridge::GetJNIEnv();
517 if (env->PushLocalFrame(0) != 0) {
518 AndroidBridge::HandleUncaughtException(env);
519 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
520 }
522 int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jGetDpiWrapper);
523 AndroidBridge::HandleUncaughtException(env);
524 env->PopLocalFrame(nullptr);
525 return temp;
526 }
528 jstring GeckoAppShell::GetExtensionFromMimeTypeWrapper(const nsAString& a0) {
529 JNIEnv *env = AndroidBridge::GetJNIEnv();
530 if (env->PushLocalFrame(2) != 0) {
531 AndroidBridge::HandleUncaughtException(env);
532 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
533 }
535 jstring j0 = AndroidBridge::NewJavaString(env, a0);
537 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetExtensionFromMimeTypeWrapper, j0);
538 AndroidBridge::HandleUncaughtException(env);
539 jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
540 return ret;
541 }
543 jobjectArray GeckoAppShell::GetHandlersForMimeTypeWrapper(const nsAString& a0, const nsAString& a1) {
544 JNIEnv *env = AndroidBridge::GetJNIEnv();
545 if (env->PushLocalFrame(3) != 0) {
546 AndroidBridge::HandleUncaughtException(env);
547 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
548 }
550 jstring j0 = AndroidBridge::NewJavaString(env, a0);
551 jstring j1 = AndroidBridge::NewJavaString(env, a1);
553 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetHandlersForMimeTypeWrapper, j0, j1);
554 AndroidBridge::HandleUncaughtException(env);
555 jobjectArray ret = static_cast<jobjectArray>(env->PopLocalFrame(temp));
556 return ret;
557 }
559 jobjectArray GeckoAppShell::GetHandlersForURLWrapper(const nsAString& a0, const nsAString& a1) {
560 JNIEnv *env = AndroidBridge::GetJNIEnv();
561 if (env->PushLocalFrame(3) != 0) {
562 AndroidBridge::HandleUncaughtException(env);
563 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
564 }
566 jstring j0 = AndroidBridge::NewJavaString(env, a0);
567 jstring j1 = AndroidBridge::NewJavaString(env, a1);
569 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetHandlersForURLWrapper, j0, j1);
570 AndroidBridge::HandleUncaughtException(env);
571 jobjectArray ret = static_cast<jobjectArray>(env->PopLocalFrame(temp));
572 return ret;
573 }
575 jbyteArray GeckoAppShell::GetIconForExtensionWrapper(const nsAString& a0, int32_t a1) {
576 JNIEnv *env = AndroidBridge::GetJNIEnv();
577 if (env->PushLocalFrame(2) != 0) {
578 AndroidBridge::HandleUncaughtException(env);
579 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
580 }
582 jstring j0 = AndroidBridge::NewJavaString(env, a0);
584 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetIconForExtensionWrapper, j0, a1);
585 AndroidBridge::HandleUncaughtException(env);
586 jbyteArray ret = static_cast<jbyteArray>(env->PopLocalFrame(temp));
587 return ret;
588 }
590 void GeckoAppShell::GetMessageWrapper(int32_t a0, int32_t a1) {
591 JNIEnv *env = AndroidBridge::GetJNIEnv();
592 if (env->PushLocalFrame(0) != 0) {
593 AndroidBridge::HandleUncaughtException(env);
594 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
595 }
597 env->CallStaticVoidMethod(mGeckoAppShellClass, jGetMessageWrapper, a0, a1);
598 AndroidBridge::HandleUncaughtException(env);
599 env->PopLocalFrame(nullptr);
600 }
602 jstring GeckoAppShell::GetMimeTypeFromExtensionsWrapper(const nsAString& a0) {
603 JNIEnv *env = AndroidBridge::GetJNIEnv();
604 if (env->PushLocalFrame(2) != 0) {
605 AndroidBridge::HandleUncaughtException(env);
606 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
607 }
609 jstring j0 = AndroidBridge::NewJavaString(env, a0);
611 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetMimeTypeFromExtensionsWrapper, j0);
612 AndroidBridge::HandleUncaughtException(env);
613 jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
614 return ret;
615 }
617 void GeckoAppShell::GetNextMessageInListWrapper(int32_t a0, int32_t a1) {
618 JNIEnv *env = AndroidBridge::GetJNIEnv();
619 if (env->PushLocalFrame(0) != 0) {
620 AndroidBridge::HandleUncaughtException(env);
621 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
622 }
624 env->CallStaticVoidMethod(mGeckoAppShellClass, jGetNextMessageInListWrapper, a0, a1);
625 AndroidBridge::HandleUncaughtException(env);
626 env->PopLocalFrame(nullptr);
627 }
629 jstring GeckoAppShell::GetProxyForURIWrapper(const nsAString& a0, const nsAString& a1, const nsAString& a2, int32_t a3) {
630 JNIEnv *env = AndroidBridge::GetJNIEnv();
631 if (env->PushLocalFrame(4) != 0) {
632 AndroidBridge::HandleUncaughtException(env);
633 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
634 }
636 jvalue args[4];
637 args[0].l = AndroidBridge::NewJavaString(env, a0);
638 args[1].l = AndroidBridge::NewJavaString(env, a1);
639 args[2].l = AndroidBridge::NewJavaString(env, a2);
640 args[3].i = a3;
642 jobject temp = env->CallStaticObjectMethodA(mGeckoAppShellClass, jGetProxyForURIWrapper, args);
643 AndroidBridge::HandleUncaughtException(env);
644 jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
645 return ret;
646 }
648 int32_t GeckoAppShell::GetScreenDepthWrapper() {
649 JNIEnv *env = AndroidBridge::GetJNIEnv();
650 if (env->PushLocalFrame(0) != 0) {
651 AndroidBridge::HandleUncaughtException(env);
652 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
653 }
655 int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jGetScreenDepthWrapper);
656 AndroidBridge::HandleUncaughtException(env);
657 env->PopLocalFrame(nullptr);
658 return temp;
659 }
661 int16_t GeckoAppShell::GetScreenOrientationWrapper() {
662 JNIEnv *env = AndroidBridge::GetJNIEnv();
663 if (env->PushLocalFrame(0) != 0) {
664 AndroidBridge::HandleUncaughtException(env);
665 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
666 }
668 int16_t temp = env->CallStaticShortMethod(mGeckoAppShellClass, jGetScreenOrientationWrapper);
669 AndroidBridge::HandleUncaughtException(env);
670 env->PopLocalFrame(nullptr);
671 return temp;
672 }
674 bool GeckoAppShell::GetShowPasswordSetting() {
675 JNIEnv *env = AndroidBridge::GetJNIEnv();
676 if (env->PushLocalFrame(0) != 0) {
677 AndroidBridge::HandleUncaughtException(env);
678 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
679 }
681 bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jGetShowPasswordSetting);
682 AndroidBridge::HandleUncaughtException(env);
683 env->PopLocalFrame(nullptr);
684 return temp;
685 }
687 jintArray GeckoAppShell::GetSystemColoursWrapper() {
688 JNIEnv *env = AndroidBridge::GetJNIEnv();
689 if (env->PushLocalFrame(1) != 0) {
690 AndroidBridge::HandleUncaughtException(env);
691 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
692 }
694 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetSystemColoursWrapper);
695 AndroidBridge::HandleUncaughtException(env);
696 jintArray ret = static_cast<jintArray>(env->PopLocalFrame(temp));
697 return ret;
698 }
700 void GeckoAppShell::HandleGeckoMessageWrapper(jobject a0) {
701 JNIEnv *env = AndroidBridge::GetJNIEnv();
702 if (env->PushLocalFrame(1) != 0) {
703 AndroidBridge::HandleUncaughtException(env);
704 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
705 }
707 env->CallStaticVoidMethod(mGeckoAppShellClass, jHandleGeckoMessageWrapper, a0);
708 AndroidBridge::HandleUncaughtException(env);
709 env->PopLocalFrame(nullptr);
710 }
712 void GeckoAppShell::HandleUncaughtException(jobject a0, jthrowable a1) {
713 JNIEnv *env = GetJNIForThread();
714 if (env->PushLocalFrame(2) != 0) {
715 return;
716 }
718 env->CallStaticVoidMethod(mGeckoAppShellClass, jHandleUncaughtException, a0, a1);
719 env->PopLocalFrame(nullptr);
720 }
722 void GeckoAppShell::HideProgressDialog() {
723 JNIEnv *env = AndroidBridge::GetJNIEnv();
724 if (env->PushLocalFrame(0) != 0) {
725 AndroidBridge::HandleUncaughtException(env);
726 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
727 }
729 env->CallStaticVoidMethod(mGeckoAppShellClass, jHideProgressDialog);
730 AndroidBridge::HandleUncaughtException(env);
731 env->PopLocalFrame(nullptr);
732 }
734 jintArray GeckoAppShell::InitCameraWrapper(const nsAString& a0, int32_t a1, int32_t a2, int32_t a3) {
735 JNIEnv *env = AndroidBridge::GetJNIEnv();
736 if (env->PushLocalFrame(2) != 0) {
737 AndroidBridge::HandleUncaughtException(env);
738 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
739 }
741 jvalue args[4];
742 args[0].l = AndroidBridge::NewJavaString(env, a0);
743 args[1].i = a1;
744 args[2].i = a2;
745 args[3].i = a3;
747 jobject temp = env->CallStaticObjectMethodA(mGeckoAppShellClass, jInitCameraWrapper, args);
748 AndroidBridge::HandleUncaughtException(env);
749 jintArray ret = static_cast<jintArray>(env->PopLocalFrame(temp));
750 return ret;
751 }
753 bool GeckoAppShell::IsNetworkLinkKnown() {
754 JNIEnv *env = AndroidBridge::GetJNIEnv();
755 if (env->PushLocalFrame(0) != 0) {
756 AndroidBridge::HandleUncaughtException(env);
757 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
758 }
760 bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsNetworkLinkKnown);
761 AndroidBridge::HandleUncaughtException(env);
762 env->PopLocalFrame(nullptr);
763 return temp;
764 }
766 bool GeckoAppShell::IsNetworkLinkUp() {
767 JNIEnv *env = AndroidBridge::GetJNIEnv();
768 if (env->PushLocalFrame(0) != 0) {
769 AndroidBridge::HandleUncaughtException(env);
770 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
771 }
773 bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsNetworkLinkUp);
774 AndroidBridge::HandleUncaughtException(env);
775 env->PopLocalFrame(nullptr);
776 return temp;
777 }
779 bool GeckoAppShell::IsTablet() {
780 JNIEnv *env = AndroidBridge::GetJNIEnv();
781 if (env->PushLocalFrame(0) != 0) {
782 AndroidBridge::HandleUncaughtException(env);
783 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
784 }
786 bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsTablet);
787 AndroidBridge::HandleUncaughtException(env);
788 env->PopLocalFrame(nullptr);
789 return temp;
790 }
792 void GeckoAppShell::KillAnyZombies() {
793 JNIEnv *env = AndroidBridge::GetJNIEnv();
794 if (env->PushLocalFrame(0) != 0) {
795 AndroidBridge::HandleUncaughtException(env);
796 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
797 }
799 env->CallStaticVoidMethod(mGeckoAppShellClass, jKillAnyZombies);
800 AndroidBridge::HandleUncaughtException(env);
801 env->PopLocalFrame(nullptr);
802 }
804 jclass GeckoAppShell::LoadPluginClass(const nsAString& a0, const nsAString& a1) {
805 JNIEnv *env = GetJNIForThread();
806 if (env->PushLocalFrame(3) != 0) {
807 AndroidBridge::HandleUncaughtException(env);
808 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
809 }
811 jstring j0 = AndroidBridge::NewJavaString(env, a0);
812 jstring j1 = AndroidBridge::NewJavaString(env, a1);
814 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jLoadPluginClass, j0, j1);
815 AndroidBridge::HandleUncaughtException(env);
816 jclass ret = static_cast<jclass>(env->PopLocalFrame(temp));
817 return ret;
818 }
820 void GeckoAppShell::LockScreenOrientation(int32_t a0) {
821 JNIEnv *env = AndroidBridge::GetJNIEnv();
822 if (env->PushLocalFrame(0) != 0) {
823 AndroidBridge::HandleUncaughtException(env);
824 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
825 }
827 env->CallStaticVoidMethod(mGeckoAppShellClass, jLockScreenOrientation, a0);
828 AndroidBridge::HandleUncaughtException(env);
829 env->PopLocalFrame(nullptr);
830 }
832 void GeckoAppShell::MarkURIVisited(const nsAString& a0) {
833 JNIEnv *env = AndroidBridge::GetJNIEnv();
834 if (env->PushLocalFrame(1) != 0) {
835 AndroidBridge::HandleUncaughtException(env);
836 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
837 }
839 jstring j0 = AndroidBridge::NewJavaString(env, a0);
841 env->CallStaticVoidMethod(mGeckoAppShellClass, jMarkURIVisited, j0);
842 AndroidBridge::HandleUncaughtException(env);
843 env->PopLocalFrame(nullptr);
844 }
846 void GeckoAppShell::MoveTaskToBack() {
847 JNIEnv *env = AndroidBridge::GetJNIEnv();
848 if (env->PushLocalFrame(0) != 0) {
849 AndroidBridge::HandleUncaughtException(env);
850 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
851 }
853 env->CallStaticVoidMethod(mGeckoAppShellClass, jMoveTaskToBack);
854 AndroidBridge::HandleUncaughtException(env);
855 env->PopLocalFrame(nullptr);
856 }
858 int32_t GeckoAppShell::NetworkLinkType() {
859 JNIEnv *env = AndroidBridge::GetJNIEnv();
860 if (env->PushLocalFrame(0) != 0) {
861 AndroidBridge::HandleUncaughtException(env);
862 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
863 }
865 int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jNetworkLinkType);
866 AndroidBridge::HandleUncaughtException(env);
867 env->PopLocalFrame(nullptr);
868 return temp;
869 }
871 void GeckoAppShell::NotifyDefaultPrevented(bool a0) {
872 JNIEnv *env = AndroidBridge::GetJNIEnv();
873 if (env->PushLocalFrame(0) != 0) {
874 AndroidBridge::HandleUncaughtException(env);
875 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
876 }
878 env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyDefaultPrevented, a0);
879 AndroidBridge::HandleUncaughtException(env);
880 env->PopLocalFrame(nullptr);
881 }
883 void GeckoAppShell::NotifyIME(int32_t a0) {
884 JNIEnv *env = AndroidBridge::GetJNIEnv();
885 if (env->PushLocalFrame(0) != 0) {
886 AndroidBridge::HandleUncaughtException(env);
887 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
888 }
890 env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyIME, a0);
891 AndroidBridge::HandleUncaughtException(env);
892 env->PopLocalFrame(nullptr);
893 }
895 void GeckoAppShell::NotifyIMEChange(const nsAString& a0, int32_t a1, int32_t a2, int32_t a3) {
896 JNIEnv *env = AndroidBridge::GetJNIEnv();
897 if (env->PushLocalFrame(1) != 0) {
898 AndroidBridge::HandleUncaughtException(env);
899 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
900 }
902 jvalue args[4];
903 args[0].l = AndroidBridge::NewJavaString(env, a0);
904 args[1].i = a1;
905 args[2].i = a2;
906 args[3].i = a3;
908 env->CallStaticVoidMethodA(mGeckoAppShellClass, jNotifyIMEChange, args);
909 AndroidBridge::HandleUncaughtException(env);
910 env->PopLocalFrame(nullptr);
911 }
913 void GeckoAppShell::NotifyIMEContext(int32_t a0, const nsAString& a1, const nsAString& a2, const nsAString& a3) {
914 JNIEnv *env = AndroidBridge::GetJNIEnv();
915 if (env->PushLocalFrame(3) != 0) {
916 AndroidBridge::HandleUncaughtException(env);
917 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
918 }
920 jvalue args[4];
921 args[0].i = a0;
922 args[1].l = AndroidBridge::NewJavaString(env, a1);
923 args[2].l = AndroidBridge::NewJavaString(env, a2);
924 args[3].l = AndroidBridge::NewJavaString(env, a3);
926 env->CallStaticVoidMethodA(mGeckoAppShellClass, jNotifyIMEContext, args);
927 AndroidBridge::HandleUncaughtException(env);
928 env->PopLocalFrame(nullptr);
929 }
931 void GeckoAppShell::NotifyWakeLockChanged(const nsAString& a0, const nsAString& a1) {
932 JNIEnv *env = AndroidBridge::GetJNIEnv();
933 if (env->PushLocalFrame(2) != 0) {
934 AndroidBridge::HandleUncaughtException(env);
935 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
936 }
938 jstring j0 = AndroidBridge::NewJavaString(env, a0);
939 jstring j1 = AndroidBridge::NewJavaString(env, a1);
941 env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyWakeLockChanged, j0, j1);
942 AndroidBridge::HandleUncaughtException(env);
943 env->PopLocalFrame(nullptr);
944 }
946 void GeckoAppShell::NotifyXreExit() {
947 JNIEnv *env = AndroidBridge::GetJNIEnv();
948 if (env->PushLocalFrame(0) != 0) {
949 AndroidBridge::HandleUncaughtException(env);
950 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
951 }
953 env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyXreExit);
954 AndroidBridge::HandleUncaughtException(env);
955 env->PopLocalFrame(nullptr);
956 }
958 bool GeckoAppShell::OpenUriExternal(const nsAString& a0, const nsAString& a1, const nsAString& a2, const nsAString& a3, const nsAString& a4, const nsAString& a5) {
959 JNIEnv *env = AndroidBridge::GetJNIEnv();
960 if (env->PushLocalFrame(6) != 0) {
961 AndroidBridge::HandleUncaughtException(env);
962 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
963 }
965 jvalue args[6];
966 args[0].l = AndroidBridge::NewJavaString(env, a0);
967 args[1].l = AndroidBridge::NewJavaString(env, a1);
968 args[2].l = AndroidBridge::NewJavaString(env, a2);
969 args[3].l = AndroidBridge::NewJavaString(env, a3);
970 args[4].l = AndroidBridge::NewJavaString(env, a4);
971 args[5].l = AndroidBridge::NewJavaString(env, a5);
973 bool temp = env->CallStaticBooleanMethodA(mGeckoAppShellClass, jOpenUriExternal, args);
974 AndroidBridge::HandleUncaughtException(env);
975 env->PopLocalFrame(nullptr);
976 return temp;
977 }
979 void GeckoAppShell::PerformHapticFeedback(bool a0) {
980 JNIEnv *env = AndroidBridge::GetJNIEnv();
981 if (env->PushLocalFrame(0) != 0) {
982 AndroidBridge::HandleUncaughtException(env);
983 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
984 }
986 env->CallStaticVoidMethod(mGeckoAppShellClass, jPerformHapticFeedback, a0);
987 AndroidBridge::HandleUncaughtException(env);
988 env->PopLocalFrame(nullptr);
989 }
991 bool GeckoAppShell::PumpMessageLoop() {
992 JNIEnv *env = AndroidBridge::GetJNIEnv();
993 if (env->PushLocalFrame(0) != 0) {
994 AndroidBridge::HandleUncaughtException(env);
995 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
996 }
998 bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jPumpMessageLoop);
999 AndroidBridge::HandleUncaughtException(env);
1000 env->PopLocalFrame(nullptr);
1001 return temp;
1002 }
1004 void GeckoAppShell::RegisterSurfaceTextureFrameListener(jobject a0, int32_t a1) {
1005 JNIEnv *env = AndroidBridge::GetJNIEnv();
1006 if (env->PushLocalFrame(1) != 0) {
1007 AndroidBridge::HandleUncaughtException(env);
1008 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1009 }
1011 env->CallStaticVoidMethod(mGeckoAppShellClass, jRegisterSurfaceTextureFrameListener, a0, a1);
1012 AndroidBridge::HandleUncaughtException(env);
1013 env->PopLocalFrame(nullptr);
1014 }
1016 void GeckoAppShell::RemovePluginView(jobject a0, bool a1) {
1017 JNIEnv *env = AndroidBridge::GetJNIEnv();
1018 if (env->PushLocalFrame(1) != 0) {
1019 AndroidBridge::HandleUncaughtException(env);
1020 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1021 }
1023 env->CallStaticVoidMethod(mGeckoAppShellClass, jRemovePluginView, a0, a1);
1024 AndroidBridge::HandleUncaughtException(env);
1025 env->PopLocalFrame(nullptr);
1026 }
1028 void GeckoAppShell::ScanMedia(const nsAString& a0, const nsAString& a1) {
1029 JNIEnv *env = AndroidBridge::GetJNIEnv();
1030 if (env->PushLocalFrame(2) != 0) {
1031 AndroidBridge::HandleUncaughtException(env);
1032 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1033 }
1035 jstring j0 = AndroidBridge::NewJavaString(env, a0);
1036 jstring j1 = AndroidBridge::NewJavaString(env, a1);
1038 env->CallStaticVoidMethod(mGeckoAppShellClass, jScanMedia, j0, j1);
1039 AndroidBridge::HandleUncaughtException(env);
1040 env->PopLocalFrame(nullptr);
1041 }
1043 void GeckoAppShell::ScheduleRestart() {
1044 JNIEnv *env = AndroidBridge::GetJNIEnv();
1045 if (env->PushLocalFrame(0) != 0) {
1046 AndroidBridge::HandleUncaughtException(env);
1047 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1048 }
1050 env->CallStaticVoidMethod(mGeckoAppShellClass, jScheduleRestart);
1051 AndroidBridge::HandleUncaughtException(env);
1052 env->PopLocalFrame(nullptr);
1053 }
1055 void GeckoAppShell::SendMessageWrapper(const nsAString& a0, const nsAString& a1, int32_t a2) {
1056 JNIEnv *env = AndroidBridge::GetJNIEnv();
1057 if (env->PushLocalFrame(2) != 0) {
1058 AndroidBridge::HandleUncaughtException(env);
1059 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1060 }
1062 jvalue args[3];
1063 args[0].l = AndroidBridge::NewJavaString(env, a0);
1064 args[1].l = AndroidBridge::NewJavaString(env, a1);
1065 args[2].i = a2;
1067 env->CallStaticVoidMethodA(mGeckoAppShellClass, jSendMessageWrapper, args);
1068 AndroidBridge::HandleUncaughtException(env);
1069 env->PopLocalFrame(nullptr);
1070 }
1072 void GeckoAppShell::SetFullScreen(bool a0) {
1073 JNIEnv *env = AndroidBridge::GetJNIEnv();
1074 if (env->PushLocalFrame(0) != 0) {
1075 AndroidBridge::HandleUncaughtException(env);
1076 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1077 }
1079 env->CallStaticVoidMethod(mGeckoAppShellClass, jSetFullScreen, a0);
1080 AndroidBridge::HandleUncaughtException(env);
1081 env->PopLocalFrame(nullptr);
1082 }
1084 void GeckoAppShell::SetKeepScreenOn(bool a0) {
1085 JNIEnv *env = AndroidBridge::GetJNIEnv();
1086 if (env->PushLocalFrame(0) != 0) {
1087 AndroidBridge::HandleUncaughtException(env);
1088 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1089 }
1091 env->CallStaticVoidMethod(mGeckoAppShellClass, jSetKeepScreenOn, a0);
1092 AndroidBridge::HandleUncaughtException(env);
1093 env->PopLocalFrame(nullptr);
1094 }
1096 void GeckoAppShell::SetURITitle(const nsAString& a0, const nsAString& a1) {
1097 JNIEnv *env = AndroidBridge::GetJNIEnv();
1098 if (env->PushLocalFrame(2) != 0) {
1099 AndroidBridge::HandleUncaughtException(env);
1100 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1101 }
1103 jstring j0 = AndroidBridge::NewJavaString(env, a0);
1104 jstring j1 = AndroidBridge::NewJavaString(env, a1);
1106 env->CallStaticVoidMethod(mGeckoAppShellClass, jSetURITitle, j0, j1);
1107 AndroidBridge::HandleUncaughtException(env);
1108 env->PopLocalFrame(nullptr);
1109 }
1111 void GeckoAppShell::ShowAlertNotificationWrapper(const nsAString& a0, const nsAString& a1, const nsAString& a2, const nsAString& a3, const nsAString& a4) {
1112 JNIEnv *env = AndroidBridge::GetJNIEnv();
1113 if (env->PushLocalFrame(5) != 0) {
1114 AndroidBridge::HandleUncaughtException(env);
1115 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1116 }
1118 jvalue args[5];
1119 args[0].l = AndroidBridge::NewJavaString(env, a0);
1120 args[1].l = AndroidBridge::NewJavaString(env, a1);
1121 args[2].l = AndroidBridge::NewJavaString(env, a2);
1122 args[3].l = AndroidBridge::NewJavaString(env, a3);
1123 args[4].l = AndroidBridge::NewJavaString(env, a4);
1125 env->CallStaticVoidMethodA(mGeckoAppShellClass, jShowAlertNotificationWrapper, args);
1126 AndroidBridge::HandleUncaughtException(env);
1127 env->PopLocalFrame(nullptr);
1128 }
1130 void GeckoAppShell::ShowInputMethodPicker() {
1131 JNIEnv *env = AndroidBridge::GetJNIEnv();
1132 if (env->PushLocalFrame(0) != 0) {
1133 AndroidBridge::HandleUncaughtException(env);
1134 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1135 }
1137 env->CallStaticVoidMethod(mGeckoAppShellClass, jShowInputMethodPicker);
1138 AndroidBridge::HandleUncaughtException(env);
1139 env->PopLocalFrame(nullptr);
1140 }
1142 bool GeckoAppShell::UnlockProfile() {
1143 JNIEnv *env = AndroidBridge::GetJNIEnv();
1144 if (env->PushLocalFrame(0) != 0) {
1145 AndroidBridge::HandleUncaughtException(env);
1146 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1147 }
1149 bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jUnlockProfile);
1150 AndroidBridge::HandleUncaughtException(env);
1151 env->PopLocalFrame(nullptr);
1152 return temp;
1153 }
1155 void GeckoAppShell::UnlockScreenOrientation() {
1156 JNIEnv *env = AndroidBridge::GetJNIEnv();
1157 if (env->PushLocalFrame(0) != 0) {
1158 AndroidBridge::HandleUncaughtException(env);
1159 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1160 }
1162 env->CallStaticVoidMethod(mGeckoAppShellClass, jUnlockScreenOrientation);
1163 AndroidBridge::HandleUncaughtException(env);
1164 env->PopLocalFrame(nullptr);
1165 }
1167 void GeckoAppShell::UnregisterSurfaceTextureFrameListener(jobject a0) {
1168 JNIEnv *env = GetJNIForThread();
1169 if (env->PushLocalFrame(1) != 0) {
1170 AndroidBridge::HandleUncaughtException(env);
1171 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1172 }
1174 env->CallStaticVoidMethod(mGeckoAppShellClass, jUnregisterSurfaceTextureFrameListener, a0);
1175 AndroidBridge::HandleUncaughtException(env);
1176 env->PopLocalFrame(nullptr);
1177 }
1179 void GeckoAppShell::Vibrate1(int64_t a0) {
1180 JNIEnv *env = AndroidBridge::GetJNIEnv();
1181 if (env->PushLocalFrame(0) != 0) {
1182 AndroidBridge::HandleUncaughtException(env);
1183 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1184 }
1186 env->CallStaticVoidMethod(mGeckoAppShellClass, jVibrate1, a0);
1187 AndroidBridge::HandleUncaughtException(env);
1188 env->PopLocalFrame(nullptr);
1189 }
1191 void GeckoAppShell::VibrateA(jlongArray a0, int32_t a1) {
1192 JNIEnv *env = AndroidBridge::GetJNIEnv();
1193 if (env->PushLocalFrame(1) != 0) {
1194 AndroidBridge::HandleUncaughtException(env);
1195 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1196 }
1198 env->CallStaticVoidMethod(mGeckoAppShellClass, jVibrateA, a0, a1);
1199 AndroidBridge::HandleUncaughtException(env);
1200 env->PopLocalFrame(nullptr);
1201 }
1202 jclass JavaDomKeyLocation::mDomKeyLocationClass = 0;
1203 jmethodID JavaDomKeyLocation::jvalueOf = 0;
1204 jmethodID JavaDomKeyLocation::jvalues = 0;
1205 jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_JOYSTICK = 0;
1206 jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_LEFT = 0;
1207 jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_MOBILE = 0;
1208 jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_NUMPAD = 0;
1209 jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_RIGHT = 0;
1210 jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_STANDARD = 0;
1211 jfieldID JavaDomKeyLocation::jvalue = 0;
1212 void JavaDomKeyLocation::InitStubs(JNIEnv *jEnv) {
1213 initInit();
1215 mDomKeyLocationClass = getClassGlobalRef("org/mozilla/gecko/GeckoEvent$DomKeyLocation");
1216 jvalueOf = getStaticMethod("valueOf", "(Ljava/lang/String;)Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
1217 jvalues = getStaticMethod("values", "()[Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
1218 jDOM_KEY_LOCATION_JOYSTICK = getStaticField("DOM_KEY_LOCATION_JOYSTICK", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
1219 jDOM_KEY_LOCATION_LEFT = getStaticField("DOM_KEY_LOCATION_LEFT", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
1220 jDOM_KEY_LOCATION_MOBILE = getStaticField("DOM_KEY_LOCATION_MOBILE", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
1221 jDOM_KEY_LOCATION_NUMPAD = getStaticField("DOM_KEY_LOCATION_NUMPAD", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
1222 jDOM_KEY_LOCATION_RIGHT = getStaticField("DOM_KEY_LOCATION_RIGHT", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
1223 jDOM_KEY_LOCATION_STANDARD = getStaticField("DOM_KEY_LOCATION_STANDARD", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
1224 jvalue = getField("value", "I");
1225 }
1227 JavaDomKeyLocation* JavaDomKeyLocation::Wrap(jobject obj) {
1228 JNIEnv *env = GetJNIForThread();
1229 JavaDomKeyLocation* ret = new JavaDomKeyLocation(obj, env);
1230 env->DeleteLocalRef(obj);
1231 return ret;
1232 }
1234 jobject JavaDomKeyLocation::valueOf(const nsAString& a0) {
1235 JNIEnv *env = AndroidBridge::GetJNIEnv();
1236 if (env->PushLocalFrame(2) != 0) {
1237 AndroidBridge::HandleUncaughtException(env);
1238 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1239 }
1241 jstring j0 = AndroidBridge::NewJavaString(env, a0);
1243 jobject temp = env->CallStaticObjectMethod(mDomKeyLocationClass, jvalueOf, j0);
1244 AndroidBridge::HandleUncaughtException(env);
1245 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
1246 return ret;
1247 }
1249 jobjectArray JavaDomKeyLocation::values() {
1250 JNIEnv *env = AndroidBridge::GetJNIEnv();
1251 if (env->PushLocalFrame(1) != 0) {
1252 AndroidBridge::HandleUncaughtException(env);
1253 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1254 }
1256 jobject temp = env->CallStaticObjectMethod(mDomKeyLocationClass, jvalues);
1257 AndroidBridge::HandleUncaughtException(env);
1258 jobjectArray ret = static_cast<jobjectArray>(env->PopLocalFrame(temp));
1259 return ret;
1260 }
1262 jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_JOYSTICK() {
1263 JNIEnv *env = GetJNIForThread();
1264 return static_cast<jobject>(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_JOYSTICK));
1265 }
1267 jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_LEFT() {
1268 JNIEnv *env = GetJNIForThread();
1269 return static_cast<jobject>(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_LEFT));
1270 }
1272 jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_MOBILE() {
1273 JNIEnv *env = GetJNIForThread();
1274 return static_cast<jobject>(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_MOBILE));
1275 }
1277 jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_NUMPAD() {
1278 JNIEnv *env = GetJNIForThread();
1279 return static_cast<jobject>(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_NUMPAD));
1280 }
1282 jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_RIGHT() {
1283 JNIEnv *env = GetJNIForThread();
1284 return static_cast<jobject>(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_RIGHT));
1285 }
1287 jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_STANDARD() {
1288 JNIEnv *env = GetJNIForThread();
1289 return static_cast<jobject>(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_STANDARD));
1290 }
1292 int32_t JavaDomKeyLocation::getvalue() {
1293 JNIEnv *env = GetJNIForThread();
1294 return env->GetIntField(wrapped_obj, jvalue);
1295 }
1296 jclass GeckoJavaSampler::mGeckoJavaSamplerClass = 0;
1297 jmethodID GeckoJavaSampler::jGetFrameNameJavaProfilingWrapper = 0;
1298 jmethodID GeckoJavaSampler::jGetSampleTimeJavaProfiling = 0;
1299 jmethodID GeckoJavaSampler::jGetThreadNameJavaProfilingWrapper = 0;
1300 jmethodID GeckoJavaSampler::jPauseJavaProfiling = 0;
1301 jmethodID GeckoJavaSampler::jStartJavaProfiling = 0;
1302 jmethodID GeckoJavaSampler::jStopJavaProfiling = 0;
1303 jmethodID GeckoJavaSampler::jUnpauseJavaProfiling = 0;
1304 void GeckoJavaSampler::InitStubs(JNIEnv *jEnv) {
1305 initInit();
1307 mGeckoJavaSamplerClass = getClassGlobalRef("org/mozilla/gecko/GeckoJavaSampler");
1308 jGetFrameNameJavaProfilingWrapper = getStaticMethod("getFrameName", "(III)Ljava/lang/String;");
1309 jGetSampleTimeJavaProfiling = getStaticMethod("getSampleTime", "(II)D");
1310 jGetThreadNameJavaProfilingWrapper = getStaticMethod("getThreadName", "(I)Ljava/lang/String;");
1311 jPauseJavaProfiling = getStaticMethod("pause", "()V");
1312 jStartJavaProfiling = getStaticMethod("start", "(II)V");
1313 jStopJavaProfiling = getStaticMethod("stop", "()V");
1314 jUnpauseJavaProfiling = getStaticMethod("unpause", "()V");
1315 }
1317 GeckoJavaSampler* GeckoJavaSampler::Wrap(jobject obj) {
1318 JNIEnv *env = GetJNIForThread();
1319 GeckoJavaSampler* ret = new GeckoJavaSampler(obj, env);
1320 env->DeleteLocalRef(obj);
1321 return ret;
1322 }
1324 jstring GeckoJavaSampler::GetFrameNameJavaProfilingWrapper(int32_t a0, int32_t a1, int32_t a2) {
1325 JNIEnv *env = GetJNIForThread();
1326 if (env->PushLocalFrame(1) != 0) {
1327 AndroidBridge::HandleUncaughtException(env);
1328 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1329 }
1331 jvalue args[3];
1332 args[0].i = a0;
1333 args[1].i = a1;
1334 args[2].i = a2;
1336 jobject temp = env->CallStaticObjectMethodA(mGeckoJavaSamplerClass, jGetFrameNameJavaProfilingWrapper, args);
1337 AndroidBridge::HandleUncaughtException(env);
1338 jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
1339 return ret;
1340 }
1342 jdouble GeckoJavaSampler::GetSampleTimeJavaProfiling(int32_t a0, int32_t a1) {
1343 JNIEnv *env = GetJNIForThread();
1344 if (env->PushLocalFrame(0) != 0) {
1345 AndroidBridge::HandleUncaughtException(env);
1346 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1347 }
1349 jdouble temp = env->CallStaticDoubleMethod(mGeckoJavaSamplerClass, jGetSampleTimeJavaProfiling, a0, a1);
1350 AndroidBridge::HandleUncaughtException(env);
1351 env->PopLocalFrame(nullptr);
1352 return temp;
1353 }
1355 jstring GeckoJavaSampler::GetThreadNameJavaProfilingWrapper(int32_t a0) {
1356 JNIEnv *env = GetJNIForThread();
1357 if (env->PushLocalFrame(1) != 0) {
1358 AndroidBridge::HandleUncaughtException(env);
1359 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1360 }
1362 jobject temp = env->CallStaticObjectMethod(mGeckoJavaSamplerClass, jGetThreadNameJavaProfilingWrapper, a0);
1363 AndroidBridge::HandleUncaughtException(env);
1364 jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
1365 return ret;
1366 }
1368 void GeckoJavaSampler::PauseJavaProfiling() {
1369 JNIEnv *env = GetJNIForThread();
1370 if (env->PushLocalFrame(0) != 0) {
1371 AndroidBridge::HandleUncaughtException(env);
1372 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1373 }
1375 env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jPauseJavaProfiling);
1376 AndroidBridge::HandleUncaughtException(env);
1377 env->PopLocalFrame(nullptr);
1378 }
1380 void GeckoJavaSampler::StartJavaProfiling(int32_t a0, int32_t a1) {
1381 JNIEnv *env = GetJNIForThread();
1382 if (env->PushLocalFrame(0) != 0) {
1383 AndroidBridge::HandleUncaughtException(env);
1384 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1385 }
1387 env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jStartJavaProfiling, a0, a1);
1388 AndroidBridge::HandleUncaughtException(env);
1389 env->PopLocalFrame(nullptr);
1390 }
1392 void GeckoJavaSampler::StopJavaProfiling() {
1393 JNIEnv *env = GetJNIForThread();
1394 if (env->PushLocalFrame(0) != 0) {
1395 AndroidBridge::HandleUncaughtException(env);
1396 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1397 }
1399 env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jStopJavaProfiling);
1400 AndroidBridge::HandleUncaughtException(env);
1401 env->PopLocalFrame(nullptr);
1402 }
1404 void GeckoJavaSampler::UnpauseJavaProfiling() {
1405 JNIEnv *env = GetJNIForThread();
1406 if (env->PushLocalFrame(0) != 0) {
1407 AndroidBridge::HandleUncaughtException(env);
1408 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1409 }
1411 env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jUnpauseJavaProfiling);
1412 AndroidBridge::HandleUncaughtException(env);
1413 env->PopLocalFrame(nullptr);
1414 }
1415 jclass SurfaceBits::mSurfaceBitsClass = 0;
1416 jmethodID SurfaceBits::jSurfaceBits = 0;
1417 jfieldID SurfaceBits::jbuffer = 0;
1418 jfieldID SurfaceBits::jformat = 0;
1419 jfieldID SurfaceBits::jheight = 0;
1420 jfieldID SurfaceBits::jwidth = 0;
1421 void SurfaceBits::InitStubs(JNIEnv *jEnv) {
1422 initInit();
1424 mSurfaceBitsClass = getClassGlobalRef("org/mozilla/gecko/SurfaceBits");
1425 jSurfaceBits = getMethod("<init>", "()V");
1426 jbuffer = getField("buffer", "Ljava/nio/ByteBuffer;");
1427 jformat = getField("format", "I");
1428 jheight = getField("height", "I");
1429 jwidth = getField("width", "I");
1430 }
1432 SurfaceBits* SurfaceBits::Wrap(jobject obj) {
1433 JNIEnv *env = GetJNIForThread();
1434 SurfaceBits* ret = new SurfaceBits(obj, env);
1435 env->DeleteLocalRef(obj);
1436 return ret;
1437 }
1439 SurfaceBits::SurfaceBits() {
1440 JNIEnv *env = AndroidBridge::GetJNIEnv();
1441 if (env->PushLocalFrame(0) != 0) {
1442 AndroidBridge::HandleUncaughtException(env);
1443 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1444 }
1446 Init(env->NewObject(mSurfaceBitsClass, jSurfaceBits), env);
1447 env->PopLocalFrame(nullptr);
1448 }
1450 jobject SurfaceBits::getbuffer() {
1451 JNIEnv *env = GetJNIForThread();
1452 return static_cast<jobject>(env->GetObjectField(wrapped_obj, jbuffer));
1453 }
1455 void SurfaceBits::setbuffer(jobject a0) {
1456 JNIEnv *env = GetJNIForThread();
1457 env->SetObjectField(wrapped_obj, jbuffer, a0);
1458 }
1460 int32_t SurfaceBits::getformat() {
1461 JNIEnv *env = GetJNIForThread();
1462 return env->GetIntField(wrapped_obj, jformat);
1463 }
1465 void SurfaceBits::setformat(int32_t a0) {
1466 JNIEnv *env = GetJNIForThread();
1467 env->SetIntField(wrapped_obj, jformat, a0);
1468 }
1470 int32_t SurfaceBits::getheight() {
1471 JNIEnv *env = GetJNIForThread();
1472 return env->GetIntField(wrapped_obj, jheight);
1473 }
1475 void SurfaceBits::setheight(int32_t a0) {
1476 JNIEnv *env = GetJNIForThread();
1477 env->SetIntField(wrapped_obj, jheight, a0);
1478 }
1480 int32_t SurfaceBits::getwidth() {
1481 JNIEnv *env = GetJNIForThread();
1482 return env->GetIntField(wrapped_obj, jwidth);
1483 }
1485 void SurfaceBits::setwidth(int32_t a0) {
1486 JNIEnv *env = GetJNIForThread();
1487 env->SetIntField(wrapped_obj, jwidth, a0);
1488 }
1489 jclass ThumbnailHelper::mThumbnailHelperClass = 0;
1490 jmethodID ThumbnailHelper::jSendThumbnail = 0;
1491 void ThumbnailHelper::InitStubs(JNIEnv *jEnv) {
1492 initInit();
1494 mThumbnailHelperClass = getClassGlobalRef("org/mozilla/gecko/ThumbnailHelper");
1495 jSendThumbnail = getStaticMethod("notifyThumbnail", "(Ljava/nio/ByteBuffer;IZ)V");
1496 }
1498 ThumbnailHelper* ThumbnailHelper::Wrap(jobject obj) {
1499 JNIEnv *env = GetJNIForThread();
1500 ThumbnailHelper* ret = new ThumbnailHelper(obj, env);
1501 env->DeleteLocalRef(obj);
1502 return ret;
1503 }
1505 void ThumbnailHelper::SendThumbnail(jobject a0, int32_t a1, bool a2) {
1506 JNIEnv *env = AndroidBridge::GetJNIEnv();
1507 if (env->PushLocalFrame(1) != 0) {
1508 AndroidBridge::HandleUncaughtException(env);
1509 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1510 }
1512 jvalue args[3];
1513 args[0].l = a0;
1514 args[1].i = a1;
1515 args[2].z = a2;
1517 env->CallStaticVoidMethodA(mThumbnailHelperClass, jSendThumbnail, args);
1518 AndroidBridge::HandleUncaughtException(env);
1519 env->PopLocalFrame(nullptr);
1520 }
1521 jclass DisplayPortMetrics::mDisplayPortMetricsClass = 0;
1522 jmethodID DisplayPortMetrics::jDisplayPortMetrics = 0;
1523 jfieldID DisplayPortMetrics::jMPosition = 0;
1524 jfieldID DisplayPortMetrics::jResolution = 0;
1525 void DisplayPortMetrics::InitStubs(JNIEnv *jEnv) {
1526 initInit();
1528 mDisplayPortMetricsClass = getClassGlobalRef("org/mozilla/gecko/gfx/DisplayPortMetrics");
1529 jDisplayPortMetrics = getMethod("<init>", "(FFFFF)V");
1530 jMPosition = getField("mPosition", "Landroid/graphics/RectF;");
1531 jResolution = getField("resolution", "F");
1532 }
1534 DisplayPortMetrics* DisplayPortMetrics::Wrap(jobject obj) {
1535 JNIEnv *env = GetJNIForThread();
1536 DisplayPortMetrics* ret = new DisplayPortMetrics(obj, env);
1537 env->DeleteLocalRef(obj);
1538 return ret;
1539 }
1541 DisplayPortMetrics::DisplayPortMetrics(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4) {
1542 JNIEnv *env = AndroidBridge::GetJNIEnv();
1543 if (env->PushLocalFrame(0) != 0) {
1544 AndroidBridge::HandleUncaughtException(env);
1545 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1546 }
1548 jvalue args[5];
1549 args[0].f = a0;
1550 args[1].f = a1;
1551 args[2].f = a2;
1552 args[3].f = a3;
1553 args[4].f = a4;
1555 Init(env->NewObjectA(mDisplayPortMetricsClass, jDisplayPortMetrics, args), env);
1556 env->PopLocalFrame(nullptr);
1557 }
1559 jobject DisplayPortMetrics::getMPosition() {
1560 JNIEnv *env = GetJNIForThread();
1561 return static_cast<jobject>(env->GetObjectField(wrapped_obj, jMPosition));
1562 }
1564 jfloat DisplayPortMetrics::getResolution() {
1565 JNIEnv *env = GetJNIForThread();
1566 return env->GetFloatField(wrapped_obj, jResolution);
1567 }
1568 jclass GLController::mGLControllerClass = 0;
1569 jmethodID GLController::jCreateEGLSurfaceForCompositorWrapper = 0;
1570 void GLController::InitStubs(JNIEnv *jEnv) {
1571 initInit();
1573 mGLControllerClass = getClassGlobalRef("org/mozilla/gecko/gfx/GLController");
1574 jCreateEGLSurfaceForCompositorWrapper = getMethod("createEGLSurfaceForCompositor", "()Ljavax/microedition/khronos/egl/EGLSurface;");
1575 }
1577 GLController* GLController::Wrap(jobject obj) {
1578 JNIEnv *env = GetJNIForThread();
1579 GLController* ret = new GLController(obj, env);
1580 env->DeleteLocalRef(obj);
1581 return ret;
1582 }
1584 jobject GLController::CreateEGLSurfaceForCompositorWrapper() {
1585 JNIEnv *env = GetJNIForThread();
1586 if (env->PushLocalFrame(1) != 0) {
1587 AndroidBridge::HandleUncaughtException(env);
1588 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1589 }
1591 jobject temp = env->CallObjectMethod(wrapped_obj, jCreateEGLSurfaceForCompositorWrapper);
1592 AndroidBridge::HandleUncaughtException(env);
1593 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
1594 return ret;
1595 }
1596 jclass GeckoLayerClient::mGeckoLayerClientClass = 0;
1597 jmethodID GeckoLayerClient::jActivateProgram = 0;
1598 jmethodID GeckoLayerClient::jContentDocumentChanged = 0;
1599 jmethodID GeckoLayerClient::jCreateFrame = 0;
1600 jmethodID GeckoLayerClient::jDeactivateProgram = 0;
1601 jmethodID GeckoLayerClient::jGetDisplayPort = 0;
1602 jmethodID GeckoLayerClient::jIsContentDocumentDisplayed = 0;
1603 jmethodID GeckoLayerClient::jProgressiveUpdateCallback = 0;
1604 jmethodID GeckoLayerClient::jSetFirstPaintViewport = 0;
1605 jmethodID GeckoLayerClient::jSetPageRect = 0;
1606 jmethodID GeckoLayerClient::jSyncFrameMetrics = 0;
1607 jmethodID GeckoLayerClient::jSyncViewportInfo = 0;
1608 void GeckoLayerClient::InitStubs(JNIEnv *jEnv) {
1609 initInit();
1611 mGeckoLayerClientClass = getClassGlobalRef("org/mozilla/gecko/gfx/GeckoLayerClient");
1612 jActivateProgram = getMethod("activateProgram", "()V");
1613 jContentDocumentChanged = getMethod("contentDocumentChanged", "()V");
1614 jCreateFrame = getMethod("createFrame", "()Lorg/mozilla/gecko/gfx/LayerRenderer$Frame;");
1615 jDeactivateProgram = getMethod("deactivateProgram", "()V");
1616 jGetDisplayPort = getMethod("getDisplayPort", "(ZZILorg/mozilla/gecko/gfx/ImmutableViewportMetrics;)Lorg/mozilla/gecko/gfx/DisplayPortMetrics;");
1617 jIsContentDocumentDisplayed = getMethod("isContentDocumentDisplayed", "()Z");
1618 jProgressiveUpdateCallback = getMethod("progressiveUpdateCallback", "(ZFFFFFZ)Lorg/mozilla/gecko/gfx/ProgressiveUpdateData;");
1619 jSetFirstPaintViewport = getMethod("setFirstPaintViewport", "(FFFFFFF)V");
1620 jSetPageRect = getMethod("setPageRect", "(FFFF)V");
1621 jSyncFrameMetrics = getMethod("syncFrameMetrics", "(FFFFFFFZIIIIFZ)Lorg/mozilla/gecko/gfx/ViewTransform;");
1622 jSyncViewportInfo = getMethod("syncViewportInfo", "(IIIIFZ)Lorg/mozilla/gecko/gfx/ViewTransform;");
1623 }
1625 GeckoLayerClient* GeckoLayerClient::Wrap(jobject obj) {
1626 JNIEnv *env = GetJNIForThread();
1627 GeckoLayerClient* ret = new GeckoLayerClient(obj, env);
1628 env->DeleteLocalRef(obj);
1629 return ret;
1630 }
1632 void GeckoLayerClient::ActivateProgram() {
1633 JNIEnv *env = GetJNIForThread();
1634 if (env->PushLocalFrame(0) != 0) {
1635 AndroidBridge::HandleUncaughtException(env);
1636 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1637 }
1639 env->CallVoidMethod(wrapped_obj, jActivateProgram);
1640 AndroidBridge::HandleUncaughtException(env);
1641 env->PopLocalFrame(nullptr);
1642 }
1644 void GeckoLayerClient::ContentDocumentChanged() {
1645 JNIEnv *env = AndroidBridge::GetJNIEnv();
1646 if (env->PushLocalFrame(0) != 0) {
1647 AndroidBridge::HandleUncaughtException(env);
1648 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1649 }
1651 env->CallVoidMethod(wrapped_obj, jContentDocumentChanged);
1652 AndroidBridge::HandleUncaughtException(env);
1653 env->PopLocalFrame(nullptr);
1654 }
1656 jobject GeckoLayerClient::CreateFrame() {
1657 JNIEnv *env = GetJNIForThread();
1658 if (env->PushLocalFrame(1) != 0) {
1659 AndroidBridge::HandleUncaughtException(env);
1660 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1661 }
1663 jobject temp = env->CallObjectMethod(wrapped_obj, jCreateFrame);
1664 AndroidBridge::HandleUncaughtException(env);
1665 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
1666 return ret;
1667 }
1669 void GeckoLayerClient::DeactivateProgram() {
1670 JNIEnv *env = GetJNIForThread();
1671 if (env->PushLocalFrame(0) != 0) {
1672 AndroidBridge::HandleUncaughtException(env);
1673 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1674 }
1676 env->CallVoidMethod(wrapped_obj, jDeactivateProgram);
1677 AndroidBridge::HandleUncaughtException(env);
1678 env->PopLocalFrame(nullptr);
1679 }
1681 jobject GeckoLayerClient::GetDisplayPort(bool a0, bool a1, int32_t a2, jobject a3) {
1682 JNIEnv *env = AndroidBridge::GetJNIEnv();
1683 if (env->PushLocalFrame(2) != 0) {
1684 AndroidBridge::HandleUncaughtException(env);
1685 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1686 }
1688 jvalue args[4];
1689 args[0].z = a0;
1690 args[1].z = a1;
1691 args[2].i = a2;
1692 args[3].l = a3;
1694 jobject temp = env->CallObjectMethodA(wrapped_obj, jGetDisplayPort, args);
1695 AndroidBridge::HandleUncaughtException(env);
1696 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
1697 return ret;
1698 }
1700 bool GeckoLayerClient::IsContentDocumentDisplayed() {
1701 JNIEnv *env = AndroidBridge::GetJNIEnv();
1702 if (env->PushLocalFrame(0) != 0) {
1703 AndroidBridge::HandleUncaughtException(env);
1704 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1705 }
1707 bool temp = env->CallBooleanMethod(wrapped_obj, jIsContentDocumentDisplayed);
1708 AndroidBridge::HandleUncaughtException(env);
1709 env->PopLocalFrame(nullptr);
1710 return temp;
1711 }
1713 jobject GeckoLayerClient::ProgressiveUpdateCallback(bool a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, jfloat a5, bool a6) {
1714 JNIEnv *env = GetJNIForThread();
1715 if (env->PushLocalFrame(1) != 0) {
1716 AndroidBridge::HandleUncaughtException(env);
1717 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1718 }
1720 jvalue args[7];
1721 args[0].z = a0;
1722 args[1].f = a1;
1723 args[2].f = a2;
1724 args[3].f = a3;
1725 args[4].f = a4;
1726 args[5].f = a5;
1727 args[6].z = a6;
1729 jobject temp = env->CallObjectMethodA(wrapped_obj, jProgressiveUpdateCallback, args);
1730 AndroidBridge::HandleUncaughtException(env);
1731 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
1732 return ret;
1733 }
1735 void GeckoLayerClient::SetFirstPaintViewport(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, jfloat a5, jfloat a6) {
1736 JNIEnv *env = GetJNIForThread();
1737 if (env->PushLocalFrame(0) != 0) {
1738 AndroidBridge::HandleUncaughtException(env);
1739 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1740 }
1742 jvalue args[7];
1743 args[0].f = a0;
1744 args[1].f = a1;
1745 args[2].f = a2;
1746 args[3].f = a3;
1747 args[4].f = a4;
1748 args[5].f = a5;
1749 args[6].f = a6;
1751 env->CallVoidMethodA(wrapped_obj, jSetFirstPaintViewport, args);
1752 AndroidBridge::HandleUncaughtException(env);
1753 env->PopLocalFrame(nullptr);
1754 }
1756 void GeckoLayerClient::SetPageRect(jfloat a0, jfloat a1, jfloat a2, jfloat a3) {
1757 JNIEnv *env = GetJNIForThread();
1758 if (env->PushLocalFrame(0) != 0) {
1759 AndroidBridge::HandleUncaughtException(env);
1760 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1761 }
1763 jvalue args[4];
1764 args[0].f = a0;
1765 args[1].f = a1;
1766 args[2].f = a2;
1767 args[3].f = a3;
1769 env->CallVoidMethodA(wrapped_obj, jSetPageRect, args);
1770 AndroidBridge::HandleUncaughtException(env);
1771 env->PopLocalFrame(nullptr);
1772 }
1774 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) {
1775 JNIEnv *env = GetJNIForThread();
1776 if (env->PushLocalFrame(1) != 0) {
1777 AndroidBridge::HandleUncaughtException(env);
1778 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1779 }
1781 jvalue args[14];
1782 args[0].f = a0;
1783 args[1].f = a1;
1784 args[2].f = a2;
1785 args[3].f = a3;
1786 args[4].f = a4;
1787 args[5].f = a5;
1788 args[6].f = a6;
1789 args[7].z = a7;
1790 args[8].i = a8;
1791 args[9].i = a9;
1792 args[10].i = a10;
1793 args[11].i = a11;
1794 args[12].f = a12;
1795 args[13].z = a13;
1797 jobject temp = env->CallObjectMethodA(wrapped_obj, jSyncFrameMetrics, args);
1798 AndroidBridge::HandleUncaughtException(env);
1799 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
1800 return ret;
1801 }
1803 jobject GeckoLayerClient::SyncViewportInfo(int32_t a0, int32_t a1, int32_t a2, int32_t a3, jfloat a4, bool a5) {
1804 JNIEnv *env = GetJNIForThread();
1805 if (env->PushLocalFrame(1) != 0) {
1806 AndroidBridge::HandleUncaughtException(env);
1807 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1808 }
1810 jvalue args[6];
1811 args[0].i = a0;
1812 args[1].i = a1;
1813 args[2].i = a2;
1814 args[3].i = a3;
1815 args[4].f = a4;
1816 args[5].z = a5;
1818 jobject temp = env->CallObjectMethodA(wrapped_obj, jSyncViewportInfo, args);
1819 AndroidBridge::HandleUncaughtException(env);
1820 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
1821 return ret;
1822 }
1823 jclass ImmutableViewportMetrics::mImmutableViewportMetricsClass = 0;
1824 jmethodID ImmutableViewportMetrics::jImmutableViewportMetrics = 0;
1825 void ImmutableViewportMetrics::InitStubs(JNIEnv *jEnv) {
1826 initInit();
1828 mImmutableViewportMetricsClass = getClassGlobalRef("org/mozilla/gecko/gfx/ImmutableViewportMetrics");
1829 jImmutableViewportMetrics = getMethod("<init>", "(FFFFFFFFFFFFF)V");
1830 }
1832 ImmutableViewportMetrics* ImmutableViewportMetrics::Wrap(jobject obj) {
1833 JNIEnv *env = GetJNIForThread();
1834 ImmutableViewportMetrics* ret = new ImmutableViewportMetrics(obj, env);
1835 env->DeleteLocalRef(obj);
1836 return ret;
1837 }
1839 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) {
1840 JNIEnv *env = GetJNIForThread();
1841 if (env->PushLocalFrame(0) != 0) {
1842 AndroidBridge::HandleUncaughtException(env);
1843 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1844 }
1846 jvalue args[13];
1847 args[0].f = a0;
1848 args[1].f = a1;
1849 args[2].f = a2;
1850 args[3].f = a3;
1851 args[4].f = a4;
1852 args[5].f = a5;
1853 args[6].f = a6;
1854 args[7].f = a7;
1855 args[8].f = a8;
1856 args[9].f = a9;
1857 args[10].f = a10;
1858 args[11].f = a11;
1859 args[12].f = a12;
1861 Init(env->NewObjectA(mImmutableViewportMetricsClass, jImmutableViewportMetrics, args), env);
1862 env->PopLocalFrame(nullptr);
1863 }
1864 jclass LayerView::mLayerViewClass = 0;
1865 jmethodID LayerView::jRegisterCompositorWrapper = 0;
1866 void LayerView::InitStubs(JNIEnv *jEnv) {
1867 initInit();
1869 mLayerViewClass = getClassGlobalRef("org/mozilla/gecko/gfx/LayerView");
1870 jRegisterCompositorWrapper = getStaticMethod("registerCxxCompositor", "()Lorg/mozilla/gecko/gfx/GLController;");
1871 }
1873 LayerView* LayerView::Wrap(jobject obj) {
1874 JNIEnv *env = GetJNIForThread();
1875 LayerView* ret = new LayerView(obj, env);
1876 env->DeleteLocalRef(obj);
1877 return ret;
1878 }
1880 jobject LayerView::RegisterCompositorWrapper() {
1881 JNIEnv *env = GetJNIForThread();
1882 if (env->PushLocalFrame(1) != 0) {
1883 AndroidBridge::HandleUncaughtException(env);
1884 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1885 }
1887 jobject temp = env->CallStaticObjectMethod(mLayerViewClass, jRegisterCompositorWrapper);
1888 AndroidBridge::HandleUncaughtException(env);
1889 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
1890 return ret;
1891 }
1892 jclass NativePanZoomController::mNativePanZoomControllerClass = 0;
1893 jmethodID NativePanZoomController::jPostDelayedCallbackWrapper = 0;
1894 jmethodID NativePanZoomController::jRequestContentRepaintWrapper = 0;
1895 void NativePanZoomController::InitStubs(JNIEnv *jEnv) {
1896 initInit();
1898 mNativePanZoomControllerClass = getClassGlobalRef("org/mozilla/gecko/gfx/NativePanZoomController");
1899 jPostDelayedCallbackWrapper = getMethod("postDelayedCallback", "(J)V");
1900 jRequestContentRepaintWrapper = getMethod("requestContentRepaint", "(FFFFF)V");
1901 }
1903 NativePanZoomController* NativePanZoomController::Wrap(jobject obj) {
1904 JNIEnv *env = GetJNIForThread();
1905 NativePanZoomController* ret = new NativePanZoomController(obj, env);
1906 env->DeleteLocalRef(obj);
1907 return ret;
1908 }
1910 void NativePanZoomController::PostDelayedCallbackWrapper(int64_t a0) {
1911 JNIEnv *env = GetJNIForThread();
1912 if (env->PushLocalFrame(0) != 0) {
1913 AndroidBridge::HandleUncaughtException(env);
1914 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1915 }
1917 env->CallVoidMethod(wrapped_obj, jPostDelayedCallbackWrapper, a0);
1918 AndroidBridge::HandleUncaughtException(env);
1919 env->PopLocalFrame(nullptr);
1920 }
1922 void NativePanZoomController::RequestContentRepaintWrapper(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4) {
1923 JNIEnv *env = GetJNIForThread();
1924 if (env->PushLocalFrame(0) != 0) {
1925 AndroidBridge::HandleUncaughtException(env);
1926 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1927 }
1929 jvalue args[5];
1930 args[0].f = a0;
1931 args[1].f = a1;
1932 args[2].f = a2;
1933 args[3].f = a3;
1934 args[4].f = a4;
1936 env->CallVoidMethodA(wrapped_obj, jRequestContentRepaintWrapper, args);
1937 AndroidBridge::HandleUncaughtException(env);
1938 env->PopLocalFrame(nullptr);
1939 }
1940 jclass ProgressiveUpdateData::mProgressiveUpdateDataClass = 0;
1941 jmethodID ProgressiveUpdateData::jProgressiveUpdateData = 0;
1942 jmethodID ProgressiveUpdateData::jsetViewport = 0;
1943 jfieldID ProgressiveUpdateData::jabort = 0;
1944 jfieldID ProgressiveUpdateData::jheight = 0;
1945 jfieldID ProgressiveUpdateData::jscale = 0;
1946 jfieldID ProgressiveUpdateData::jwidth = 0;
1947 jfieldID ProgressiveUpdateData::jx = 0;
1948 jfieldID ProgressiveUpdateData::jy = 0;
1949 void ProgressiveUpdateData::InitStubs(JNIEnv *jEnv) {
1950 initInit();
1952 mProgressiveUpdateDataClass = getClassGlobalRef("org/mozilla/gecko/gfx/ProgressiveUpdateData");
1953 jProgressiveUpdateData = getMethod("<init>", "()V");
1954 jsetViewport = getMethod("setViewport", "(Lorg/mozilla/gecko/gfx/ImmutableViewportMetrics;)V");
1955 jabort = getField("abort", "Z");
1956 jheight = getField("height", "F");
1957 jscale = getField("scale", "F");
1958 jwidth = getField("width", "F");
1959 jx = getField("x", "F");
1960 jy = getField("y", "F");
1961 }
1963 ProgressiveUpdateData* ProgressiveUpdateData::Wrap(jobject obj) {
1964 JNIEnv *env = GetJNIForThread();
1965 ProgressiveUpdateData* ret = new ProgressiveUpdateData(obj, env);
1966 env->DeleteLocalRef(obj);
1967 return ret;
1968 }
1970 ProgressiveUpdateData::ProgressiveUpdateData() {
1971 JNIEnv *env = AndroidBridge::GetJNIEnv();
1972 if (env->PushLocalFrame(0) != 0) {
1973 AndroidBridge::HandleUncaughtException(env);
1974 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1975 }
1977 Init(env->NewObject(mProgressiveUpdateDataClass, jProgressiveUpdateData), env);
1978 env->PopLocalFrame(nullptr);
1979 }
1981 void ProgressiveUpdateData::setViewport(jobject a0) {
1982 JNIEnv *env = AndroidBridge::GetJNIEnv();
1983 if (env->PushLocalFrame(1) != 0) {
1984 AndroidBridge::HandleUncaughtException(env);
1985 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
1986 }
1988 env->CallVoidMethod(wrapped_obj, jsetViewport, a0);
1989 AndroidBridge::HandleUncaughtException(env);
1990 env->PopLocalFrame(nullptr);
1991 }
1993 bool ProgressiveUpdateData::getabort() {
1994 JNIEnv *env = GetJNIForThread();
1995 return env->GetBooleanField(wrapped_obj, jabort);
1996 }
1998 void ProgressiveUpdateData::setabort(bool a0) {
1999 JNIEnv *env = GetJNIForThread();
2000 env->SetBooleanField(wrapped_obj, jabort, a0);
2001 }
2003 jfloat ProgressiveUpdateData::getheight() {
2004 JNIEnv *env = GetJNIForThread();
2005 return env->GetFloatField(wrapped_obj, jheight);
2006 }
2008 void ProgressiveUpdateData::setheight(jfloat a0) {
2009 JNIEnv *env = GetJNIForThread();
2010 env->SetFloatField(wrapped_obj, jheight, a0);
2011 }
2013 jfloat ProgressiveUpdateData::getscale() {
2014 JNIEnv *env = GetJNIForThread();
2015 return env->GetFloatField(wrapped_obj, jscale);
2016 }
2018 void ProgressiveUpdateData::setscale(jfloat a0) {
2019 JNIEnv *env = GetJNIForThread();
2020 env->SetFloatField(wrapped_obj, jscale, a0);
2021 }
2023 jfloat ProgressiveUpdateData::getwidth() {
2024 JNIEnv *env = GetJNIForThread();
2025 return env->GetFloatField(wrapped_obj, jwidth);
2026 }
2028 void ProgressiveUpdateData::setwidth(jfloat a0) {
2029 JNIEnv *env = GetJNIForThread();
2030 env->SetFloatField(wrapped_obj, jwidth, a0);
2031 }
2033 jfloat ProgressiveUpdateData::getx() {
2034 JNIEnv *env = GetJNIForThread();
2035 return env->GetFloatField(wrapped_obj, jx);
2036 }
2038 void ProgressiveUpdateData::setx(jfloat a0) {
2039 JNIEnv *env = GetJNIForThread();
2040 env->SetFloatField(wrapped_obj, jx, a0);
2041 }
2043 jfloat ProgressiveUpdateData::gety() {
2044 JNIEnv *env = GetJNIForThread();
2045 return env->GetFloatField(wrapped_obj, jy);
2046 }
2048 void ProgressiveUpdateData::sety(jfloat a0) {
2049 JNIEnv *env = GetJNIForThread();
2050 env->SetFloatField(wrapped_obj, jy, a0);
2051 }
2052 jclass ViewTransform::mViewTransformClass = 0;
2053 jmethodID ViewTransform::jViewTransform = 0;
2054 jfieldID ViewTransform::jfixedLayerMarginBottom = 0;
2055 jfieldID ViewTransform::jfixedLayerMarginLeft = 0;
2056 jfieldID ViewTransform::jfixedLayerMarginRight = 0;
2057 jfieldID ViewTransform::jfixedLayerMarginTop = 0;
2058 jfieldID ViewTransform::joffsetX = 0;
2059 jfieldID ViewTransform::joffsetY = 0;
2060 jfieldID ViewTransform::jscale = 0;
2061 jfieldID ViewTransform::jx = 0;
2062 jfieldID ViewTransform::jy = 0;
2063 void ViewTransform::InitStubs(JNIEnv *jEnv) {
2064 initInit();
2066 mViewTransformClass = getClassGlobalRef("org/mozilla/gecko/gfx/ViewTransform");
2067 jViewTransform = getMethod("<init>", "(FFF)V");
2068 jfixedLayerMarginBottom = getField("fixedLayerMarginBottom", "F");
2069 jfixedLayerMarginLeft = getField("fixedLayerMarginLeft", "F");
2070 jfixedLayerMarginRight = getField("fixedLayerMarginRight", "F");
2071 jfixedLayerMarginTop = getField("fixedLayerMarginTop", "F");
2072 joffsetX = getField("offsetX", "F");
2073 joffsetY = getField("offsetY", "F");
2074 jscale = getField("scale", "F");
2075 jx = getField("x", "F");
2076 jy = getField("y", "F");
2077 }
2079 ViewTransform* ViewTransform::Wrap(jobject obj) {
2080 JNIEnv *env = GetJNIForThread();
2081 ViewTransform* ret = new ViewTransform(obj, env);
2082 env->DeleteLocalRef(obj);
2083 return ret;
2084 }
2086 ViewTransform::ViewTransform(jfloat a0, jfloat a1, jfloat a2) {
2087 JNIEnv *env = AndroidBridge::GetJNIEnv();
2088 if (env->PushLocalFrame(0) != 0) {
2089 AndroidBridge::HandleUncaughtException(env);
2090 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
2091 }
2093 jvalue args[3];
2094 args[0].f = a0;
2095 args[1].f = a1;
2096 args[2].f = a2;
2098 Init(env->NewObjectA(mViewTransformClass, jViewTransform, args), env);
2099 env->PopLocalFrame(nullptr);
2100 }
2102 jfloat ViewTransform::getfixedLayerMarginBottom() {
2103 JNIEnv *env = GetJNIForThread();
2104 return env->GetFloatField(wrapped_obj, jfixedLayerMarginBottom);
2105 }
2107 void ViewTransform::setfixedLayerMarginBottom(jfloat a0) {
2108 JNIEnv *env = GetJNIForThread();
2109 env->SetFloatField(wrapped_obj, jfixedLayerMarginBottom, a0);
2110 }
2112 jfloat ViewTransform::getfixedLayerMarginLeft() {
2113 JNIEnv *env = GetJNIForThread();
2114 return env->GetFloatField(wrapped_obj, jfixedLayerMarginLeft);
2115 }
2117 void ViewTransform::setfixedLayerMarginLeft(jfloat a0) {
2118 JNIEnv *env = GetJNIForThread();
2119 env->SetFloatField(wrapped_obj, jfixedLayerMarginLeft, a0);
2120 }
2122 jfloat ViewTransform::getfixedLayerMarginRight() {
2123 JNIEnv *env = GetJNIForThread();
2124 return env->GetFloatField(wrapped_obj, jfixedLayerMarginRight);
2125 }
2127 void ViewTransform::setfixedLayerMarginRight(jfloat a0) {
2128 JNIEnv *env = GetJNIForThread();
2129 env->SetFloatField(wrapped_obj, jfixedLayerMarginRight, a0);
2130 }
2132 jfloat ViewTransform::getfixedLayerMarginTop() {
2133 JNIEnv *env = GetJNIForThread();
2134 return env->GetFloatField(wrapped_obj, jfixedLayerMarginTop);
2135 }
2137 void ViewTransform::setfixedLayerMarginTop(jfloat a0) {
2138 JNIEnv *env = GetJNIForThread();
2139 env->SetFloatField(wrapped_obj, jfixedLayerMarginTop, a0);
2140 }
2142 jfloat ViewTransform::getoffsetX() {
2143 JNIEnv *env = GetJNIForThread();
2144 return env->GetFloatField(wrapped_obj, joffsetX);
2145 }
2147 void ViewTransform::setoffsetX(jfloat a0) {
2148 JNIEnv *env = GetJNIForThread();
2149 env->SetFloatField(wrapped_obj, joffsetX, a0);
2150 }
2152 jfloat ViewTransform::getoffsetY() {
2153 JNIEnv *env = GetJNIForThread();
2154 return env->GetFloatField(wrapped_obj, joffsetY);
2155 }
2157 void ViewTransform::setoffsetY(jfloat a0) {
2158 JNIEnv *env = GetJNIForThread();
2159 env->SetFloatField(wrapped_obj, joffsetY, a0);
2160 }
2162 jfloat ViewTransform::getscale() {
2163 JNIEnv *env = GetJNIForThread();
2164 return env->GetFloatField(wrapped_obj, jscale);
2165 }
2167 void ViewTransform::setscale(jfloat a0) {
2168 JNIEnv *env = GetJNIForThread();
2169 env->SetFloatField(wrapped_obj, jscale, a0);
2170 }
2172 jfloat ViewTransform::getx() {
2173 JNIEnv *env = GetJNIForThread();
2174 return env->GetFloatField(wrapped_obj, jx);
2175 }
2177 void ViewTransform::setx(jfloat a0) {
2178 JNIEnv *env = GetJNIForThread();
2179 env->SetFloatField(wrapped_obj, jx, a0);
2180 }
2182 jfloat ViewTransform::gety() {
2183 JNIEnv *env = GetJNIForThread();
2184 return env->GetFloatField(wrapped_obj, jy);
2185 }
2187 void ViewTransform::sety(jfloat a0) {
2188 JNIEnv *env = GetJNIForThread();
2189 env->SetFloatField(wrapped_obj, jy, a0);
2190 }
2191 jclass NativeZip::mNativeZipClass = 0;
2192 jmethodID NativeZip::jCreateInputStream = 0;
2193 void NativeZip::InitStubs(JNIEnv *jEnv) {
2194 initInit();
2196 mNativeZipClass = getClassGlobalRef("org/mozilla/gecko/mozglue/NativeZip");
2197 jCreateInputStream = getMethod("createInputStream", "(Ljava/nio/ByteBuffer;I)Ljava/io/InputStream;");
2198 }
2200 NativeZip* NativeZip::Wrap(jobject obj) {
2201 JNIEnv *env = GetJNIForThread();
2202 NativeZip* ret = new NativeZip(obj, env);
2203 env->DeleteLocalRef(obj);
2204 return ret;
2205 }
2207 jobject NativeZip::CreateInputStream(jobject a0, int32_t a1) {
2208 JNIEnv *env = AndroidBridge::GetJNIEnv();
2209 if (env->PushLocalFrame(2) != 0) {
2210 AndroidBridge::HandleUncaughtException(env);
2211 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
2212 }
2214 jobject temp = env->CallObjectMethod(wrapped_obj, jCreateInputStream, a0, a1);
2215 AndroidBridge::HandleUncaughtException(env);
2216 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
2217 return ret;
2218 }
2219 jclass MatrixBlobCursor::mMatrixBlobCursorClass = 0;
2220 jmethodID MatrixBlobCursor::jMatrixBlobCursor = 0;
2221 jmethodID MatrixBlobCursor::jMatrixBlobCursor0 = 0;
2222 jmethodID MatrixBlobCursor::jAddRow = 0;
2223 jmethodID MatrixBlobCursor::jAddRow1 = 0;
2224 jmethodID MatrixBlobCursor::jAddRow2 = 0;
2225 void MatrixBlobCursor::InitStubs(JNIEnv *jEnv) {
2226 initInit();
2228 mMatrixBlobCursorClass = getClassGlobalRef("org/mozilla/gecko/sqlite/MatrixBlobCursor");
2229 jMatrixBlobCursor = getMethod("<init>", "([Ljava/lang/String;)V");
2230 jMatrixBlobCursor0 = getMethod("<init>", "([Ljava/lang/String;I)V");
2231 jAddRow = getMethod("addRow", "(Ljava/lang/Iterable;)V");
2232 jAddRow1 = getMethod("addRow", "(Ljava/util/ArrayList;I)V");
2233 jAddRow2 = getMethod("addRow", "([Ljava/lang/Object;)V");
2234 }
2236 MatrixBlobCursor* MatrixBlobCursor::Wrap(jobject obj) {
2237 JNIEnv *env = GetJNIForThread();
2238 MatrixBlobCursor* ret = new MatrixBlobCursor(obj, env);
2239 env->DeleteLocalRef(obj);
2240 return ret;
2241 }
2243 MatrixBlobCursor::MatrixBlobCursor(jobjectArray a0) {
2244 JNIEnv *env = AndroidBridge::GetJNIEnv();
2245 if (env->PushLocalFrame(1) != 0) {
2246 AndroidBridge::HandleUncaughtException(env);
2247 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
2248 }
2250 Init(env->NewObject(mMatrixBlobCursorClass, jMatrixBlobCursor, a0), env);
2251 env->PopLocalFrame(nullptr);
2252 }
2254 MatrixBlobCursor::MatrixBlobCursor(jobjectArray a0, int32_t a1) {
2255 JNIEnv *env = AndroidBridge::GetJNIEnv();
2256 if (env->PushLocalFrame(1) != 0) {
2257 AndroidBridge::HandleUncaughtException(env);
2258 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
2259 }
2261 Init(env->NewObject(mMatrixBlobCursorClass, jMatrixBlobCursor0, a0, a1), env);
2262 env->PopLocalFrame(nullptr);
2263 }
2265 void MatrixBlobCursor::AddRow(jobject a0) {
2266 JNIEnv *env = AndroidBridge::GetJNIEnv();
2267 if (env->PushLocalFrame(1) != 0) {
2268 AndroidBridge::HandleUncaughtException(env);
2269 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
2270 }
2272 env->CallVoidMethod(wrapped_obj, jAddRow, a0);
2273 AndroidBridge::HandleUncaughtException(env);
2274 env->PopLocalFrame(nullptr);
2275 }
2277 void MatrixBlobCursor::AddRow(jobject a0, int32_t a1) {
2278 JNIEnv *env = AndroidBridge::GetJNIEnv();
2279 if (env->PushLocalFrame(1) != 0) {
2280 AndroidBridge::HandleUncaughtException(env);
2281 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
2282 }
2284 env->CallVoidMethod(wrapped_obj, jAddRow1, a0, a1);
2285 AndroidBridge::HandleUncaughtException(env);
2286 env->PopLocalFrame(nullptr);
2287 }
2289 void MatrixBlobCursor::AddRow(jobjectArray a0) {
2290 JNIEnv *env = AndroidBridge::GetJNIEnv();
2291 if (env->PushLocalFrame(1) != 0) {
2292 AndroidBridge::HandleUncaughtException(env);
2293 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
2294 }
2296 env->CallVoidMethod(wrapped_obj, jAddRow2, a0);
2297 AndroidBridge::HandleUncaughtException(env);
2298 env->PopLocalFrame(nullptr);
2299 }
2300 jclass SQLiteBridgeException::mSQLiteBridgeExceptionClass = 0;
2301 jmethodID SQLiteBridgeException::jSQLiteBridgeException = 0;
2302 jmethodID SQLiteBridgeException::jSQLiteBridgeException0 = 0;
2303 jfieldID SQLiteBridgeException::jserialVersionUID = 0;
2304 void SQLiteBridgeException::InitStubs(JNIEnv *jEnv) {
2305 initInit();
2307 mSQLiteBridgeExceptionClass = getClassGlobalRef("org/mozilla/gecko/sqlite/SQLiteBridgeException");
2308 jSQLiteBridgeException = getMethod("<init>", "()V");
2309 jSQLiteBridgeException0 = getMethod("<init>", "(Ljava/lang/String;)V");
2310 jserialVersionUID = getStaticField("serialVersionUID", "J");
2311 }
2313 SQLiteBridgeException* SQLiteBridgeException::Wrap(jobject obj) {
2314 JNIEnv *env = GetJNIForThread();
2315 SQLiteBridgeException* ret = new SQLiteBridgeException(obj, env);
2316 env->DeleteLocalRef(obj);
2317 return ret;
2318 }
2320 SQLiteBridgeException::SQLiteBridgeException() {
2321 JNIEnv *env = AndroidBridge::GetJNIEnv();
2322 if (env->PushLocalFrame(0) != 0) {
2323 AndroidBridge::HandleUncaughtException(env);
2324 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
2325 }
2327 Init(env->NewObject(mSQLiteBridgeExceptionClass, jSQLiteBridgeException), env);
2328 env->PopLocalFrame(nullptr);
2329 }
2331 SQLiteBridgeException::SQLiteBridgeException(const nsAString& a0) {
2332 JNIEnv *env = AndroidBridge::GetJNIEnv();
2333 if (env->PushLocalFrame(1) != 0) {
2334 AndroidBridge::HandleUncaughtException(env);
2335 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
2336 }
2338 jstring j0 = AndroidBridge::NewJavaString(env, a0);
2340 Init(env->NewObject(mSQLiteBridgeExceptionClass, jSQLiteBridgeException0, j0), env);
2341 env->PopLocalFrame(nullptr);
2342 }
2344 int64_t SQLiteBridgeException::getserialVersionUID() {
2345 JNIEnv *env = GetJNIForThread();
2346 return env->GetStaticLongField(mSQLiteBridgeExceptionClass, jserialVersionUID);
2347 }
2348 jclass Clipboard::mClipboardClass = 0;
2349 jmethodID Clipboard::jClearText = 0;
2350 jmethodID Clipboard::jGetClipboardTextWrapper = 0;
2351 jmethodID Clipboard::jHasText = 0;
2352 jmethodID Clipboard::jSetClipboardText = 0;
2353 void Clipboard::InitStubs(JNIEnv *jEnv) {
2354 initInit();
2356 mClipboardClass = getClassGlobalRef("org/mozilla/gecko/util/Clipboard");
2357 jClearText = getStaticMethod("clearText", "()V");
2358 jGetClipboardTextWrapper = getStaticMethod("getText", "()Ljava/lang/String;");
2359 jHasText = getStaticMethod("hasText", "()Z");
2360 jSetClipboardText = getStaticMethod("setText", "(Ljava/lang/CharSequence;)V");
2361 }
2363 Clipboard* Clipboard::Wrap(jobject obj) {
2364 JNIEnv *env = GetJNIForThread();
2365 Clipboard* ret = new Clipboard(obj, env);
2366 env->DeleteLocalRef(obj);
2367 return ret;
2368 }
2370 void Clipboard::ClearText() {
2371 JNIEnv *env = AndroidBridge::GetJNIEnv();
2372 if (env->PushLocalFrame(0) != 0) {
2373 AndroidBridge::HandleUncaughtException(env);
2374 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
2375 }
2377 env->CallStaticVoidMethod(mClipboardClass, jClearText);
2378 AndroidBridge::HandleUncaughtException(env);
2379 env->PopLocalFrame(nullptr);
2380 }
2382 jstring Clipboard::GetClipboardTextWrapper() {
2383 JNIEnv *env = AndroidBridge::GetJNIEnv();
2384 if (env->PushLocalFrame(1) != 0) {
2385 AndroidBridge::HandleUncaughtException(env);
2386 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
2387 }
2389 jobject temp = env->CallStaticObjectMethod(mClipboardClass, jGetClipboardTextWrapper);
2390 AndroidBridge::HandleUncaughtException(env);
2391 jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
2392 return ret;
2393 }
2395 bool Clipboard::HasText() {
2396 JNIEnv *env = AndroidBridge::GetJNIEnv();
2397 if (env->PushLocalFrame(0) != 0) {
2398 AndroidBridge::HandleUncaughtException(env);
2399 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
2400 }
2402 bool temp = env->CallStaticBooleanMethod(mClipboardClass, jHasText);
2403 AndroidBridge::HandleUncaughtException(env);
2404 env->PopLocalFrame(nullptr);
2405 return temp;
2406 }
2408 void Clipboard::SetClipboardText(const nsAString& a0) {
2409 JNIEnv *env = AndroidBridge::GetJNIEnv();
2410 if (env->PushLocalFrame(1) != 0) {
2411 AndroidBridge::HandleUncaughtException(env);
2412 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
2413 }
2415 jstring j0 = AndroidBridge::NewJavaString(env, a0);
2417 env->CallStaticVoidMethod(mClipboardClass, jSetClipboardText, j0);
2418 AndroidBridge::HandleUncaughtException(env);
2419 env->PopLocalFrame(nullptr);
2420 }
2422 void InitStubs(JNIEnv *jEnv) {
2423 GeckoAppShell::InitStubs(jEnv);
2424 JavaDomKeyLocation::InitStubs(jEnv);
2425 GeckoJavaSampler::InitStubs(jEnv);
2426 SurfaceBits::InitStubs(jEnv);
2427 ThumbnailHelper::InitStubs(jEnv);
2428 DisplayPortMetrics::InitStubs(jEnv);
2429 GLController::InitStubs(jEnv);
2430 GeckoLayerClient::InitStubs(jEnv);
2431 ImmutableViewportMetrics::InitStubs(jEnv);
2432 LayerView::InitStubs(jEnv);
2433 NativePanZoomController::InitStubs(jEnv);
2434 ProgressiveUpdateData::InitStubs(jEnv);
2435 ViewTransform::InitStubs(jEnv);
2436 NativeZip::InitStubs(jEnv);
2437 MatrixBlobCursor::InitStubs(jEnv);
2438 SQLiteBridgeException::InitStubs(jEnv);
2439 Clipboard::InitStubs(jEnv);
2440 }
2441 } /* android */
2442 } /* widget */
2443 } /* mozilla */