Showing the changes to interface/src/AndroidHelper.cpp (1 of 10 files). Show all
Unified · Split
| @@ -14,7 +14,6 @@ · 13 unmodified lines | ||
| 14 | 14 | AndroidHelper::AndroidHelper() : |
| 15 | 15 | _accountManager () |
| 16 | 16 | { |
| 17 | − workerThread.start(); | |
| 18 | 17 | } |
| 19 | 18 | |
| 20 | 19 | AndroidHelper::~AndroidHelper() { |
| @@ -22,18 +21,20 @@ AndroidHelper::~AndroidHelper() { · 1 unmodified line | ||
| 22 | 21 | workerThread.wait(); |
| 23 | 22 | } |
| 24 | 23 | |
| 24 | +void AndroidHelper::init() { | |
| 25 | + qDebug() << "[LOGIN] AndroidHelper::init"; | |
| 26 | + workerThread.start(); | |
| 27 | + _accountManager = DependencyManager::get<AccountManager>(); | |
| 28 | + _accountManager->moveToThread(&workerThread); | |
| 29 | +} | |
| 30 | + | |
| 25 | 31 | QSharedPointer<AccountManager> AndroidHelper::getAccountManager() { |
| 26 | − if (!_accountManager) { | |
| 27 | − _accountManager = QSharedPointer<AccountManager>(new AccountManager, &QObject::deleteLater); | |
| 28 | − _accountManager->setIsAgent(true); | |
| 29 | − _accountManager->setAuthURL(NetworkingConstants::METAVERSE_SERVER_URL()); | |
| 30 | − _accountManager->moveToThread(&workerThread); | |
| 31 | − } | |
| 32 | + assert(_accountManager); | |
| 32 | 33 | return _accountManager; |
| 33 | 34 | } |
| 34 | 35 | |
| 35 | −void AndroidHelper::requestActivity(const QString &activityName) { | |
| 36 | − emit androidActivityRequested(activityName); | |
| 36 | +void AndroidHelper::requestActivity(const QString &activityName, const bool backToScene) { | |
| 37 | + emit androidActivityRequested(activityName, backToScene); | |
| 37 | 38 | } |
| 38 | 39 | |
| 39 | 40 | void AndroidHelper::notifyLoadComplete() { |
| @@ -48,3 +49,6 @@ void AndroidHelper::performHapticFeedback(const QString& feedbackConstant) { · 8 unmodified lines | ||
| 48 | 49 | emit hapticFeedbackRequested(feedbackConstant); |
| 49 | 50 | } |
| 50 | 51 | |
| 52 | +void AndroidHelper::showLoginDialog() { | |
| 53 | + emit androidActivityRequested("Login", true); | |
| 54 | +} | |