Skip to content

Commit

Permalink
More build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjerryjohns committed Jul 26, 2022
1 parent 56414ef commit d5ef73f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/app/InteractionModelEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,14 @@ void InteractionModelEngine::Shutdown()
mpExchangeMgr->UnregisterUnsolicitedMessageHandlerForProtocol(Protocols::InteractionModel::Id);

mpCASESessionMgr = nullptr;
mpFabricTable = nullptr;
mpExchangeMgr = nullptr;

//
// We _should_ be clearing these out, but doing so invites a world
// of trouble. #21233 tracks fixing the underlying assumptions to make
// this possible.
//
// mpFabricTable = nullptr;
// mpExchangeMgr = nullptr;
}

uint32_t InteractionModelEngine::GetNumActiveReadHandlers() const
Expand Down
11 changes: 9 additions & 2 deletions src/controller/java/AndroidCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,22 +547,29 @@ void ReportEventCallback::OnSubscriptionEstablished(SubscriptionId aSubscription
JniReferences::GetInstance().CallSubscriptionEstablished(mSubscriptionEstablishedCallbackRef);
}

void ReportEventCallback::OnResubscriptionAttempt(CHIP_ERROR aTerminationCause, uint32_t aNextResubscribeIntervalMsec)
void ReportEventCallback::OnResubscriptionAttempt(app::ReadClient * apReadClient, CHIP_ERROR aTerminationCause)
{
VerifyOrReturn(mResubscriptionAttemptCallbackRef != nullptr,
ChipLogError(Controller, "mResubscriptionAttemptCallbackRef is null"));

CHIP_ERROR err = CHIP_NO_ERROR;
JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread();

err = app::ReadClient::Callback::OnResubscriptionNeeded(apReadClient, aTerminationCause);
if (err != CHIP_NO_ERROR)
{
ReportError(nullptr, ErrorStr(err), err.AsInteger());
return;
}

jmethodID onResubscriptionAttemptMethod;
err = JniReferences::GetInstance().FindMethod(env, mResubscriptionAttemptCallbackRef, "onResubscriptionAttempt", "(II)V",
&onResubscriptionAttemptMethod);
VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Controller, "Could not find onResubscriptionAttempt method"));

DeviceLayer::StackUnlock unlock;
env->CallVoidMethod(mResubscriptionAttemptCallbackRef, onResubscriptionAttemptMethod, aTerminationCause.AsInteger(),
aNextResubscribeIntervalMsec);
apReadClient->ComputeTimeTillNextSubscription());
}

void ReportEventCallback::ReportError(jobject attributePath, CHIP_ERROR err)
Expand Down
2 changes: 1 addition & 1 deletion src/controller/java/AndroidCallbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct ReportEventCallback : public app::ReadClient::Callback

void OnSubscriptionEstablished(SubscriptionId aSubscriptionId) override;

void OnResubscriptionAttempt(CHIP_ERROR aTerminationCause, uint32_t aNextResubscribeIntervalMsec) override;
void OnResubscriptionAttempt(app::ReadClient * apReadClient, CHIP_ERROR aTerminationCause) override;

/** Report errors back to Java layer. attributePath may be nullptr for general errors. */
void ReportError(jobject eventPath, CHIP_ERROR err);
Expand Down

0 comments on commit d5ef73f

Please sign in to comment.