38 qCWarning(AndroidInterfaceLog) <<
"Storage permission request denied";
46 (void)QMetaObject::invokeMethod(
50 if (!settingsManager) {
54 AppSettings*
const appSettings = settingsManager->appSettings();
64 const QString appName = QCoreApplication::applicationName();
65 const QString currentSavePath = savePathFact->rawValue().toString();
66 const QString internalBasePath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
67 const QString internalSavePath = QDir(internalBasePath).filePath(appName);
69 if (!currentSavePath.isEmpty() && (currentSavePath != internalSavePath)) {
74 if (sdCardRootPath.isEmpty() || !QDir(sdCardRootPath).exists() || !QFileInfo(sdCardRootPath).isWritable()) {
78 const QString sdSavePath = QDir(sdCardRootPath).filePath(appName);
79 if (currentSavePath != sdSavePath) {
80 qCDebug(AndroidInterfaceLog) <<
"Applying SD card save path after permission grant:" << sdSavePath;
81 savePathFact->setRawValue(sdSavePath);
84 Qt::QueuedConnection);
89 qCDebug(AndroidInterfaceLog) <<
"Registering Native Functions";
91 const JNINativeMethod javaMethods[]{
92 {
"qgcLogDebug",
"(Ljava/lang/String;)V",
reinterpret_cast<void*
>(
jniLogDebug)},
93 {
"qgcLogWarning",
"(Ljava/lang/String;)V",
reinterpret_cast<void*
>(
jniLogWarning)},
100 qCDebug(AndroidInterfaceLog) <<
"Native Functions Registered";