Skip to content

Commit f712b2e

Browse files
Fix JNI bug in clientType
-- Fix icd clienttype with integer and align with generated type for clientType in other generated file -- Fix missing semicolon in the end of ()Ljava/lang/Short
1 parent 857525b commit f712b2e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/controller/java/AndroidDeviceControllerWrapper.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ CHIP_ERROR AndroidDeviceControllerWrapper::ApplyICDRegistrationInfo(chip::Contro
527527
jbyteArray jSymmetricKey = static_cast<jbyteArray>(env->CallObjectMethod(icdRegistrationInfo, getSymmetricKeyMethod));
528528

529529
jmethodID getClientTypeMethod;
530-
err = chip::JniReferences::GetInstance().FindMethod(env, icdRegistrationInfo, "getClientType", "()Ljava/lang/Short",
530+
err = chip::JniReferences::GetInstance().FindMethod(env, icdRegistrationInfo, "getClientType", "()Ljava/lang/Integer;",
531531
&getClientTypeMethod);
532532
VerifyOrReturnError(err == CHIP_NO_ERROR, err);
533533
jobject jClientType = env->CallObjectMethod(icdRegistrationInfo, getClientTypeMethod);
@@ -566,7 +566,7 @@ CHIP_ERROR AndroidDeviceControllerWrapper::ApplyICDRegistrationInfo(chip::Contro
566566
if (jClientType != nullptr)
567567
{
568568
clientType = static_cast<chip::app::Clusters::IcdManagement::ClientTypeEnum>(
569-
chip::JniReferences::GetInstance().ShortToPrimitive(jClientType));
569+
chip::JniReferences::GetInstance().IntegerToPrimitive(jClientType));
570570
}
571571
params.SetICDClientType(clientType);
572572

src/controller/java/src/chip/devicecontroller/ICDRegistrationInfo.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class ICDRegistrationInfo {
2424
@Nullable private final Long checkInNodeId;
2525
@Nullable private final Long monitoredSubject;
2626
@Nullable private final byte[] symmetricKey;
27-
@Nullable private final Short clientType;
27+
@Nullable private final Integer clientType;
2828

2929
private ICDRegistrationInfo(Builder builder) {
3030
this.checkInNodeId = builder.checkInNodeId;
@@ -48,7 +48,7 @@ public byte[] getSymmetricKey() {
4848
return symmetricKey;
4949
}
5050

51-
public Short getClientType() {
51+
public Integer getClientType() {
5252
return clientType;
5353
}
5454

0 commit comments

Comments
 (0)