Commit 821f08c8 authored by Don Gagne's avatar Don Gagne

parent 6a56f545
......@@ -69,6 +69,8 @@
<uses-feature android:name="android.hardware.location" android:required="false"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
Remove the comment if you do not require these default features. -->
......
......@@ -76,6 +76,8 @@ void AppLogModel::writeMessages(const QString dest_file)
QTextStream out(&file);
out << writebuffer;
success = out.status() == QTextStream::Ok;
} else {
qWarning() << "AppLogModel::writeMessages write failed:" << file.errorString();
}
emit debug_model->writeFinished(success);
});
......
......@@ -133,6 +133,7 @@ QGCView {
id: writeDialog
folder: QGroundControl.settingsManager.appSettings.logSavePath
nameFilters: [qsTr("Log files (*.txt)"), qsTr("All Files (*)")]
fileExtension: qsTr("txt")
selectExisting: false
title: qsTr("Select log save file")
qgcView: _qgcView
......
......@@ -97,6 +97,21 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved)
}
#endif
#ifdef __android__
#include <QtAndroid>
bool checkAndroidWritePermission() {
QtAndroid::PermissionResult r = QtAndroid::checkPermission("android.permission.WRITE_EXTERNAL_STORAGE");
if(r == QtAndroid::PermissionResult::Denied) {
QtAndroid::requestPermissionsSync( QStringList() << "android.permission.WRITE_EXTERNAL_STORAGE" );
r = QtAndroid::checkPermission("android.permission.WRITE_EXTERNAL_STORAGE");
if(r == QtAndroid::PermissionResult::Denied) {
return false;
}
}
return true;
}
#endif
/**
* @brief Starts the application
*
......@@ -254,6 +269,10 @@ int main(int argc, char *argv[])
} else
#endif
{
#ifdef __android__
checkAndroidWritePermission();
#endif
if (!app->_initForNormalAppBoot()) {
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment