| 331 | } |
| 332 | |
| 333 | void UpdateStatus() { |
| 334 | ul::ScopedLock lock(g_LastAddedApplicationsLock); |
| 335 | ul::ScopedLock lock2(g_LastDeletedApplicationsLock); |
| 336 | g_CurrentStatus = { |
| 337 | .selected_user = g_SelectedUser, |
| 338 | .last_menu_index = g_CurrentMenuIndex, |
| 339 | .warned_about_outdated_theme = g_WarnedAboutOutdatedTheme, |
| 340 | .last_added_app_count = (u32)g_LastAddedApplications.size(), |
| 341 | .last_deleted_app_count = (u32)g_LastDeletedApplications.size(), |
| 342 | .in_verify_app_count = (u32)g_ApplicationVerifyContexts->size() |
| 343 | }; |
| 344 | |
| 345 | if(g_MenuRestartReloadThemeCache) { |
| 346 | g_CurrentStatus.reload_theme_cache = true; |
| 347 | g_MenuRestartReloadThemeCache = false; |
| 348 | } |
| 349 | |
| 350 | ul::util::CopyToStringBuffer(g_CurrentStatus.last_menu_fs_path, g_CurrentMenuFsPath); |
| 351 | ul::util::CopyToStringBuffer(g_CurrentStatus.last_menu_path, g_CurrentMenuPath); |
| 352 | |
| 353 | if(app::IsActive()) { |
| 354 | if(WasLoaderOpenedAsApplication()) { |
| 355 | // Homebrew |
| 356 | g_CurrentStatus.suspended_hb_target_ipt = g_LastHomebrewApplicationLaunchTarget; |
| 357 | } |
| 358 | else { |
| 359 | // Regular title |
| 360 | g_CurrentStatus.suspended_app_id = app::GetId(); |
| 361 | } |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | void HandleSleep() { |
| 366 | appletStartSleepSequence(true); |
no test coverage detected