summaryrefslogtreecommitdiff
path: root/Source/Android/jni/GameList/GameFile.cpp
diff options
context:
space:
mode:
authorTilka <tilkax@gmail.com>2025-04-25 01:43:53 +0100
committerGitHub <noreply@github.com>2025-04-25 01:43:53 +0100
commita95779add09bf24002ba9e5d0d5987d2c6945e47 (patch)
tree7ce613c858dd5d1f0a492019b7e99c427c87fe59 /Source/Android/jni/GameList/GameFile.cpp
parent5523b9a01b5e2628b3b22a5b97cb78aac0cd83f6 (diff)
parentb8e70df413ddd4663aa8e65a6f9d8a1e059c64c7 (diff)
Merge pull request #13506 from JosJuice/android-time-played
Android: Show time played in game details
Diffstat (limited to 'Source/Android/jni/GameList/GameFile.cpp')
-rw-r--r--Source/Android/jni/GameList/GameFile.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Android/jni/GameList/GameFile.cpp b/Source/Android/jni/GameList/GameFile.cpp
index 3bf60beb28..dc922d701c 100644
--- a/Source/Android/jni/GameList/GameFile.cpp
+++ b/Source/Android/jni/GameList/GameFile.cpp
@@ -3,12 +3,14 @@
#include "jni/GameList/GameFile.h"
+#include <chrono>
#include <memory>
#include <utility>
#include <vector>
#include <jni.h>
+#include "Core/TimePlayed.h"
#include "DiscIO/Blob.h"
#include "DiscIO/Enums.h"
#include "UICommon/GameFile.h"
@@ -190,6 +192,13 @@ JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_getBannerHe
return static_cast<jint>(GetRef(env, obj)->GetBannerImage().height);
}
+JNIEXPORT jlong JNICALL
+Java_org_dolphinemu_dolphinemu_model_GameFile_getTimePlayedMsInternal(JNIEnv* env, jobject obj)
+{
+ const std::chrono::milliseconds time = TimePlayed().GetTimePlayed(GetRef(env, obj)->GetGameID());
+ return time.count();
+}
+
JNIEXPORT jobject JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_parse(JNIEnv* env, jclass,
jstring path)
{