mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Merge pull request #12856 from LillyJadeKatrin/retroachievements-pause-v2
Handle Pausing in AchievementManager
This commit is contained in:
21
Source/Android/jni/ActivityTracker.cpp
Normal file
21
Source/Android/jni/ActivityTracker.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2024 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Core/AchievementManager.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_utils_ActivityTracker_setBackgroundExecutionAllowedNative(
|
||||
JNIEnv*, jclass, jboolean allowed)
|
||||
{
|
||||
// This is called with allowed == false when the app goes into the background.
|
||||
// We use this to stop continuously running background threads so we don't waste battery.
|
||||
|
||||
INFO_LOG_FMT(CORE, "SetBackgroundExecutionAllowed {}", allowed);
|
||||
AchievementManager::GetInstance().SetBackgroundExecutionAllowed(allowed);
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
add_library(main SHARED
|
||||
ActivityTracker.cpp
|
||||
Cheats/ARCheat.cpp
|
||||
Cheats/Cheats.h
|
||||
Cheats/GeckoCheat.cpp
|
||||
@ -11,6 +12,7 @@ add_library(main SHARED
|
||||
GameList/GameFile.cpp
|
||||
GameList/GameFile.h
|
||||
GameList/GameFileCache.cpp
|
||||
GpuDriver.cpp
|
||||
Host.cpp
|
||||
Host.h
|
||||
InfinityConfig.cpp
|
||||
@ -32,7 +34,6 @@ add_library(main SHARED
|
||||
RiivolutionPatches.cpp
|
||||
SkylanderConfig.cpp
|
||||
WiiUtils.cpp
|
||||
GpuDriver.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(main
|
||||
|
Reference in New Issue
Block a user