Android: log both for mobile and full app

We don't usually build the full app on Android, but it's still possible.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-06-30 17:32:26 -07:00
parent aed7528443
commit 2ca8b98091

View file

@ -14,11 +14,16 @@
#include <QtAndroidExtras/QtAndroidExtras>
#include <QtAndroidExtras/QAndroidJniObject>
#include <QtAndroid>
#include <QDebug>
#if defined(SUBSURFACE_MOBILE)
#include "mobile-widgets/qmlmanager.h"
#define LOG(x) QMLManager::instance()->appendTextToLog(x);
#else
#define LOG(x) qDebug() << x;
#endif
#define USB_SERVICE "usb"
extern "C" {
@ -163,9 +168,7 @@ Java_org_subsurfacedivelog_mobile_SubsurfaceMobileActivity_setDeviceString(JNIEn
{
const char *deviceString = env->GetStringUTFChars(javaDeviceString, NULL);
Q_UNUSED (obj)
#if defined(SUBSURFACE_MOBILE)
QMLManager::instance()->appendTextToLog(deviceString);
#endif
LOG(deviceString);
env->ReleaseStringUTFChars(javaDeviceString, deviceString);
return;
}