mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-21 02:01:03 +07:00
moved the platform-specific android code for the new ui
This commit is contained in:
@@ -8,36 +8,32 @@
|
||||
#include <QJniEnvironment>
|
||||
#include <QJniObject>
|
||||
|
||||
#include "ui/pages_logic/StartPageLogic.h"
|
||||
|
||||
#include "protocols/vpnprotocol.h"
|
||||
|
||||
using namespace amnezia;
|
||||
|
||||
|
||||
class AndroidController : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AndroidController();
|
||||
static AndroidController* instance();
|
||||
static AndroidController *instance();
|
||||
|
||||
virtual ~AndroidController() override = default;
|
||||
|
||||
bool initialize(StartPageLogic *startPageLogic);
|
||||
bool initialize();
|
||||
|
||||
ErrorCode start();
|
||||
void stop();
|
||||
void resumeStart();
|
||||
|
||||
void checkStatus();
|
||||
void setNotificationText(const QString& title, const QString& message, int timerSec);
|
||||
void shareConfig(const QString& data, const QString& suggestedName);
|
||||
void setNotificationText(const QString &title, const QString &message, int timerSec);
|
||||
void shareConfig(const QString &data, const QString &suggestedName);
|
||||
void setFallbackConnectedNotification();
|
||||
void getBackendLogs(std::function<void(const QString&)>&& callback);
|
||||
void getBackendLogs(std::function<void(const QString &)> &&callback);
|
||||
void cleanupBackendLogs();
|
||||
void importConfig(const QString& data);
|
||||
|
||||
const QJsonObject &vpnConfig() const;
|
||||
void setVpnConfig(const QJsonObject &newVpnConfig);
|
||||
@@ -45,18 +41,20 @@ public:
|
||||
void startQrReaderActivity();
|
||||
|
||||
signals:
|
||||
void connectionStateChanged(VpnProtocol::VpnConnectionState state);
|
||||
void connectionStateChanged(Vpn::ConnectionState state);
|
||||
|
||||
// This signal is emitted when the controller is initialized. Note that the
|
||||
// VPN tunnel can be already active. In this case, "connected" should be set
|
||||
// to true and the "connectionDate" should be set to the activation date if
|
||||
// known.
|
||||
// If "status" is set to false, the backend service is considered unavailable.
|
||||
void initialized(bool status, bool connected, const QDateTime& connectionDate);
|
||||
void initialized(bool status, bool connected, const QDateTime &connectionDate);
|
||||
|
||||
void statusUpdated(QString totalRx, QString totalTx, QString endpoint, QString deviceIPv4);
|
||||
void scheduleStatusCheckSignal();
|
||||
|
||||
void importConfigFromOutside(QString &data);
|
||||
|
||||
protected slots:
|
||||
void scheduleStatusCheckSlot();
|
||||
|
||||
@@ -65,12 +63,10 @@ private:
|
||||
|
||||
QJsonObject m_vpnConfig;
|
||||
|
||||
StartPageLogic *m_startPageLogic;
|
||||
|
||||
bool m_serviceConnected = false;
|
||||
std::function<void(const QString&)> m_logCallback;
|
||||
std::function<void(const QString &)> m_logCallback;
|
||||
|
||||
static void startActivityForResult(JNIEnv* env, jobject /*thiz*/, jobject intent);
|
||||
static void startActivityForResult(JNIEnv *env, jobject /*thiz*/, jobject intent);
|
||||
|
||||
bool isConnected = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user