Add passing the VPN connection status when rebinding to the service

This commit is contained in:
albexk 2023-12-05 16:10:29 +03:00
parent 5835a756ce
commit dc6e3ec53b
8 changed files with 65 additions and 28 deletions

View file

@ -92,12 +92,10 @@ void AmneziaApplication::init()
#ifdef Q_OS_ANDROID
connect(AndroidController::instance(), &AndroidController::serviceIsAlive, this,
[this](bool connected) {
if (connected) {
m_connectionController->onConnectionStateChanged(Vpn::ConnectionState::Connected);
if (m_vpnConnection)
m_vpnConnection->restoreConnection();
}
[this](Vpn::ConnectionState state) {
m_connectionController->onConnectionStateChanged(state);
if (m_vpnConnection)
m_vpnConnection->restoreConnection();
});
if (!AndroidController::instance()->initialize()) {
qCritical() << QString("Init failed");