summaryrefslogtreecommitdiff
path: root/Source/Android/jni/AndroidCommon
diff options
context:
space:
mode:
authorTom Pratt <tom.pratt@outlook.com>2026-04-30 10:16:20 +0200
committerTom Pratt <tompratt@squareup.com>2026-05-19 12:02:58 +0200
commitacbf9e155f8e0397e6bfa2f3d00bad0e5f5ecbcf (patch)
treec581744bba8bd33e37c9173f4cdd92be41b24823 /Source/Android/jni/AndroidCommon
parent117d1d71acc6b85b6c67396bd2222fbee7f0ff05 (diff)
Game digest progress dialog
We just about get away with using a StateFlow in NetplaySession since the host sends AbortGameDigest when closing their own dialog. Without that it would be harder for the UI to distinguish between subsequent dialogs. If that wasn't the case then NetplaySession might need to expose the individual progress and result updates and have the view model assemble it into the overall GameDigestProgress.
Diffstat (limited to 'Source/Android/jni/AndroidCommon')
-rw-r--r--Source/Android/jni/AndroidCommon/IDCache.cpp32
-rw-r--r--Source/Android/jni/AndroidCommon/IDCache.h4
2 files changed, 36 insertions, 0 deletions
diff --git a/Source/Android/jni/AndroidCommon/IDCache.cpp b/Source/Android/jni/AndroidCommon/IDCache.cpp
index caf305fc9b..91f7599078 100644
--- a/Source/Android/jni/AndroidCommon/IDCache.cpp
+++ b/Source/Android/jni/AndroidCommon/IDCache.cpp
@@ -44,6 +44,10 @@ static jmethodID s_netplay_on_show_chunked_progress_dialog;
static jmethodID s_netplay_on_set_chunked_progress;
static jmethodID s_netplay_on_hide_chunked_progress_dialog;
static jmethodID s_netplay_on_desync;
+static jmethodID s_netplay_on_show_game_digest_dialog;
+static jmethodID s_netplay_on_set_game_digest_progress;
+static jmethodID s_netplay_on_set_game_digest_result;
+static jmethodID s_netplay_on_abort_game_digest;
static jclass s_netplay_player_class;
static jmethodID s_netplay_player_constructor;
@@ -333,6 +337,26 @@ jmethodID GetNetplayOnDesync()
return s_netplay_on_desync;
}
+jmethodID GetNetplayOnShowGameDigestDialog()
+{
+ return s_netplay_on_show_game_digest_dialog;
+}
+
+jmethodID GetNetplayOnSetGameDigestProgress()
+{
+ return s_netplay_on_set_game_digest_progress;
+}
+
+jmethodID GetNetplayOnSetGameDigestResult()
+{
+ return s_netplay_on_set_game_digest_result;
+}
+
+jmethodID GetNetplayOnAbortGameDigest()
+{
+ return s_netplay_on_abort_game_digest;
+}
+
jclass GetNetplayPlayerClass()
{
return s_netplay_player_class;
@@ -774,6 +798,14 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved)
env->GetMethodID(netplay_class, "onHideChunkedProgressDialog", "()V");
s_netplay_on_desync =
env->GetMethodID(netplay_class, "onDesync", "(ILjava/lang/String;)V");
+ s_netplay_on_show_game_digest_dialog =
+ env->GetMethodID(netplay_class, "onShowGameDigestDialog", "(Ljava/lang/String;)V");
+ s_netplay_on_set_game_digest_progress =
+ env->GetMethodID(netplay_class, "onSetGameDigestProgress", "(II)V");
+ s_netplay_on_set_game_digest_result =
+ env->GetMethodID(netplay_class, "onSetGameDigestResult", "(ILjava/lang/String;)V");
+ s_netplay_on_abort_game_digest =
+ env->GetMethodID(netplay_class, "onAbortGameDigest", "()V");
env->DeleteLocalRef(netplay_class);
const jclass netplay_player_class =
diff --git a/Source/Android/jni/AndroidCommon/IDCache.h b/Source/Android/jni/AndroidCommon/IDCache.h
index ae86740f09..f610380908 100644
--- a/Source/Android/jni/AndroidCommon/IDCache.h
+++ b/Source/Android/jni/AndroidCommon/IDCache.h
@@ -47,6 +47,10 @@ jmethodID GetNetplayOnShowChunkedProgressDialog();
jmethodID GetNetplayOnSetChunkedProgress();
jmethodID GetNetplayOnHideChunkedProgressDialog();
jmethodID GetNetplayOnDesync();
+jmethodID GetNetplayOnShowGameDigestDialog();
+jmethodID GetNetplayOnSetGameDigestProgress();
+jmethodID GetNetplayOnSetGameDigestResult();
+jmethodID GetNetplayOnAbortGameDigest();
jclass GetNetplayPlayerClass();
jmethodID GetNetplayPlayerConstructor();