ActivityTracker.cpp 666 B

12345678910111213141516171819202122
  1. // Copyright 2024 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include <jni.h>
  4. #include "Common/Logging/Log.h"
  5. #include "Core/AchievementManager.h"
  6. extern "C" {
  7. JNIEXPORT void JNICALL
  8. Java_org_dolphinemu_dolphinemu_utils_ActivityTracker_setBackgroundExecutionAllowedNative(
  9. JNIEnv*, jclass, jboolean allowed)
  10. {
  11. // This is called with allowed == false when the app goes into the background.
  12. // We use this to stop continuously running background threads so we don't waste battery.
  13. INFO_LOG_FMT(CORE, "SetBackgroundExecutionAllowed {}", allowed);
  14. AchievementManager::GetInstance().SetBackgroundExecutionAllowed(allowed);
  15. }
  16. }