Showing the changes to interface/src/Application.cpp (1 of 10 files). Show all
Unified · Split
| @@ -2259,6 +2259,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 2258 unmodified lines | |||
| 2259 | qCDebug(interfaceapp) << "Metaverse session ID is" << uuidStringWithoutCurlyBraces(accountManager->getSessionID()); | 2259 | qCDebug(interfaceapp) << "Metaverse session ID is" << uuidStringWithoutCurlyBraces(accountManager->getSessionID()); |
| 2260 | 2260 | ||
| 2261 | #if defined(Q_OS_ANDROID) | 2261 | #if defined(Q_OS_ANDROID) |
| 2262 | connect(&AndroidHelper::instance(), &AndroidHelper::beforeEnterBackground, this, &Application::beforeEnterBackground); | ||
| 2262 | connect(&AndroidHelper::instance(), &AndroidHelper::enterBackground, this, &Application::enterBackground); | 2263 | connect(&AndroidHelper::instance(), &AndroidHelper::enterBackground, this, &Application::enterBackground); |
| 2263 | connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground); | 2264 | connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground); |
| 2264 | AndroidHelper::instance().notifyLoadComplete(); | 2265 | AndroidHelper::instance().notifyLoadComplete(); |
| @@ -8299,14 +8300,19 @@ void Application::saveNextPhysicsStats(QString filename) { · 6034 unmodified lines | |||
| 8299 | } | 8300 | } |
| 8300 | 8301 | ||
| 8301 | #if defined(Q_OS_ANDROID) | 8302 | #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 | |||
| 8302 | void Application::enterBackground() { | 8310 | void Application::enterBackground() { |
| 8303 | QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), | 8311 | QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), |
| 8304 | "stop", Qt::BlockingQueuedConnection); | 8312 | "stop", Qt::BlockingQueuedConnection); |
| 8305 | if (getActiveDisplayPlugin()->isActive()) { | 8313 | if (getActiveDisplayPlugin()->isActive()) { |
| 8306 | getActiveDisplayPlugin()->deactivate(); | 8314 | getActiveDisplayPlugin()->deactivate(); |
| 8307 | } | 8315 | } |
| 8308 | DependencyManager::get<ResourceCacheSharedItems>()->pausePendingRequests(); | ||
| 8309 | clearDomainOctreeDetails(); | ||
| 8310 | } | 8316 | } |
| 8311 | 8317 | ||
| 8312 | void Application::enterForeground() { | 8318 | void Application::enterForeground() { |
| @@ -8315,7 +8321,8 @@ void Application::enterForeground() { · 2 unmodified lines | |||
| 8315 | if (!getActiveDisplayPlugin() || getActiveDisplayPlugin()->isActive() || !getActiveDisplayPlugin()->activate()) { | 8321 | if (!getActiveDisplayPlugin() || getActiveDisplayPlugin()->isActive() || !getActiveDisplayPlugin()->activate()) { |
| 8316 | qWarning() << "Could not re-activate display plugin"; | 8322 | qWarning() << "Could not re-activate display plugin"; |
| 8317 | } | 8323 | } |
| 8318 | DependencyManager::get<ResourceCacheSharedItems>()->resumePendingRequests(); | 8324 | auto nodeList = DependencyManager::get<NodeList>(); |
| 8325 | nodeList->setSendDomainServerCheckInEnabled(true); | ||
| 8319 | } | 8326 | } |
| 8320 | #endif | 8327 | #endif |
| 8321 | 8328 | ||