Merge pull request #114 from outspace/dev

Set security screen for Android app
This commit is contained in:
pokamest 2022-09-23 23:41:42 +03:00 committed by GitHub
commit 59248b7c2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,6 +11,7 @@
#include <QStandardPaths>
#ifdef Q_OS_ANDROID
#include <QtAndroid>
#include "platforms/android/android_controller.h"
#endif
@ -23,7 +24,16 @@ StartPageLogic::StartPageLogic(UiLogic *logic, QObject *parent):
m_pushButtonBackFromStartVisible{true},
m_ipAddressPortRegex{Utils::ipAddressPortRegExp()}
{
#ifdef Q_OS_ANDROID
// Set security screen for Android app
QtAndroid::runOnAndroidThread([]() {
QAndroidJniObject window = QtAndroid::androidActivity().callObjectMethod("getWindow", "()Landroid/view/Window;");
if (window.isValid()){
const int FLAG_SECURE = 8192;
window.callMethod<void>("addFlags", "(I)V", FLAG_SECURE);
}
});
#endif
}
void StartPageLogic::onUpdatePage()