History

Android - Rollback pause/resume mechanism. Stop server checkIns, reset nodeList before entering background

Cristian Luis Duarte committed 8 years ago

Commit be8351d1 parent a878ad510 files · +36 −23Browse files

Showing the changes to interface/src/Application.cpp (1 of 10 files). Show all

Unified · Split

interface/src/Application.cpp+10−3
@@ -2259,6 +2259,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 2258 unmodified lines
22592259 qCDebug(interfaceapp) << "Metaverse session ID is" << uuidStringWithoutCurlyBraces(accountManager->getSessionID());
22602260
22612261 #if defined(Q_OS_ANDROID)
2262+ connect(&AndroidHelper::instance(), &AndroidHelper::beforeEnterBackground, this, &Application::beforeEnterBackground);
22622263 connect(&AndroidHelper::instance(), &AndroidHelper::enterBackground, this, &Application::enterBackground);
22632264 connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground);
22642265 AndroidHelper::instance().notifyLoadComplete();
@@ -8299,14 +8300,19 @@ void Application::saveNextPhysicsStats(QString filename) { · 6034 unmodified lines
82998300 }
83008301
83018302 #if defined(Q_OS_ANDROID)
8303+void Application::beforeEnterBackground() {
8304+ auto nodeList = DependencyManager::get<NodeList>();
8305+ nodeList->setSendDomainServerCheckInEnabled(false);
8306+ nodeList->reset(true);
8307+ clearDomainOctreeDetails();
8308+}
8309+
83028310 void Application::enterBackground() {
83038311 QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(),
83048312 "stop", Qt::BlockingQueuedConnection);
83058313 if (getActiveDisplayPlugin()->isActive()) {
83068314 getActiveDisplayPlugin()->deactivate();
83078315 }
8308− DependencyManager::get<ResourceCacheSharedItems>()->pausePendingRequests();
8309− clearDomainOctreeDetails();
83108316 }
83118317
83128318 void Application::enterForeground() {
@@ -8315,7 +8321,8 @@ void Application::enterForeground() { · 2 unmodified lines
83158321 if (!getActiveDisplayPlugin() || getActiveDisplayPlugin()->isActive() || !getActiveDisplayPlugin()->activate()) {
83168322 qWarning() << "Could not re-activate display plugin";
83178323 }
8318− DependencyManager::get<ResourceCacheSharedItems>()->resumePendingRequests();
8324+ auto nodeList = DependencyManager::get<NodeList>();
8325+ nodeList->setSendDomainServerCheckInEnabled(true);
83198326 }
83208327 #endif
83218328