From 80187812e12cc99e3545cb5fb0f4db1021769fff Mon Sep 17 00:00:00 2001 From: Swapnil Tripathi Date: Sun, 15 Aug 2021 03:41:06 +0530 Subject: [PATCH] Fix signatures and types. --- android/AndroidManifest.xml | 2 +- android/src/org/kde/kasts/KastsActivity.java | 4 ++-- src/mediasessionclient.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index aa9f05b9..a6406f89 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -7,7 +7,7 @@ diff --git a/android/src/org/kde/kasts/KastsActivity.java b/android/src/org/kde/kasts/KastsActivity.java index 23559452..49e096df 100755 --- a/android/src/org/kde/kasts/KastsActivity.java +++ b/android/src/org/kde/kasts/KastsActivity.java @@ -243,7 +243,7 @@ public class KastsActivity extends QtActivity activity.updateNotification(); } - public static void setDuration(int duration) + public static void setDuration(long duration) { Log.d(TAG, "JAVA setDuration called."); mediaData.duration = duration; @@ -251,7 +251,7 @@ public class KastsActivity extends QtActivity activity.updateNotification(); } - public static void setPosition(int position) + public static void setPosition(long position) { Log.d(TAG, "JAVA setPosition called."); mediaData.position = position; diff --git a/src/mediasessionclient.cpp b/src/mediasessionclient.cpp index 764c73e2..52c4c561 100644 --- a/src/mediasessionclient.cpp +++ b/src/mediasessionclient.cpp @@ -125,7 +125,7 @@ void MediaSessionClient::setSessionMetadata() int rate = m_audioPlayer->playbackRate(); // Playback rate - QAndroidJniObject::callStaticMethod("org/kde/kasts/KastsActivity", "setMetadata","(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JJF)V",title.object(), author.object(), album.object(), position, duration, rate); + QAndroidJniObject::callStaticMethod("org/kde/kasts/KastsActivity", "setMetadata","(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JJF)V",title.object(), author.object(), album.object(), (jlong)position, (jlong)duration, (jfloat)rate); } void MediaSessionClient::setPlaybackRate() @@ -143,7 +143,7 @@ void MediaSessionClient::setDuration() * Sets the media session's playback duration. */ qint64 duration = qint64(m_audioPlayer->duration()); - QAndroidJniObject::callStaticMethod("org/kde/kasts/KastsActivity", "setDuration", "(I)V", duration); + QAndroidJniObject::callStaticMethod("org/kde/kasts/KastsActivity", "setDuration", "(J)V", (jlong)duration); } void MediaSessionClient::setPosition() @@ -152,5 +152,5 @@ void MediaSessionClient::setPosition() * Sets the media session's current playback position. */ qint64 position = qint64(m_audioPlayer->position()); - QAndroidJniObject::callStaticMethod("org/kde/kasts/KastsActivity", "setPosition", "(I)V", position); + QAndroidJniObject::callStaticMethod("org/kde/kasts/KastsActivity", "setPosition", "(J)V", (jlong)position); }