From b195b6c636e153f353083f8d92b03876760ef805 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Wed, 29 Mar 2017 21:06:48 -0400 Subject: [PATCH] Fixed android package hierarchy to match package name. Renamed main activity class with a more appropriate name. --- android.pri | 4 +- android/AndroidManifest.xml | 2 +- .../android/usbserial/driver/FtdiSerialDriver.java | 34 +- .../org/mavlink/qgroundcontrol/QGCActivity.java | 692 +++++++++++++++++++++ .../org/mavlink/qgroundcontrol/UsbIoManager.java | 218 +++++++ .../org/qgroundcontrol/qgchelper/UsbDeviceJNI.java | 692 --------------------- .../org/qgroundcontrol/qgchelper/UsbIoManager.java | 218 ------- .../src/qserialport_android.cpp | 2 +- .../src/qserialportinfo_android.cpp | 2 +- src/GAudioOutput.cc | 2 +- src/MobileScreenMgr.cc | 2 +- 11 files changed, 934 insertions(+), 934 deletions(-) create mode 100644 android/src/org/mavlink/qgroundcontrol/QGCActivity.java create mode 100644 android/src/org/mavlink/qgroundcontrol/UsbIoManager.java delete mode 100644 android/src/org/qgroundcontrol/qgchelper/UsbDeviceJNI.java delete mode 100644 android/src/org/qgroundcontrol/qgchelper/UsbIoManager.java diff --git a/android.pri b/android.pri index eef0ae3..8179a76 100644 --- a/android.pri +++ b/android.pri @@ -14,8 +14,8 @@ OTHER_FILES += \ $$PWD/android/src/com/hoho/android/usbserial/driver/UsbSerialDriver.java \ $$PWD/android/src/com/hoho/android/usbserial/driver/UsbSerialProber.java \ $$PWD/android/src/com/hoho/android/usbserial/driver/UsbSerialRuntimeException.java \ - $$PWD/android/src/org/qgroundcontrol/qgchelper/UsbDeviceJNI.java \ - $$PWD/android/src/org/qgroundcontrol/qgchelper/UsbIoManager.java + $$PWD/android/src/org/mavlink/qgroundcontrol/QGCActivity.java \ + $$PWD/android/src/org/mavlink/qgroundcontrol/UsbIoManager.java DISTFILES += \ $$PWD/android/gradle/wrapper/gradle-wrapper.jar \ diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index f5009b3..b95c5ae 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,7 +1,7 @@ - + diff --git a/android/src/com/hoho/android/usbserial/driver/FtdiSerialDriver.java b/android/src/com/hoho/android/usbserial/driver/FtdiSerialDriver.java index 5ca0360..4d13b5c 100644 --- a/android/src/com/hoho/android/usbserial/driver/FtdiSerialDriver.java +++ b/android/src/com/hoho/android/usbserial/driver/FtdiSerialDriver.java @@ -39,7 +39,7 @@ import java.nio.ByteBuffer; import java.util.LinkedHashMap; import java.util.Map; -import org.qgroundcontrol.qgchelper.UsbDeviceJNI; +import org.mavlink.qgroundcontrol.QGCActivity; /** * A {@link CommonUsbSerialDriver} implementation for a variety of FTDI devices @@ -231,35 +231,35 @@ public class FtdiSerialDriver extends CommonUsbSerialDriver { public void open() throws IOException { D2xxManager ftD2xx = null; try { - ftD2xx = D2xxManager.getInstance(UsbDeviceJNI.m_context); + ftD2xx = D2xxManager.getInstance(QGCActivity.m_context); } catch (D2xxManager.D2xxException ex) { - UsbDeviceJNI.qgcLogDebug("D2xxManager.getInstance threw exception: " + ex.getMessage()); + QGCActivity.qgcLogDebug("D2xxManager.getInstance threw exception: " + ex.getMessage()); } if (ftD2xx == null) { String errMsg = "Unable to retrieve D2xxManager instance."; - UsbDeviceJNI.qgcLogWarning(errMsg); + QGCActivity.qgcLogWarning(errMsg); throw new IOException(errMsg); } - UsbDeviceJNI.qgcLogDebug("Opened D2xxManager"); + QGCActivity.qgcLogDebug("Opened D2xxManager"); - int DevCount = ftD2xx.createDeviceInfoList(UsbDeviceJNI.m_context); - UsbDeviceJNI.qgcLogDebug("Found " + DevCount + " ftdi devices."); + int DevCount = ftD2xx.createDeviceInfoList(QGCActivity.m_context); + QGCActivity.qgcLogDebug("Found " + DevCount + " ftdi devices."); if (DevCount < 1) { throw new IOException("No FTDI Devices found"); } m_ftDev = null; try { - m_ftDev = ftD2xx.openByIndex(UsbDeviceJNI.m_context, 0); + m_ftDev = ftD2xx.openByIndex(QGCActivity.m_context, 0); } catch (NullPointerException e) { - UsbDeviceJNI.qgcLogDebug("ftD2xx.openByIndex exception: " + e.getMessage()); + QGCActivity.qgcLogDebug("ftD2xx.openByIndex exception: " + e.getMessage()); } finally { if (m_ftDev == null) { throw new IOException("No FTDI Devices found"); } } - UsbDeviceJNI.qgcLogDebug("Opened FTDI device."); + QGCActivity.qgcLogDebug("Opened FTDI device."); } @Override @@ -268,7 +268,7 @@ public class FtdiSerialDriver extends CommonUsbSerialDriver { try { m_ftDev.close(); } catch (Exception e) { - UsbDeviceJNI.qgcLogWarning("close exception: " + e.getMessage()); + QGCActivity.qgcLogWarning("close exception: " + e.getMessage()); } m_ftDev = null; } @@ -285,7 +285,7 @@ public class FtdiSerialDriver extends CommonUsbSerialDriver { totalBytesRead = m_ftDev.read(dest, bytesAvailable, timeoutMillis); } catch (NullPointerException e) { final String errorMsg = "Error reading: " + e.getMessage(); - UsbDeviceJNI.qgcLogWarning(errorMsg); + QGCActivity.qgcLogWarning(errorMsg); throw new IOException(errorMsg, e); } } @@ -299,7 +299,7 @@ public class FtdiSerialDriver extends CommonUsbSerialDriver { m_ftDev.write(src); return src.length; } catch (Exception e) { - UsbDeviceJNI.qgcLogWarning("Error writing: " + e.getMessage()); + QGCActivity.qgcLogWarning("Error writing: " + e.getMessage()); } return 0; } @@ -309,7 +309,7 @@ public class FtdiSerialDriver extends CommonUsbSerialDriver { m_ftDev.setBaudRate(baudRate); return baudRate; } catch (Exception e) { - UsbDeviceJNI.qgcLogWarning("Error setting baud rate: " + e.getMessage()); + QGCActivity.qgcLogWarning("Error setting baud rate: " + e.getMessage()); } return 0; } @@ -360,7 +360,7 @@ public class FtdiSerialDriver extends CommonUsbSerialDriver { try { m_ftDev.setDataCharacteristics((byte)dataBits, (byte)stopBits, (byte)parity); } catch (Exception e) { - UsbDeviceJNI.qgcLogWarning("Error setDataCharacteristics: " + e.getMessage()); + QGCActivity.qgcLogWarning("Error setDataCharacteristics: " + e.getMessage()); } } @Override @@ -408,7 +408,7 @@ public class FtdiSerialDriver extends CommonUsbSerialDriver { m_ftDev.purge(D2xxManager.FT_PURGE_RX); } catch (Exception e) { String errMsg = "Error purgeHwBuffers(RX): "+ e.getMessage(); - UsbDeviceJNI.qgcLogWarning(errMsg); + QGCActivity.qgcLogWarning(errMsg); throw new IOException(errMsg); } } @@ -418,7 +418,7 @@ public class FtdiSerialDriver extends CommonUsbSerialDriver { m_ftDev.purge(D2xxManager.FT_PURGE_TX); } catch (Exception e) { String errMsg = "Error purgeHwBuffers(TX): " + e.getMessage(); - UsbDeviceJNI.qgcLogWarning(errMsg); + QGCActivity.qgcLogWarning(errMsg); throw new IOException(errMsg); } } diff --git a/android/src/org/mavlink/qgroundcontrol/QGCActivity.java b/android/src/org/mavlink/qgroundcontrol/QGCActivity.java new file mode 100644 index 0000000..7cd3c63 --- /dev/null +++ b/android/src/org/mavlink/qgroundcontrol/QGCActivity.java @@ -0,0 +1,692 @@ +package org.mavlink.qgroundcontrol; + +/* Copyright 2013 Google Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + * + * Project home page: http://code.google.com/p/usb-serial-for-android/ + */ +/////////////////////////////////////////////////////////////////////////////////////////// +// Written by: Mike Goza April 2014 +// +// These routines interface with the Android USB Host devices for serial port communication. +// The code uses the usb-serial-for-android software library. The QGCActivity class is the +// interface to the C++ routines through jni calls. Do not change the functions without also +// changing the corresponding calls in the C++ routines or you will break the interface. +// +//////////////////////////////////////////////////////////////////////////////////////////// + +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.io.IOException; + +import android.app.Activity; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.hardware.usb.*; +import android.widget.Toast; +import android.util.Log; +import android.os.PowerManager; +//-- Text To Speech +import android.os.Bundle; +import android.speech.tts.TextToSpeech; + +import com.hoho.android.usbserial.driver.*; +import org.qtproject.qt5.android.bindings.QtActivity; +import org.qtproject.qt5.android.bindings.QtApplication; + +public class QGCActivity extends QtActivity implements TextToSpeech.OnInitListener +{ + public static int BAD_PORT = 0; + private static QGCActivity m_instance; + private static UsbManager m_manager; // ANDROID USB HOST CLASS + private static List m_devices; // LIST OF CURRENT DEVICES + private static HashMap m_openedDevices; // LIST OF OPENED DEVICES + private static HashMap m_ioManager; // THREADS FOR LISTENING FOR INCOMING DATA + private static HashMap m_userData; // CORRESPONDING USER DATA FOR OPENED DEVICES. USED IN DISCONNECT CALLBACK + // USED TO DETECT WHEN A DEVICE HAS BEEN UNPLUGGED + private BroadcastReceiver m_UsbReceiver = null; + private final static ExecutorService m_Executor = Executors.newSingleThreadExecutor(); + private static final String TAG = "QGC_QGCActivity"; + private static TextToSpeech m_tts; + private static PowerManager.WakeLock m_wl; + + public static Context m_context; + + private final static UsbIoManager.Listener m_Listener = + new UsbIoManager.Listener() + { + @Override + public void onRunError(Exception eA, int userDataA) + { + Log.e(TAG, "onRunError Exception"); + nativeDeviceException(userDataA, eA.getMessage()); + } + + @Override + public void onNewData(final byte[] dataA, int userDataA) + { + nativeDeviceNewData(userDataA, dataA); + } + }; + + // NATIVE C++ FUNCTION THAT WILL BE CALLED IF THE DEVICE IS UNPLUGGED + private static native void nativeDeviceHasDisconnected(int userDataA); + private static native void nativeDeviceException(int userDataA, String messageA); + private static native void nativeDeviceNewData(int userDataA, byte[] dataA); + + // Native C++ functions called to log output + public static native void qgcLogDebug(String message); + public static native void qgcLogWarning(String message); + + //////////////////////////////////////////////////////////////////////////////////////////////// + // + // Constructor. Only used once to create the initial instance for the static functions. + // + //////////////////////////////////////////////////////////////////////////////////////////////// + public QGCActivity() + { + m_instance = this; + m_openedDevices = new HashMap(); + m_userData = new HashMap(); + m_ioManager = new HashMap(); + Log.i(TAG, "Instance created"); + } + + ///////////////////////////////////////////////////////////////////////////////////////////////////////// + // + // Text To Speech + // Pigback a ride for providing TTS to QGC + // + ///////////////////////////////////////////////////////////////////////////////////////////////////////// + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + m_tts = new TextToSpeech(this,this); + PowerManager pm = (PowerManager)m_instance.getSystemService(Context.POWER_SERVICE); + m_wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "QGroundControl"); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + m_tts.shutdown(); + } + + public void onInit(int status) { + } + + public static void say(String msg) + { + Log.i(TAG, "Say: " + msg); + m_tts.speak(msg, TextToSpeech.QUEUE_FLUSH, null); + } + + public static void keepScreenOn() + { + if(m_wl != null) { + m_wl.acquire(); + Log.i(TAG, "SCREEN_BRIGHT_WAKE_LOCK acquired."); + } else { + Log.i(TAG, "SCREEN_BRIGHT_WAKE_LOCK not acquired!!!"); + } + } + + public static void restoreScreenOn() + { + if(m_wl != null) { + m_wl.release(); + Log.i(TAG, "SCREEN_BRIGHT_WAKE_LOCK released."); + } + } + + ///////////////////////////////////////////////////////////////////////////////////////////////////////// + // + // Find all current devices that match the device filter described in the androidmanifest.xml and the + // device_filter.xml + // + ///////////////////////////////////////////////////////////////////////////////////////////////////////// + private static boolean getCurrentDevices() + { + if (m_instance == null) + return false; + + if (m_manager == null) + m_manager = (UsbManager)m_instance.getSystemService(Context.USB_SERVICE); + + if (m_devices != null) + m_devices.clear(); + + m_devices = UsbSerialProber.findAllDevices(m_manager); + + return true; + } + + ///////////////////////////////////////////////////////////////////////////////////////////////////////// + // + // List all available devices that are not already open. It returns the serial port info + // in a : separated string array. Each string entry consists of the following: + // + // DeviceName:Company:ProductId:VendorId + // + ///////////////////////////////////////////////////////////////////////////////////////////////////////// + public static String[] availableDevicesInfo() + { + // GET THE LIST OF CURRENT DEVICES + if (!getCurrentDevices()) + { + Log.e(TAG, "QGCActivity instance not present"); + return null; + } + + // MAKE SURE WE HAVE ENTRIES + if (m_devices.size() <= 0) + { + //Log.e(TAG, "No USB devices found"); + return null; + } + + if (m_openedDevices == null) + { + Log.e(TAG, "m_openedDevices is null"); + return null; + } + + int countL = 0; + int iL; + + // CHECK FOR ALREADY OPENED DEVICES AND DON"T INCLUDE THEM IN THE COUNT + for (iL=0; iL 0) + { + final Listener listener = getListener(); + if (listener != null) + { + final byte[] data = new byte[len]; + mReadBuffer.get(data, 0, len); + listener.onNewData(data, mUserData); + } + mReadBuffer.clear(); + } +/* + // Handle outgoing data. + byte[] outBuff = null; + synchronized (mWriteBuffer) + { + if (mWriteBuffer.position() > 0) + { + len = mWriteBuffer.position(); + outBuff = new byte[len]; + mWriteBuffer.rewind(); + mWriteBuffer.get(outBuff, 0, len); + mWriteBuffer.clear(); + } + } + if (outBuff != null) + mDriver.write(outBuff, READ_WAIT_MILLIS); +*/ + } +} + diff --git a/android/src/org/qgroundcontrol/qgchelper/UsbDeviceJNI.java b/android/src/org/qgroundcontrol/qgchelper/UsbDeviceJNI.java deleted file mode 100644 index 183d5c2..0000000 --- a/android/src/org/qgroundcontrol/qgchelper/UsbDeviceJNI.java +++ /dev/null @@ -1,692 +0,0 @@ -package org.qgroundcontrol.qgchelper; - -/* Copyright 2013 Google Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * Project home page: http://code.google.com/p/usb-serial-for-android/ - */ -/////////////////////////////////////////////////////////////////////////////////////////// -// Written by: Mike Goza April 2014 -// -// These routines interface with the Android USB Host devices for serial port communication. -// The code uses the usb-serial-for-android software library. The UsbDeviceJNI class is the -// interface to the C++ routines through jni calls. Do not change the functions without also -// changing the corresponding calls in the C++ routines or you will break the interface. -// -//////////////////////////////////////////////////////////////////////////////////////////// - -import java.util.HashMap; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.io.IOException; - -import android.app.Activity; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.hardware.usb.*; -import android.widget.Toast; -import android.util.Log; -import android.os.PowerManager; -//-- Text To Speech -import android.os.Bundle; -import android.speech.tts.TextToSpeech; - -import com.hoho.android.usbserial.driver.*; -import org.qtproject.qt5.android.bindings.QtActivity; -import org.qtproject.qt5.android.bindings.QtApplication; - -public class UsbDeviceJNI extends QtActivity implements TextToSpeech.OnInitListener -{ - public static int BAD_PORT = 0; - private static UsbDeviceJNI m_instance; - private static UsbManager m_manager; // ANDROID USB HOST CLASS - private static List m_devices; // LIST OF CURRENT DEVICES - private static HashMap m_openedDevices; // LIST OF OPENED DEVICES - private static HashMap m_ioManager; // THREADS FOR LISTENING FOR INCOMING DATA - private static HashMap m_userData; // CORRESPONDING USER DATA FOR OPENED DEVICES. USED IN DISCONNECT CALLBACK - // USED TO DETECT WHEN A DEVICE HAS BEEN UNPLUGGED - private BroadcastReceiver m_UsbReceiver = null; - private final static ExecutorService m_Executor = Executors.newSingleThreadExecutor(); - private static final String TAG = "QGC_UsbDeviceJNI"; - private static TextToSpeech m_tts; - private static PowerManager.WakeLock m_wl; - - public static Context m_context; - - private final static UsbIoManager.Listener m_Listener = - new UsbIoManager.Listener() - { - @Override - public void onRunError(Exception eA, int userDataA) - { - Log.e(TAG, "onRunError Exception"); - nativeDeviceException(userDataA, eA.getMessage()); - } - - @Override - public void onNewData(final byte[] dataA, int userDataA) - { - nativeDeviceNewData(userDataA, dataA); - } - }; - - // NATIVE C++ FUNCTION THAT WILL BE CALLED IF THE DEVICE IS UNPLUGGED - private static native void nativeDeviceHasDisconnected(int userDataA); - private static native void nativeDeviceException(int userDataA, String messageA); - private static native void nativeDeviceNewData(int userDataA, byte[] dataA); - - // Native C++ functions called to log output - public static native void qgcLogDebug(String message); - public static native void qgcLogWarning(String message); - - //////////////////////////////////////////////////////////////////////////////////////////////// - // - // Constructor. Only used once to create the initial instance for the static functions. - // - //////////////////////////////////////////////////////////////////////////////////////////////// - public UsbDeviceJNI() - { - m_instance = this; - m_openedDevices = new HashMap(); - m_userData = new HashMap(); - m_ioManager = new HashMap(); - Log.i(TAG, "Instance created"); - } - - ///////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // Text To Speech - // Pigback a ride for providing TTS to QGC - // - ///////////////////////////////////////////////////////////////////////////////////////////////////////// - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - m_tts = new TextToSpeech(this,this); - PowerManager pm = (PowerManager)m_instance.getSystemService(Context.POWER_SERVICE); - m_wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "QGroundControl"); - } - - @Override - protected void onDestroy() { - super.onDestroy(); - m_tts.shutdown(); - } - - public void onInit(int status) { - } - - public static void say(String msg) - { - Log.i(TAG, "Say: " + msg); - m_tts.speak(msg, TextToSpeech.QUEUE_FLUSH, null); - } - - public static void keepScreenOn() - { - if(m_wl != null) { - m_wl.acquire(); - Log.i(TAG, "SCREEN_BRIGHT_WAKE_LOCK acquired."); - } else { - Log.i(TAG, "SCREEN_BRIGHT_WAKE_LOCK not acquired!!!"); - } - } - - public static void restoreScreenOn() - { - if(m_wl != null) { - m_wl.release(); - Log.i(TAG, "SCREEN_BRIGHT_WAKE_LOCK released."); - } - } - - ///////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // Find all current devices that match the device filter described in the androidmanifest.xml and the - // device_filter.xml - // - ///////////////////////////////////////////////////////////////////////////////////////////////////////// - private static boolean getCurrentDevices() - { - if (m_instance == null) - return false; - - if (m_manager == null) - m_manager = (UsbManager)m_instance.getSystemService(Context.USB_SERVICE); - - if (m_devices != null) - m_devices.clear(); - - m_devices = UsbSerialProber.findAllDevices(m_manager); - - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // List all available devices that are not already open. It returns the serial port info - // in a : separated string array. Each string entry consists of the following: - // - // DeviceName:Company:ProductId:VendorId - // - ///////////////////////////////////////////////////////////////////////////////////////////////////////// - public static String[] availableDevicesInfo() - { - // GET THE LIST OF CURRENT DEVICES - if (!getCurrentDevices()) - { - Log.e(TAG, "UsbDeviceJNI instance not present"); - return null; - } - - // MAKE SURE WE HAVE ENTRIES - if (m_devices.size() <= 0) - { - //Log.e(TAG, "No USB devices found"); - return null; - } - - if (m_openedDevices == null) - { - Log.e(TAG, "m_openedDevices is null"); - return null; - } - - int countL = 0; - int iL; - - // CHECK FOR ALREADY OPENED DEVICES AND DON"T INCLUDE THEM IN THE COUNT - for (iL=0; iL 0) - { - final Listener listener = getListener(); - if (listener != null) - { - final byte[] data = new byte[len]; - mReadBuffer.get(data, 0, len); - listener.onNewData(data, mUserData); - } - mReadBuffer.clear(); - } -/* - // Handle outgoing data. - byte[] outBuff = null; - synchronized (mWriteBuffer) - { - if (mWriteBuffer.position() > 0) - { - len = mWriteBuffer.position(); - outBuff = new byte[len]; - mWriteBuffer.rewind(); - mWriteBuffer.get(outBuff, 0, len); - mWriteBuffer.clear(); - } - } - if (outBuff != null) - mDriver.write(outBuff, READ_WAIT_MILLIS); -*/ - } -} - diff --git a/libs/qtandroidserialport/src/qserialport_android.cpp b/libs/qtandroidserialport/src/qserialport_android.cpp index 9e8060c..91668ec 100644 --- a/libs/qtandroidserialport/src/qserialport_android.cpp +++ b/libs/qtandroidserialport/src/qserialport_android.cpp @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE #define BAD_PORT 0 -static const char kJniClassName[] {"org/qgroundcontrol/qgchelper/UsbDeviceJNI"}; +static const char kJniClassName[] {"org/mavlink/qgroundcontrol/QGCActivity"}; static const char kJTag[] {"QGC_QSerialPort"}; static void jniDeviceHasDisconnected(JNIEnv *envA, jobject thizA, jint userDataA) diff --git a/libs/qtandroidserialport/src/qserialportinfo_android.cpp b/libs/qtandroidserialport/src/qserialportinfo_android.cpp index 63fbcb3..1580189 100644 --- a/libs/qtandroidserialport/src/qserialportinfo_android.cpp +++ b/libs/qtandroidserialport/src/qserialportinfo_android.cpp @@ -45,7 +45,7 @@ #include QT_BEGIN_NAMESPACE -static const char V_jniClassName[] {"org/qgroundcontrol/qgchelper/UsbDeviceJNI"}; +static const char V_jniClassName[] {"org/mavlink/qgroundcontrol/QGCActivity"}; static const char V_TAG[] {"QGC_QSerialPortInfo"}; extern void cleanJavaException(); diff --git a/src/GAudioOutput.cc b/src/GAudioOutput.cc index 480e04d..b330e78 100644 --- a/src/GAudioOutput.cc +++ b/src/GAudioOutput.cc @@ -61,7 +61,7 @@ bool GAudioOutput::say(const QString& inText) if (!muted && !qgcApp()->runningUnitTests()) { #if defined __android__ #if defined QGC_SPEECH_ENABLED - static const char V_jniClassName[] {"org/qgroundcontrol/qgchelper/UsbDeviceJNI"}; + static const char V_jniClassName[] {"org/mavlink/qgroundcontrol/QGCActivity"}; QAndroidJniEnvironment env; if (env->ExceptionCheck()) { env->ExceptionDescribe(); diff --git a/src/MobileScreenMgr.cc b/src/MobileScreenMgr.cc index 8ac1a92..010929a 100644 --- a/src/MobileScreenMgr.cc +++ b/src/MobileScreenMgr.cc @@ -13,7 +13,7 @@ #include #include -static const char* kJniClassName = "org/qgroundcontrol/qgchelper/UsbDeviceJNI"; +static const char* kJniClassName = "org/mavlink/qgroundcontrol/QGCActivity"; void MobileScreenMgr::setKeepScreenOn(bool keepScreenOn) {