Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits committed Feb 4, 2022
1 parent 190c580 commit beb2739
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/controller/java/AndroidCallbacks-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ JNI_METHOD(void, GetConnectedDeviceCallbackJni, deleteCallback)(JNIEnv * env, jo
JNI_METHOD(jlong, ReportCallbackJni, newCallback)
(JNIEnv * env, jobject self, jobject subscriptionEstablishedCallbackJava, jobject reportCallbackJava)
{
ReportCallback * reportCallback = chip::Platform::New<ReportCallback>(self, subscriptionEstablishedCallbackJava, reportCallbackJava);
ReportCallback * reportCallback =
chip::Platform::New<ReportCallback>(self, subscriptionEstablishedCallbackJava, reportCallbackJava);
return reinterpret_cast<jlong>(reportCallback);
}

Expand Down
8 changes: 5 additions & 3 deletions src/controller/java/AndroidCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ void GetConnectedDeviceCallback::OnDeviceConnectionFailureFn(void * context, Pee
env->CallVoidMethod(javaCallback, failureMethod, peerId.GetNodeId(), exception);
}

ReportCallback::ReportCallback(jobject wrapperCallback, jobject subscriptionEstablishedCallback, jobject reportCallback) : mBufferedReadAdapter(*this)
ReportCallback::ReportCallback(jobject wrapperCallback, jobject subscriptionEstablishedCallback, jobject reportCallback) :
mBufferedReadAdapter(*this)
{
JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread();
VerifyOrReturn(env != nullptr, ChipLogError(Controller, "Could not get JNIEnv for current thread"));
Expand Down Expand Up @@ -148,7 +149,7 @@ void ReportCallback::OnReportEnd()
{
// Transform C++ jobject pair list to a Java HashMap, and call onReport() on the Java callback.
CHIP_ERROR err = CHIP_NO_ERROR;
JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread();
JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread();

jobject map;
JniReferences::GetInstance().CreateHashMap(map);
Expand Down Expand Up @@ -227,7 +228,8 @@ void ReportCallback::OnError(CHIP_ERROR aError)
ReportError(nullptr, aError);
}

void ReportCallback::OnDone() {
void ReportCallback::OnDone()
{
JniReferences::GetInstance().GetEnvForCurrentThread()->DeleteGlobalRef(mWrapperCallbackRef);
}

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 @@ -70,7 +70,7 @@ struct ReportCallback : public app::ReadClient::Callback
app::ReadClient * mReadClient = nullptr;

app::BufferedReadCallback mBufferedReadAdapter;
jobject mWrapperCallbackRef = nullptr;
jobject mWrapperCallbackRef = nullptr;
jobject mSubscriptionEstablishedCallbackRef = nullptr;
jobject mReportCallbackRef = nullptr;
// List of pairs of Java ChipAttributePath and report value. Not using map because jobjects should not be keys.
Expand Down

0 comments on commit beb2739

Please sign in to comment.