@@ -219,6 +219,28 @@ void CommissionerDiscoveryController::InternalOk()
219
219
ChipLogError (AppServer, " UX InternalOk: could not find instance=%s" , mCurrentInstance );
220
220
return ;
221
221
}
222
+
223
+ bool isContentAppInstalled = mAppInstallationService ->HasContentApp (client->GetVendorId (), client->GetProductId ());
224
+
225
+ if (!isContentAppInstalled) {
226
+ ChipLogDetail (AppServer, " UX InternalOk: app not installed." );
227
+
228
+ // TODO: send CDC message that user is prompted to install the app
229
+
230
+ // dialog
231
+ ChipLogDetail (Controller,
232
+ " ------PROMPT USER: %s is requesting to install app on this TV. [" ChipLogFormatMEI " ," ChipLogFormatMEI " ]" ,
233
+ client->GetDeviceName (), ChipLogValueMEI (client->GetVendorId ()), ChipLogValueMEI (client->GetProductId ()));
234
+
235
+ if (mUserPrompter != nullptr )
236
+ {
237
+ mUserPrompter ->PromptForAppInstallOKPermission (client->GetVendorId (), client->GetProductId (), client->GetDeviceName ());
238
+ }
239
+ ChipLogDetail (Controller, " ------Via Shell Enter: app add <pid> <vid>" );
240
+ // TODO: force user to send again "cast request <id>" command?
241
+ return ;
242
+ }
243
+
222
244
if (client->GetUDCClientProcessingState () != UDCClientProcessingState::kPromptingUser )
223
245
{
224
246
ChipLogError (AppServer, " UX InternalOk: invalid state for ok" );
@@ -245,25 +267,6 @@ void CommissionerDiscoveryController::InternalOk()
245
267
246
268
uint8_t targetAppCount = client->GetNumTargetAppInfos ();
247
269
248
- bool isContentAppInstalled = mAppInstallationService ->HasContentApp (client->GetVendorId (), client->GetProductId ());
249
-
250
- if (!isContentAppInstalled) {
251
- ChipLogDetail (AppServer, " UX InternalOk: app not installed." );
252
-
253
- // dialog
254
- ChipLogDetail (Controller,
255
- " ------PROMPT USER: %s is requesting to install app on this TV, accept? [" ChipLogFormatMEI " ," ChipLogFormatMEI " ]" ,
256
- client->GetDeviceName (), ChipLogValueMEI (client->GetVendorId ()), ChipLogValueMEI (client->GetProductId ()));
257
-
258
- if (mUserPrompter != nullptr )
259
- {
260
- mUserPrompter ->PromptForAppInstallOKPermission (client->GetVendorId (), client->GetProductId (), client->GetDeviceName ());
261
- }
262
- ChipLogDetail (Controller, " ------Via Shell Enter: controller ux accept|cancel" );
263
- client->SetUDCClientProcessingState (UDCClientProcessingState::kPromptingUser );
264
- return ;
265
- }
266
-
267
270
if (targetAppCount > 0 )
268
271
{
269
272
ChipLogDetail (AppServer, " UX InternalOk: checking for each target app specified" );
0 commit comments