diff --git a/examples/tv-app/android/java/MessagesManager.cpp b/examples/tv-app/android/java/MessagesManager.cpp index dbcb5c5994504b..4e9fe8bfc915fd 100644 --- a/examples/tv-app/android/java/MessagesManager.cpp +++ b/examples/tv-app/android/java/MessagesManager.cpp @@ -74,7 +74,7 @@ void MessagesManager::InitializeWithObjects(jobject managerObject) } mPresentMessagesMethod = - env->GetMethodID(managerClass, "presentMessages", "(Ljava/lang/String;IIJILjava/lang/String;Ljava/util/HashMap;)Z"); + env->GetMethodID(managerClass, "presentMessages", "(Ljava/lang/String;IIJJLjava/lang/String;Ljava/util/HashMap;)Z"); if (mPresentMessagesMethod == nullptr) { ChipLogError(Zcl, "Failed to access MessagesManager 'presentMessages' method"); @@ -182,7 +182,7 @@ CHIP_ERROR MessagesManager::HandleGetMessages(AttributeValueEncoder & aEncoder) message.startTime = DataModel::Nullable(static_cast(jstartTime)); } - jfieldID durationField = env->GetFieldID(messageClass, "duration", "I"); + jfieldID durationField = env->GetFieldID(messageClass, "duration", "J"); jlong jduration = env->GetLongField(messageObject, durationField); if (jduration >= 0) { diff --git a/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/MessagesManagerStub.java b/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/MessagesManagerStub.java index 55d94209197559..c5ce0e3ca7eb56 100644 --- a/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/MessagesManagerStub.java +++ b/examples/tv-app/android/java/src/com/matter/tv/server/tvapp/MessagesManagerStub.java @@ -36,7 +36,7 @@ public MessagesManagerStub(int endpoint) { responseOptions.put(new Long(1), "Yes"); responseOptions.put(new Long(2), "No"); presentMessages( - "31323334353637383930313233343536", 1, 1, 30, 60, "TestMessage", responseOptions); + "31323334353637383930313233343536", 1, 1, 30, 60000, "TestMessage", responseOptions); Log.d(TAG, "MessagesManagerStub: added dummy message"); }