diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayer-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayer-JNI.cpp index 3f86681517a3f5..9f449943d360ee 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayer-JNI.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayer-JNI.cpp @@ -127,14 +127,16 @@ JNI_METHOD(jobject, VerifyOrEstablishConnection) "CastingPlayer::VerifyOrEstablishConnection(desiredEndpointFilter) on Casting Player with device ID: %s", castingPlayer->GetId()); // Convert the EndpointFilter Java class to a C++ EndpointFilter - jclass endpointFilterJavaClass = env->GetObjectClass(desiredEndpointFilterJavaObject); - jfieldID vendorIdFieldId = env->GetFieldID(endpointFilterJavaClass, "productId", "I"); - jfieldID productIdFieldId = env->GetFieldID(endpointFilterJavaClass, "vendorId", "I"); - jfieldID requiredDeviceTypesFieldId = env->GetFieldID(endpointFilterJavaClass, "requiredDeviceTypes", "Ljava/util/List;"); + jclass endpointFilterJavaClass = env->GetObjectClass(desiredEndpointFilterJavaObject); + jfieldID vendorIdFieldId = env->GetFieldID(endpointFilterJavaClass, "vendorId", "I"); + jfieldID productIdFieldId = env->GetFieldID(endpointFilterJavaClass, "productId", "I"); + // jfieldID requiredDeviceTypesFieldId = env->GetFieldID(endpointFilterJavaClass, "requiredDeviceTypes", + // "Ljava/util/List;"); matter::casting::core::EndpointFilter desiredEndpointFilter; - desiredEndpointFilter.vendorId = static_cast(env->GetIntField(desiredEndpointFilterJavaObject, vendorIdFieldId)); - desiredEndpointFilter.productId = static_cast(env->GetIntField(desiredEndpointFilterJavaObject, vendorIdFieldId)); + desiredEndpointFilter.vendorId = static_cast(env->GetIntField(desiredEndpointFilterJavaObject, vendorIdFieldId)); + desiredEndpointFilter.productId = + static_cast(env->GetIntField(desiredEndpointFilterJavaObject, productIdFieldId)); // TODO: In following PRs. Translate the Java requiredDeviceTypes list to a C++ requiredDeviceTypes vector. For now we're // passing an empty list of.