-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android - implement ChipDnssdStopBrowse #32801
Android - implement ChipDnssdStopBrowse #32801
Conversation
PR #32801: Size comparison from f1abb59 to 3dbf667 Full report (5 builds for cc32xx, linux, mbed)
|
PR #32801: Size comparison from f1abb59 to 557a1ea Increases (50 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, esp32, linux, nrfconnect, qpg, telink)
Decreases (3 builds for efr32, linux)
Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
|
The things that made me ask for changes were addressed; the remaining broken bits are Android-specific.
PR #32801: Size comparison from f1abb59 to ba9073d Increases above 0.2%:
Increases (9 builds for cc32xx, mbed, nrfconnect, qpg, stm32)
Decreases (8 builds for cc32xx, mbed, nrfconnect, qpg, stm32)
Full report (9 builds for cc32xx, mbed, nrfconnect, qpg, stm32)
|
Fixing style issues cleanup log statement
ba9073d
to
77a0459
Compare
PR #32801: Size comparison from 0c0c6d6 to 77a0459 Decreases (2 builds for efr32)
Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink)
|
src/platform/android/java/chip/platform/NsdManagerServiceBrowser.java
Outdated
Show resolved
Hide resolved
PR #32801: Size comparison from 0c0c6d6 to 0c034a2 Increases above 0.2%:
Increases (5 builds for cc13x4_26x4)
Decreases (2 builds for efr32)
Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink)
|
return CHIP_ERROR_NOT_IMPLEMENTED; | ||
VerifyOrReturnError(sBrowserObject.HasValidObjectRef() && sStopBrowseMethod != nullptr, CHIP_ERROR_INVALID_ARGUMENT); | ||
|
||
JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check whether env is null or not and print error.
return CHIP_JNI_ERROR_EXCEPTION_THROWN; | ||
} | ||
chip::Platform::Delete(ctx); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually we set ctx as null for style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding ctx = nullptr;
@@ -81,23 +89,30 @@ public void startDiscover( | |||
final long contextHandle, | |||
final ChipMdnsCallback chipMdnsCallback) { | |||
if (callbackMap.containsKey(callbackHandle)) { | |||
Log.d(TAG, "Invalid callbackHandle"); | |||
Log.w(TAG, "Starting service discovery failed. Invalid callbackHandle: " + callbackHandle); | |||
return; | |||
} | |||
|
|||
NsdManagerDiscovery discovery = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please also check whether this new is allocating memory successfully?
examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.cpp
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please address the comments in follow-up, thanks
This reverts commit 2ca30ac.
This change adds the implementation for ChipDnssdStopBrowse in connectedhomeip/src/platform/android/DnssdImpl.cpp allowing DNS-SD discovery to be manally stopped before the timeout.
Change summary
Testing
Verified and tested locally with the Android tv-casting-app example app. By calling the stop discovery API form the tv-casting-app app GUI, we are able to stop NsdManagerDiscovery discovery, prior to timeout triggered stop discovery.