Skip to content
Permalink
Browse files
8236448: Remove unused and repair broken Android/Dalvik code
Reviewed-by: kcr
  • Loading branch information
Johan Vos committed Jan 8, 2020
1 parent c9519b6 commit e6587ff08ca0123e0a0825ac5c88d04570e28e59
Show file tree
Hide file tree
Showing 12 changed files with 394 additions and 693 deletions.

Large diffs are not rendered by default.

@@ -28,6 +28,7 @@
import javafx.scene.Node;

public class DalvikInput {
/*
public static void onMultiTouchEvent(final int count, final int[] actions,
final int[] ids, final int[] touchXs, final int[] touchYs) {
@@ -71,4 +72,5 @@ public static void setActiveNode (Node n) {
public static native void onSurfaceRedrawNeededNative();
public static native void onConfigurationChangedNative(int flag);
*/
}
@@ -59,7 +59,7 @@ public static void gotTouchEventFromNative(int count, int[] actions, int[] ids,
touchState.addPoint(p);
}
}
instance.gotTouchEvent(touchState);
Platform.runLater(() -> instance.gotTouchEvent(touchState));
}

private void gotTouchEvent(TouchState touchState) {
@@ -225,9 +225,8 @@ protected Screen[] staticScreen_getScreens() {
0, 0, ns.getWidth(), ns.getHeight(),
0, 0, ns.getWidth(), ns.getHeight(),
0, 0, ns.getWidth(), ns.getHeight(),
ns.getDPI(), ns.getDPI(),
ns.getScale(), ns.getScale(),
ns.getScale(), ns.getScale());
ns.getWidth(), ns.getHeight(),
1.f, 1.f, ns.getScale(), ns.getScale());
// Move the cursor to the middle of the screen
MouseState mouseState = new MouseState();
mouseState.setX(ns.getWidth() / 2);
@@ -30,6 +30,22 @@

#include <stdlib.h>

//Builtin library entrypoint
JNIEXPORT jint JNICALL
JNI_OnLoad_glass_monocle(JavaVM *vm, void * reserved) {
fprintf(stderr, "In JNI_OnLoad_glass)monocle\n");
#ifdef JNI_VERSION_1_8
//min. returned JNI_VERSION required by JDK8 for builtin libraries
JNIEnv *env;
if ((*vm)->GetEnv(vm, (void **)&env, JNI_VERSION_1_8) != JNI_OK) {
return JNI_VERSION_1_4;
}
return JNI_VERSION_1_8;
#else
return JNI_VERSION_1_4;
#endif
}

void setEGLAttrs(jint *attrs, int *eglAttrs) {
int index = 0;

@@ -24,11 +24,9 @@
*/

#include <android/native_window_jni.h>
// #include "activity.h"
#include "dalvikInput.h"
#include "nativeBridge.h"
#include "com_sun_glass_ui_monocle_AndroidScreen.h"
#include "Monocle.h"
#include "logging.h"


/*
@@ -69,7 +67,7 @@ JNIEXPORT jint JNICALL Java_com_sun_glass_ui_monocle_AndroidScreen__1getHeight
JNIEXPORT jlong JNICALL Java_com_sun_glass_ui_monocle_AndroidScreen__1getNativeHandle
(JNIEnv *env, jobject obj) {
ANativeWindow* androidWindow = android_getNativeWindow(env);
return androidWindow;
return (jlong)androidWindow;
}

/*
@@ -79,9 +77,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_glass_ui_monocle_AndroidScreen__1getNativeH
*/
JNIEXPORT jfloat JNICALL Java_com_sun_glass_ui_monocle_AndroidScreen__1getDensity
(JNIEnv *env, jobject obj) {
jfloat answer = android_getDensity();
LOGI("DENSITY", "GETDENSITY, answer = %f\n",answer);
return answer;
return android_getDensity(env);
}


This file was deleted.

@@ -23,7 +23,7 @@
* questions.
*/

#if (defined(ANDROID_NDK) && defined(DALVIK_VM))
#if defined(ANDROID_NDK)

#include <android/keycodes.h>
#include "dalvikConst.h"
@@ -60,6 +60,7 @@ int to_jfx_key_action(int action) {
case KEY_ACTION_MULTIPLE:
return com_sun_glass_events_KeyEvent_TYPED;
}
return -1;
}

int to_linux_keycode(int androidKeyCode) {
@@ -120,6 +121,7 @@ char *describe_key_action(int action) {
case KEY_ACTION_MULTIPLE:
return "KEY_ACTION_MULTIPLE";
}
return "UNKNOWN";
}

#endif

0 comments on commit e6587ff

Please sign in to comment.