-
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
Tv casting app stop connect when user navigates back before confirming passcode in commission #37278
base: master
Are you sure you want to change the base?
Conversation
Changed Files |
Updated Android & iOS tv-casting-app to send stopConnect command when user exits UDC before confirming passcode Changes 1. ConnectionExampleFragment.java track if user confirmed passcode or not 2. ConnectionExampleFragment.java onDestroy() send stopConnect() if user has not confirmed passcode 3. MCConnectionExampleViewModel track if user confirmed passcode or not 4. MCConnectionExampleView trigger stopConnect when Connecting view dissapear Test 1. Manually verfied stopConnect works for normal UDC and commissioner generated passcode UDC 2. Manually verified alternating attempt of normal UDC and commissioner generated passcode UDC works 3. Manually verified stopConnect is not called in other states other than pending passcode confirmation
039b564
to
479a03b
Compare
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.
VerifyOrReturnValue( | ||
mIdOptions.mCommissionerPasscode, CHIP_ERROR_INCORRECT_STATE, | ||
ChipLogError(AppServer, | ||
"CastingPlayer::StopConnecting() mIdOptions.mCommissionerPasscode == false, ContinueConnecting() should only " | ||
"be called when the CastingPlayer/Commissioner-Generated passcode commissioning flow is in progress.");); |
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.
@pgregorr-amazon - Correct me if I am wrong, but I remember you added this check to guard against some error. Is it safe to remove this?
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.
@sharadb-amazon – This check wasn’t guarding against a specific error but was added as a defensive measure to restrict CastingPlayer::StopConnecting()
API to the CommissioneR-Generated passcode flow. The CommissioneE-Generated passcode flow wasn’t tested at the time, and there was no use case for it. Before removing this check, we should verify that the API functions correctly with the CommissioneE-Generated passcode flow.
cc @yuenton-amazon
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.
@yuenton-amazon can you please verify the above?
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.
Talked to Philip. He mentioned he checks that the tv-app's log to check if its received the udc cancel message. I've already verified that in commissionee generated passcode, stop connect results in tv-app receiving the message and removes the udc session with controller udc-print
CLI command
enum ConnectionState { | ||
PENDING_PASSCODE_CONFIRMATION, | ||
CONNECTING, | ||
CONNECTED, | ||
FAILED, | ||
CANCELLED, | ||
} |
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.
Should this be added in the APIs themselves? Like for Android, here: https://github.com/project-chip/connectedhomeip/blob/master/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingPlayer.java
Note that we have a similar C++ enum in the tv-casting-common layer: https://github.com/project-chip/connectedhomeip/blob/master/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h#L81-L86
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.
The important state to trigger stopConnecting()
is actually only PENDING_PASSCODE_CONFIRMATION
. Since after after continueConnect()
is called in CONNECTING
state, stopConnecting()
cannot be called.
The condition to call stopConnecting() is PENDING_PASSCODE_CONFIRMATION
. I can covert this to a bool to simplify the solution, like the approach taken on iOS side.
Updated Android tv-casting-app to send stopConnect command when user
exits UDC before confirming passcode
Changes
not
has not confirmed passcode
dissappear
Test
passcode UDC for both iOS and Android tv-casting-app
passcode UDC works both iOS and Android tv-casting-app
pending passcode confirmation both iOS and Android tv-casting-app