QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
AndroidInterface Namespace Reference

Classes

class  JniLocalRef

Enumerations

enum class  BackgroundWork { VehicleLink = 1 << 0 , VideoRecording = 1 << 1 }
 What should go on while the app is in the background, where Android freezes an app and cuts its network. More...

Functions

static const QLoggingCategory & javaLogCategory (const QString &message)
static void jniLogDebug (JNIEnv *, jobject, jstring message)
static void jniLogWarning (JNIEnv *, jobject, jstring message)
static void jniStoragePermissionsResult (JNIEnv *, jobject, jboolean granted)
static void jniOnImportResult (JNIEnv *env, jobject, jstring filePathA)
void setNativeMethods ()
bool checkStoragePermissions ()
QString getSDCardPath ()
void openFileImportDialog (const QString &destPath, std::function< void(const QString &)> callback)
void setKeepScreenOn (bool on)
void setBackgroundWork (BackgroundWork work, bool active)

Variables

static std::function< void(const QString &)> s_importCallback
static QSharedPointer< QLocks::QLockBase > s_partialWakeLock
static QSharedPointer< QLocks::QLockBase > s_wifiLock
constexpr const char * kJniQGCActivityClassName = "org/mavlink/qgroundcontrol/QGCActivity"

Enumeration Type Documentation

◆ BackgroundWork

What should go on while the app is in the background, where Android freezes an app and cuts its network.

Enumerator
VehicleLink 
VideoRecording 

Definition at line 15 of file AndroidInterface.h.

Function Documentation

◆ checkStoragePermissions()

bool AndroidInterface::checkStoragePermissions ( )

◆ getSDCardPath()

QString AndroidInterface::getSDCardPath ( )

◆ javaLogCategory()

const QLoggingCategory & AndroidInterface::javaLogCategory ( const QString & message)
static

The category of a message from Java, which starts with the tag that Java logged it under. The classes of the USB serial ports have tags that start alike.

Definition at line 32 of file AndroidInterface.cc.

References javaLogCategory().

Referenced by javaLogCategory(), jniLogDebug(), and jniLogWarning().

◆ jniLogDebug()

void AndroidInterface::jniLogDebug ( JNIEnv * ,
jobject ,
jstring message )
static

Definition at line 37 of file AndroidInterface.cc.

References javaLogCategory(), and jniLogDebug().

Referenced by jniLogDebug(), and setNativeMethods().

◆ jniLogWarning()

void AndroidInterface::jniLogWarning ( JNIEnv * ,
jobject ,
jstring message )
static

Definition at line 43 of file AndroidInterface.cc.

References javaLogCategory(), and jniLogWarning().

Referenced by jniLogWarning(), and setNativeMethods().

◆ jniOnImportResult()

void AndroidInterface::jniOnImportResult ( JNIEnv * env,
jobject ,
jstring filePathA )
static

Definition at line 120 of file AndroidInterface.cc.

References jniOnImportResult(), and s_importCallback.

Referenced by jniOnImportResult(), and setNativeMethods().

◆ jniStoragePermissionsResult()

void AndroidInterface::jniStoragePermissionsResult ( JNIEnv * ,
jobject ,
jboolean granted )
static

◆ openFileImportDialog()

void AndroidInterface::openFileImportDialog ( const QString & destPath,
std::function< void(const QString &)> callback )

◆ setBackgroundWork()

void AndroidInterface::setBackgroundWork ( BackgroundWork work,
bool active )

While any work is active, a foreground service with its notification keeps the app's process and network alive in the background, and the CPU and Wi-Fi awake with the screen off. Qt still pauses the main thread there: what other threads do goes on, as a video recording does.

Definition at line 232 of file AndroidInterface.cc.

References kJniQGCActivityClassName, and setBackgroundWork().

Referenced by setBackgroundWork().

◆ setKeepScreenOn()

void AndroidInterface::setKeepScreenOn ( bool on)

Definition at line 216 of file AndroidInterface.cc.

References s_partialWakeLock, s_wifiLock, and setKeepScreenOn().

Referenced by setKeepScreenOn().

◆ setNativeMethods()

void AndroidInterface::setNativeMethods ( )

Variable Documentation

◆ kJniQGCActivityClassName

const char* AndroidInterface::kJniQGCActivityClassName = "org/mavlink/qgroundcontrol/QGCActivity"
constexpr

◆ s_importCallback

std::function<void(const QString&)> AndroidInterface::s_importCallback
static

Definition at line 28 of file AndroidInterface.cc.

Referenced by jniOnImportResult(), and openFileImportDialog().

◆ s_partialWakeLock

QSharedPointer<QLocks::QLockBase> AndroidInterface::s_partialWakeLock
static

Definition at line 213 of file AndroidInterface.cc.

Referenced by setKeepScreenOn().

◆ s_wifiLock

QSharedPointer<QLocks::QLockBase> AndroidInterface::s_wifiLock
static

Definition at line 214 of file AndroidInterface.cc.

Referenced by setKeepScreenOn().