Skip to content

Commit

Permalink
8236448: Remove unused and repair broken Android/Dalvik code
Browse files Browse the repository at this point in the history
Reviewed-by: kcr
  • Loading branch information
Johan Vos committed Jan 8, 2020
1 parent c9519b6 commit e6587ff
Show file tree
Hide file tree
Showing 12 changed files with 394 additions and 693 deletions.
534 changes: 165 additions & 369 deletions buildSrc/android.gradle

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -71,4 +72,5 @@ public static void setActiveNode (Node n) {
public static native void onSurfaceRedrawNeededNative();
public static native void onConfigurationChangedNative(int flag);
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 16 additions & 0 deletions modules/javafx.graphics/src/main/native-glass/monocle/EGL.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"


/*
Expand Down Expand Up @@ -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;
}

/*
Expand All @@ -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);
}


Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* questions.
*/

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

#include <android/keycodes.h>
#include "dalvikConst.h"
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -120,6 +121,7 @@ char *describe_key_action(int action) {
case KEY_ACTION_MULTIPLE:
return "KEY_ACTION_MULTIPLE";
}
return "UNKNOWN";
}

#endif
Loading

0 comments on commit e6587ff

Please sign in to comment.