diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-06-30 13:40:14 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-08-11 11:14:22 -0700 |
commit | aed7528443b68ce8aced14130fc3622ddf8ec866 (patch) | |
tree | effebf48082e60b641939064decdfeeac32cf2f2 /core | |
parent | d27777790ee956c532be1dcefb59332e424bedd2 (diff) | |
download | subsurface-aed7528443b68ce8aced14130fc3622ddf8ec866.tar.gz |
Android: add callback from Intent
Right now all this does is add the device string to the log.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/android.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/android.cpp b/core/android.cpp index f506868f0..7d8c89b9c 100644 --- a/core/android.cpp +++ b/core/android.cpp @@ -15,6 +15,10 @@ #include <QtAndroidExtras/QAndroidJniObject> #include <QtAndroid> +#if defined(SUBSURFACE_MOBILE) +#include "mobile-widgets/qmlmanager.h" +#endif + #define USB_SERVICE "usb" extern "C" { @@ -152,6 +156,20 @@ int get_usb_fd(uint16_t idVendor, uint16_t idProduct) return fd; } +JNIEXPORT void JNICALL +Java_org_subsurfacedivelog_mobile_SubsurfaceMobileActivity_setDeviceString(JNIEnv *env, + jobject obj, + jstring javaDeviceString) +{ + const char *deviceString = env->GetStringUTFChars(javaDeviceString, NULL); + Q_UNUSED (obj) +#if defined(SUBSURFACE_MOBILE) + QMLManager::instance()->appendTextToLog(deviceString); +#endif + env->ReleaseStringUTFChars(javaDeviceString, deviceString); + return; +} + /* NOP wrappers to comform with windows.c */ int subsurface_rename(const char *path, const char *newpath) { |