You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tv casting app stop connect when user navigates back before confirming passcode in commission (#37278)
* [Amazon] StopConnect for UDC in Android tv-casting-app
Updated Android & iOS tv-casting-app to send stopConnect command when user
exits UDC before confirming passcode
Changes
1. Added IsPendingPasscodeFromUser() to CastingPlayer. This function
will return true if we are still connecting and pending user action
for passcode
2. ConnectionExampleFragment.java onDestroy() calls stopConnect() if user
has not confirmed passcode
4. MCConnectionExampleView ConnectingView dissapear calls stopConnect()
if user has not confirmed passcode
Test
1. Manually verified UDC attempt is successful both Android iOS for following
1. Attempt UDC attempt (both commissionee & commissioner generated passcode)
2. Navigate back to discovery page
3. Start new UDC attempt (both commissionee & commissioner generated passcode)
2. Manually verified UDC attempt is successful both Android iOS for following. UDC will finish in the background.
1. Attempt UDC attempt (both commissionee & commissioner generated passcode)
2. Confirm passcode on TV app or casting app depending on who
generated passcode
3. Navigate back before commission fnishes.
3. Manual regression test following
* UDC attempt happy path (no navigate back) for both commissinee &
commissioner generated passcode
* [Amazon] StopConnect for UDC in Android tv-casting-app
Updated native layer and iOS tv-casting-app to use native layer
ConnectionState instead of a pendingPasscode customer check.
Changes
* Expose native layer ConnectionState to iOS tv-casting-app
* Update iOS tv-casting-app to use ConnectionState to determine if we
should call stopConnect()
* Only call stopConnect() on navigate back from ConnectionExampleView
* Updated doc to indicate when a object method will free itself as a
side effect
Test
1. Manually verified UDC attempt is successful both Android iOS for following
1. Attempt UDC attempt (both commissionee & commissioner generated passcode)
2. Navigate back to discovery page
3. Start new UDC attempt (both commissionee & commissioner generated passcode)
2. Manually verified UDC attempt is successful both Android iOS for following. UDC will finish in the background.
1. Attempt UDC attempt (both commissionee & commissioner generated passcode)
2. Confirm passcode on TV app or casting app depending on who
generated passcode
3. Navigate back before commission fnishes.
3. Manual regression test following
* UDC attempt happy path (no navigate back) for both commissinee &
commissioner generated passcode
* [Amazon] StopConnect for UDC in Android tv-casting-app
Updated JNI and Android tv-casting-app to use native layer
ConnectionState instead of a pendingPasscode customer check.
Changes
* Expose native layer ConnectionState to Android tv-casting-app
* Update Android tv-casting-app to use ConnectionState to determine if we
should call stopConnect()
* Only call stopConnect() on navigate back from
ConnectionExampleFragmnet
Test
1. Manually verified UDC attempt is successful both Android iOS for following
1. Attempt UDC attempt (both commissionee & commissioner generated passcode)
2. Navigate back to discovery page
3. Start new UDC attempt (both commissionee & commissioner generated passcode)
2. Manually verified UDC attempt is successful both Android iOS for following. UDC will finish in the background.
1. Attempt UDC attempt (both commissionee & commissioner generated passcode)
2. Confirm passcode on TV app or casting app depending on who
generated passcode
3. Navigate back before commission fnishes.
3. Manual regression test following
* UDC attempt happy path (no navigate back) for both commissinee &
commissioner generated passcode
* [Amazon] StopConnect for UDC in Android tv-casting-app
Applied restyle formatting
* [Amazon] StopConnect for UDC in Android tv-casting-app
Fix restyle CI error
* [Amazon] StopConnect for UDC in Android tv-casting-app
Updated JNI and Android tv-casting-app to use CharToStringUTF
util function to create jstring and handle NULL JNIEnv interface
Changes
* JNI to use CharToStringUTF util function to create jstring
* Updated documentation for new JNI functions
Test
1. Manually verified UDC attempt is successful both Android iOS for following
1. Attempt UDC attempt (both commissionee & commissioner generated passcode)
2. Navigate back to discovery page
3. Start new UDC attempt (both commissionee & commissioner generated passcode)
2. Manually verified UDC attempt is successful both Android iOS for following. UDC will finish in the background.
1. Attempt UDC attempt (both commissionee & commissioner generated passcode)
2. Confirm passcode on TV app or casting app depending on who
generated passcode
3. Navigate back before commission fnishes.
3. Manual regression test following
* UDC attempt happy path (no navigate back) for both commissinee &
commissioner generated passcode
* [Amazon] StopConnect for UDC in Android tv-casting-app
Updated JNI and Android tv-casting-app to use CharToStringUTF
util function to create jstring and handle NULL JNIEnv interface
Changes
* JNI to use CharToStringUTF util function to create jstring for all
ConnectionState and not just errors
Test
1. Manually verified UDC attempt is successful both Android iOS for following
1. Attempt UDC attempt (both commissionee & commissioner generated passcode)
2. Navigate back to discovery page
3. Start new UDC attempt (both commissionee & commissioner generated passcode)
2. Manually verified UDC attempt is successful both Android iOS for following. UDC will finish in the background.
1. Attempt UDC attempt (both commissionee & commissioner generated passcode)
2. Confirm passcode on TV app or casting app depending on who
generated passcode
3. Navigate back before commission fnishes.
3. Manual regression test following
* UDC attempt happy path (no navigate back) for both commissinee &
commissioner generated passcode
@@ -108,17 +131,9 @@ class MCConnectionExampleViewModel: ObservableObject {
108
131
dataSource.update(newCommissionableData)
109
132
self.Log.info("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, Updated MCAppParametersDataSource instance with new MCCommissionableData.")
self.connectionStatus ="Failed to update the MCAppParametersDataSource with the user entered passcode: \n\nRoute back to disconnect and try again."
113
136
self.connectionSuccess =false
114
-
// Since we failed to update the passcode, Attempt to cancel the connection attempt with
115
-
// the CastingPlayer/Commissioner.
116
-
leterr= selectedCastingPlayer?.stopConnecting()
117
-
if err ==nil{
118
-
self.Log.info("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, InitializationExample.getAppParametersDataSource() failed, then stopConnecting() succeeded")
119
-
}else{
120
-
self.Log.error("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, InitializationExample.getAppParametersDataSource() failed, then stopConnecting() failed due to: \(err)")
121
-
}
122
137
return
123
138
}
124
139
@@ -127,28 +142,13 @@ class MCConnectionExampleViewModel: ObservableObject {
127
142
if errContinue ==nil{
128
143
self.connectionStatus ="Continuing to connect with user entered passcode: \(userEnteredPasscode)"
129
144
}else{
130
-
self.connectionStatus ="Continue Connecting to Casting Player failed with: \(String(describing: errContinue))\n\nRoute back and try again."
145
+
self.connectionStatus ="Continue Connecting to Casting Player failed with: \(String(describing: errContinue))\n\nRoute back to disconnect and try again."
131
146
self.Log.error("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, MCCastingPlayer.continueConnecting() failed due to: \(errContinue)")
132
-
// Since continueConnecting() failed, Attempt to cancel the connection attempt with
133
-
// the CastingPlayer/Commissioner.
134
-
leterr= selectedCastingPlayer?.stopConnecting()
135
-
if err ==nil{
136
-
self.Log.info("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, MCCastingPlayer.continueConnecting() failed, then stopConnecting() succeeded")
137
-
}else{
138
-
self.Log.error("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, MCCastingPlayer.continueConnecting() failed, then stopConnecting() failed due to: \(err)")
139
-
}
140
147
}
141
148
}, cancelConnecting:{
142
-
self.Log.info("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, Connection attempt cancelled by the user, calling MCCastingPlayer.stopConnecting()")
143
-
leterr= selectedCastingPlayer?.stopConnecting()
149
+
self.Log.info("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, Connection attempt cancelled by the user")
144
150
self.connectionSuccess =false
145
-
if err ==nil{
146
-
self.connectionStatus ="User cancelled the connection attempt with CastingPlayer. \n\nRoute back to exit."
147
-
self.Log.info("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, User cancelled the connection attempt with MCCastingPlayer, MCCastingPlayer.stopConnecting() succeeded.")
148
-
}else{
149
-
self.connectionStatus ="Cancel connection failed due to: \(String(describing: err))\n\nRoute back to exit."
150
-
self.Log.error("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, MCCastingPlayer.stopConnecting() failed due to: \(err)")
151
-
}
151
+
self.connectionStatus ="User cancelled the connection attempt with CastingPlayer. \n\nRoute back to disconnect & exit."
0 commit comments