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
[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
self.Log.error("MCConnectionExampleViewModel cancelConnect() MCCastingPlayer.getConnectionState() failed due to: \(err)")
52
+
}
53
+
54
+
if connectionState == MC_CASTING_PLAYER_CONNECTING {
49
55
self.Log.info("MCConnectionExampleViewModel cancelConnect(). User navigating back from ConnectionView")
50
56
leterr= selectedCastingPlayer?.stopConnecting()
51
57
if err ==nil{
@@ -125,17 +131,9 @@ class MCConnectionExampleViewModel: ObservableObject {
125
131
dataSource.update(newCommissionableData)
126
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."
130
136
self.connectionSuccess =false
131
-
// Since we failed to update the passcode, Attempt to cancel the connection attempt with
132
-
// the CastingPlayer/Commissioner.
133
-
leterr= selectedCastingPlayer?.stopConnecting()
134
-
if err ==nil{
135
-
self.Log.info("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, InitializationExample.getAppParametersDataSource() failed, then stopConnecting() succeeded")
136
-
}else{
137
-
self.Log.error("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, InitializationExample.getAppParametersDataSource() failed, then stopConnecting() failed due to: \(err)")
138
-
}
139
137
return
140
138
}
141
139
@@ -144,28 +142,13 @@ class MCConnectionExampleViewModel: ObservableObject {
144
142
if errContinue ==nil{
145
143
self.connectionStatus ="Continuing to connect with user entered passcode: \(userEnteredPasscode)"
146
144
}else{
147
-
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."
148
146
self.Log.error("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, MCCastingPlayer.continueConnecting() failed due to: \(errContinue)")
149
-
// Since continueConnecting() failed, Attempt to cancel the connection attempt with
150
-
// the CastingPlayer/Commissioner.
151
-
leterr= selectedCastingPlayer?.stopConnecting()
152
-
if err ==nil{
153
-
self.Log.info("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, MCCastingPlayer.continueConnecting() failed, then stopConnecting() succeeded")
154
-
}else{
155
-
self.Log.error("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, MCCastingPlayer.continueConnecting() failed, then stopConnecting() failed due to: \(err)")
156
-
}
157
147
}
158
148
}, cancelConnecting:{
159
-
self.Log.info("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, Connection attempt cancelled by the user, calling MCCastingPlayer.stopConnecting()")
160
-
leterr= selectedCastingPlayer?.stopConnecting()
149
+
self.Log.info("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, Connection attempt cancelled by the user")
161
150
self.connectionSuccess =false
162
-
if err ==nil{
163
-
self.connectionStatus ="User cancelled the connection attempt with CastingPlayer. \n\nRoute back to exit."
164
-
self.Log.info("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, User cancelled the connection attempt with MCCastingPlayer, MCCastingPlayer.stopConnecting() succeeded.")
165
-
}else{
166
-
self.connectionStatus ="Cancel connection failed due to: \(String(describing: err))\n\nRoute back to exit."
167
-
self.Log.error("MCConnectionExampleViewModel connect() commissionerDeclarationCallback, MCCastingPlayer.stopConnecting() failed due to: \(err)")
168
-
}
151
+
self.connectionStatus ="User cancelled the connection attempt with CastingPlayer. \n\nRoute back to disconnect & exit."
0 commit comments