Commit 14614ee5 authored by Volker Krause's avatar Volker Krause
Browse files

Fix handling of JNI jlong on 64bit Android

parent 0c3a34a4
Pipeline #104885 passed with stage
in 2 minutes and 21 seconds
......@@ -29,6 +29,8 @@ private Q_SLOTS:
// Jni::signature<java::lang::String[]()>() would be invalid C++, so we need alternatives for array returns
QCOMPARE((const char*)Jni::signature<java::lang::String*()>(), "()[Ljava/lang/String;");
QCOMPARE((const char*)Jni::signature<Jni::Array<java::lang::String>()>(), "()[Ljava/lang/String;");
QCOMPARE((const char*)Jni::signature<jlong()>(), "()J");
}
void testTypeName()
......
......@@ -90,7 +90,7 @@ static QString tzAbbreviation(const QDateTime &dt)
// the QTimeZone backend implementation on Android isn't as complete as the desktop ones, so we need to do this ourselves here
// eventually, this should be upstreamed to Qt
auto abbr = QAndroidJniObject::callStaticObjectMethod("org/kde/itinerary/QTimeZone", "abbreviation",
Jni::signature<java::lang::String(java::lang::String, long, java::util::Locale, bool)>(),
Jni::signature<java::lang::String(java::lang::String, jlong, java::util::Locale, bool)>(),
QAndroidJniObject::fromString(QString::fromUtf8(tz.id())).object(), dt.toMSecsSinceEpoch(),
KAndroidExtras::Locale::current().object(), tz.isDaylightTime(dt)).toString();
......
......@@ -9,6 +9,7 @@
#include "jnicommon.h"
#include <jni.h>
#include <cstdint>
#include <utility>
......@@ -71,7 +72,7 @@ template <> struct JniSignature<uint8_t> { constexpr inline auto operator()() co
template <> struct JniSignature<char> { constexpr inline auto operator()() const { return StaticString<'C'>(); } };
template <> struct JniSignature<short> { constexpr inline auto operator()() const { return StaticString<'S'>(); } };
template <> struct JniSignature<int> { constexpr inline auto operator()() const { return StaticString<'I'>(); } };
template <> struct JniSignature<long> { constexpr inline auto operator()() const { return StaticString<'J'>(); } };
template <> struct JniSignature<jlong> { constexpr inline auto operator()() const { return StaticString<'J'>(); } };
template <> struct JniSignature<float> { constexpr inline auto operator()() const { return StaticString<'F'>(); } };
template <> struct JniSignature<double> { constexpr inline auto operator()() const { return StaticString<'D'>(); } };
template <> struct JniSignature<void> { constexpr inline auto operator()() const { return StaticString<'V'>(); } };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment