Android notification and routing (#797)

Android notification and routing
This commit is contained in:
albexk 2024-05-12 18:04:14 +03:00 committed by GitHub
parent ff348a348c
commit abb3c918e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 1108 additions and 543 deletions

View file

@ -30,6 +30,9 @@ SettingsController::SettingsController(const QSharedPointer<ServersModel> &serve
{
m_appVersion = QString("%1 (%2, %3)").arg(QString(APP_VERSION), __DATE__, GIT_COMMIT_HASH);
checkIfNeedDisableLogs();
#ifdef Q_OS_ANDROID
connect(AndroidController::instance(), &AndroidController::notificationStateChanged, this, &SettingsController::onNotificationStateChanged);
#endif
}
void SettingsController::toggleAmneziaDns(bool enable)
@ -233,3 +236,19 @@ void SettingsController::toggleKillSwitch(bool enable)
{
m_settings->setKillSwitchEnabled(enable);
}
bool SettingsController::isNotificationPermissionGranted()
{
#ifdef Q_OS_ANDROID
return AndroidController::instance()->isNotificationPermissionGranted();
#else
return true;
#endif
}
void SettingsController::requestNotificationPermission()
{
#ifdef Q_OS_ANDROID
AndroidController::instance()->requestNotificationPermission();
#endif
}