Skip to content

Commit

Permalink
Fix icd clienttype with integer and missing semicolon in the end of (…
Browse files Browse the repository at this point in the history
…)Ljava/lang/Short
  • Loading branch information
yunhanw-google committed Jun 28, 2024
1 parent 36b2d8d commit 8976cb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/controller/java/AndroidDeviceControllerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ CHIP_ERROR AndroidDeviceControllerWrapper::ApplyICDRegistrationInfo(chip::Contro
jbyteArray jSymmetricKey = static_cast<jbyteArray>(env->CallObjectMethod(icdRegistrationInfo, getSymmetricKeyMethod));

jmethodID getClientTypeMethod;
err = chip::JniReferences::GetInstance().FindMethod(env, icdRegistrationInfo, "getClientType", "()Ljava/lang/Short",
err = chip::JniReferences::GetInstance().FindMethod(env, icdRegistrationInfo, "getClientType", "()Ljava/lang/Integer;",
&getClientTypeMethod);
VerifyOrReturnError(err == CHIP_NO_ERROR, err);
jobject jClientType = env->CallObjectMethod(icdRegistrationInfo, getClientTypeMethod);
Expand Down Expand Up @@ -566,7 +566,7 @@ CHIP_ERROR AndroidDeviceControllerWrapper::ApplyICDRegistrationInfo(chip::Contro
if (jClientType != nullptr)
{
clientType = static_cast<chip::app::Clusters::IcdManagement::ClientTypeEnum>(
chip::JniReferences::GetInstance().ShortToPrimitive(jClientType));
chip::JniReferences::GetInstance().IntegerToPrimitive(jClientType));
}
params.SetICDClientType(clientType);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class ICDRegistrationInfo {
@Nullable private final Long checkInNodeId;
@Nullable private final Long monitoredSubject;
@Nullable private final byte[] symmetricKey;
@Nullable private final Short clientType;
@Nullable private final Integer clientType;

private ICDRegistrationInfo(Builder builder) {
this.checkInNodeId = builder.checkInNodeId;
Expand All @@ -48,7 +48,7 @@ public byte[] getSymmetricKey() {
return symmetricKey;
}

public Short getClientType() {
public Integer getClientType() {
return clientType;
}

Expand Down

0 comments on commit 8976cb2

Please sign in to comment.