From 69623e2bbfecb84608e9bf5049fad184f690db26 Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Mon, 17 Jun 2024 23:39:28 +0200 Subject: [PATCH 1/7] Update App Install Flow Error & Attribute Retrieval Status --- .../tv-app/android/java/AppPlatform-JNI.cpp | 2 +- examples/tv-app/android/java/TVApp-JNI.cpp | 11 ++++ examples/tv-app/tv-common/include/AppTv.h | 2 + examples/tv-app/tv-common/src/AppTv.cpp | 65 ++++++++++++------- .../CommissionerDiscoveryController.cpp | 16 +---- .../CommissionerDiscoveryController.h | 17 ----- 6 files changed, 58 insertions(+), 55 deletions(-) diff --git a/examples/tv-app/android/java/AppPlatform-JNI.cpp b/examples/tv-app/android/java/AppPlatform-JNI.cpp index 2daebbdd890b6a..52905cf0ba130b 100644 --- a/examples/tv-app/android/java/AppPlatform-JNI.cpp +++ b/examples/tv-app/android/java/AppPlatform-JNI.cpp @@ -128,7 +128,7 @@ std::vector convert_to_cpp(JNIEnv * env, jobject s // Find Java classes. WARNING: Reflection jclass collectionClass = env->FindClass("java/util/Collection"); jclass iteratorClass = env->FindClass("java/util/Iterator"); - jclass clusterClass = env->FindClass("com/matter/tv/server/tvapp/SupportedCluster"); + jclass clusterClass = env->FindClass("com/matter/tv/server/tvapp/ContentAppSupportedCluster"); if (collectionClass == nullptr || iteratorClass == nullptr || clusterClass == nullptr) { return {}; diff --git a/examples/tv-app/android/java/TVApp-JNI.cpp b/examples/tv-app/android/java/TVApp-JNI.cpp index f154b0759c2b1a..a15f99f8fb7f87 100644 --- a/examples/tv-app/android/java/TVApp-JNI.cpp +++ b/examples/tv-app/android/java/TVApp-JNI.cpp @@ -240,6 +240,16 @@ class MyPincodeService : public PasscodeService }; MyPincodeService gMyPincodeService; +class MyAppInstallationService : public AppInstallationService +{ + bool LookupTargetContentApp(uint16_t vendorId, uint16_t productId) override + { + return ContentAppPlatform::GetInstance().LoadContentAppByClient(vendorId, productId) != nullptr; + } +}; + +MyAppInstallationService gMyAppInstallationService; + class MyPostCommissioningListener : public PostCommissioningListener { void CommissioningCompleted(uint16_t vendorId, uint16_t productId, NodeId nodeId, Messaging::ExchangeManager & exchangeMgr, @@ -372,6 +382,7 @@ void TvAppJNI::InitializeCommissioner(JNIMyUserPrompter * userPrompter) if (cdc != nullptr && userPrompter != nullptr) { cdc->SetPasscodeService(&gMyPincodeService); + cdc->SetAppInstallationService(&gMyAppInstallationService); cdc->SetUserPrompter(userPrompter); cdc->SetPostCommissioningListener(&gMyPostCommissioningListener); } diff --git a/examples/tv-app/tv-common/include/AppTv.h b/examples/tv-app/tv-common/include/AppTv.h index 8ddd793c611f70..799087e7be56b4 100644 --- a/examples/tv-app/tv-common/include/AppTv.h +++ b/examples/tv-app/tv-common/include/AppTv.h @@ -149,6 +149,8 @@ class DLL_EXPORT ContentAppFactoryImpl : public ContentAppFactory void InstallContentApp(uint16_t vendorId, uint16_t productId); // Remove the app from the list of mContentApps bool UninstallContentApp(uint16_t vendorId, uint16_t productId); + // Print mContentApps and endpoints + void PrintInstalledApps(); protected: std::vector> mContentApps; diff --git a/examples/tv-app/tv-common/src/AppTv.cpp b/examples/tv-app/tv-common/src/AppTv.cpp index bcdeac1a52b39f..22a154d21a154b 100644 --- a/examples/tv-app/tv-common/src/AppTv.cpp +++ b/examples/tv-app/tv-common/src/AppTv.cpp @@ -98,12 +98,6 @@ class MyUserPrompter : public UserPrompter // tv should override this with a dialog prompt inline void PromptCommissioningFailed(const char * commissioneeName, CHIP_ERROR error) override { return; } - - // tv should override this with a dialog prompt - inline void PromptForAppInstallOKPermission(uint16_t vendorId, uint16_t productId, const char * commissioneeName) override - { - return; - } }; MyUserPrompter gMyUserPrompter; @@ -583,28 +577,33 @@ void ContentAppFactoryImpl::InstallContentApp(uint16_t vendorId, uint16_t produc ChipLogProgress(DeviceLayer, "ContentAppFactoryImpl: InstallContentApp vendorId=%d productId=%d ", vendorId, productId); if (vendorId == 1 && productId == 11) { - mContentApps.emplace_back(std::make_unique("Vendor1", vendorId, "exampleid", productId, "Version1", - "34567890", make_default_supported_clusters())); + auto ptr = std::make_unique("Vendor1", vendorId, "exampleid", productId, "Version1", + "34567890", make_default_supported_clusters()); + mContentApps.emplace_back(std::move(ptr)); } - else if (vendorId == 65521 && productId == 32768) + else if (vendorId == 65521 && productId == 32769) { - mContentApps.emplace_back(std::make_unique("Vendor2", vendorId, "exampleString", productId, "Version2", - "20202021", make_default_supported_clusters())); + auto ptr = std::make_unique("Vendor2", vendorId, "exampleString", productId, "Version2", + "20202021", make_default_supported_clusters()); + mContentApps.emplace_back(std::move(ptr)); } else if (vendorId == 9050 && productId == 22) - { - mContentApps.emplace_back(std::make_unique("Vendor3", vendorId, "App3", productId, "Version3", "20202021", - make_default_supported_clusters())); + { + auto ptr = std::make_unique("Vendor3", vendorId, "App3", productId, "Version3", "20202021", + make_default_supported_clusters()); + mContentApps.emplace_back(std::move(ptr)); } else if (vendorId == 1111 && productId == 22) { - mContentApps.emplace_back(std::make_unique("TestSuiteVendor", vendorId, "applicationId", productId, "v2", - "20202021", make_default_supported_clusters())); + auto ptr = std::make_unique("TestSuiteVendor", vendorId, "applicationId", productId, "v2", + "20202021", make_default_supported_clusters()); + mContentApps.emplace_back(std::move(ptr)); } else { - mContentApps.emplace_back(std::make_unique("NewAppVendor", vendorId, "newAppApplicationId", productId, "v2", - "20202021", make_default_supported_clusters())); + auto ptr = std::make_unique("NewAppVendor", vendorId, "newAppApplicationId", productId, "v2", + "20202021", make_default_supported_clusters()); + mContentApps.emplace_back(std::move(ptr)); } } @@ -627,6 +626,7 @@ bool ContentAppFactoryImpl::UninstallContentApp(uint16_t vendorId, uint16_t prod app->GetApplicationBasicDelegate()->HandleGetVendorId(), app->GetApplicationBasicDelegate()->HandleGetProductId()); mContentApps.erase(mContentApps.begin() + index); + // TODO: call ContentAppPlatform->RemoveContentApp(ids...) return true; } @@ -635,6 +635,17 @@ bool ContentAppFactoryImpl::UninstallContentApp(uint16_t vendorId, uint16_t prod return false; } +void ContentAppFactoryImpl::PrintInstalledApps() +{ + for (auto & contentApp : mContentApps) + { + auto app = contentApp.get(); + + ChipLogProgress(DeviceLayer, "Content app vid=%d pid=%d is on ep=%d", app->GetApplicationBasicDelegate()->HandleGetVendorId(), + app->GetApplicationBasicDelegate()->HandleGetProductId(), app->GetEndpointId()); + } +} + Access::Privilege ContentAppFactoryImpl::GetVendorPrivilege(uint16_t vendorId) { for (size_t i = 0; i < mAdminVendorIds.size(); ++i) @@ -689,12 +700,22 @@ std::list ContentAppFactoryImpl::GetAllowedClusterListForStaticEndpoi CHIP_ERROR AppTvInit() { #if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED + // test data for apps + constexpr uint16_t kApp1VendorId = 1; + constexpr uint16_t kApp1ProductId = 11; + constexpr uint16_t kApp2VendorId = 65521; + constexpr uint16_t kApp2ProductId = 32769; + constexpr uint16_t kApp3VendorId = 9050; + constexpr uint16_t kApp3ProductId = 22; + constexpr uint16_t kApp4VendorId = 1111; + constexpr uint16_t kApp4ProductId = 22; + ContentAppPlatform::GetInstance().SetupAppPlatform(); ContentAppPlatform::GetInstance().SetContentAppFactory(&gFactory); - gFactory.InstallContentApp((uint16_t) 1, (uint16_t) 11); - gFactory.InstallContentApp((uint16_t) 65521, (uint16_t) 32768); - gFactory.InstallContentApp((uint16_t) 9050, (uint16_t) 22); - gFactory.InstallContentApp((uint16_t) 1111, (uint16_t) 22); + gFactory.InstallContentApp(kApp1VendorId, kApp1ProductId); + gFactory.InstallContentApp(kApp2VendorId, kApp2ProductId); + gFactory.InstallContentApp(kApp3VendorId, kApp3ProductId); + gFactory.InstallContentApp(kApp4VendorId, kApp4ProductId); uint16_t value; if (DeviceLayer::GetDeviceInstanceInfoProvider()->GetVendorId(value) != CHIP_NO_ERROR) { diff --git a/src/controller/CommissionerDiscoveryController.cpp b/src/controller/CommissionerDiscoveryController.cpp index d1a5747491ad50..7d5fde3a7ca93a 100644 --- a/src/controller/CommissionerDiscoveryController.cpp +++ b/src/controller/CommissionerDiscoveryController.cpp @@ -230,21 +230,7 @@ void CommissionerDiscoveryController::InternalOk() { ChipLogDetail(AppServer, "UX InternalOk: app not installed."); - // notify client that app will be installed - CommissionerDeclaration cd; - cd.SetErrorCode(CommissionerDeclaration::CdError::kAppInstallConsentPending); - mUdcServer->SendCDCMessage(cd, Transport::PeerAddress::UDP(client->GetPeerAddress().GetIPAddress(), client->GetCdPort())); - - // dialog - ChipLogDetail(Controller, "------PROMPT USER: %s is requesting to install app on this TV. vendorId=%d, productId=%d", - client->GetDeviceName(), client->GetVendorId(), client->GetProductId()); - - if (mUserPrompter != nullptr) - { - mUserPrompter->PromptForAppInstallOKPermission(client->GetVendorId(), client->GetProductId(), client->GetDeviceName()); - } - ChipLogDetail(Controller, "------Via Shell Enter: app install "); - return; + // TODO: Prepare app to be installed or add it to the mContentApps } if (client->GetUDCClientProcessingState() != UDCClientProcessingState::kPromptingUser) diff --git a/src/controller/CommissionerDiscoveryController.h b/src/controller/CommissionerDiscoveryController.h index b2211641fd0ede..5f7572b29def17 100644 --- a/src/controller/CommissionerDiscoveryController.h +++ b/src/controller/CommissionerDiscoveryController.h @@ -150,21 +150,6 @@ class DLL_EXPORT UserPrompter */ virtual void PromptCommissioningFailed(const char * commissioneeName, CHIP_ERROR error) = 0; - /** - * @brief - * Called to prompt the user for consent to allow the app commissioneeName/vendorId/productId to be installed. - * For example "[commissioneeName] is requesting permission to install app to this TV, approve?" - * - * If user responds with OK then implementor should call CommissionerRespondOk(); - * If user responds with Cancel then implementor should call CommissionerRespondCancel(); - * - * @param[in] vendorId The vendorId in the DNS-SD advertisement of the requesting commissionee. - * @param[in] productId The productId in the DNS-SD advertisement of the requesting commissionee. - * @param[in] commissioneeName The commissioneeName in the DNS-SD advertisement of the requesting commissionee. - * - */ - virtual void PromptForAppInstallOKPermission(uint16_t vendorId, uint16_t productId, const char * commissioneeName) = 0; - virtual ~UserPrompter() = default; }; @@ -227,8 +212,6 @@ class DLL_EXPORT AppInstallationService * Called to check if the given target app is available to the commissione with th given * vendorId/productId * - * This will be called by the main chip thread so any blocking work should be moved to a separate thread. - * * @param[in] vendorId The vendorId in the DNS-SD advertisement of the requesting commissionee. * @param[in] productId The productId in the DNS-SD advertisement of the requesting commissionee. * From 32b4941b118cb2d62d74a966a576edc8ff6d325f Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Tue, 18 Jun 2024 11:01:22 +0200 Subject: [PATCH 2/7] Update code break --- examples/tv-app/android/java/MyUserPrompter-JNI.cpp | 9 --------- examples/tv-app/android/java/MyUserPrompter-JNI.h | 1 - 2 files changed, 10 deletions(-) diff --git a/examples/tv-app/android/java/MyUserPrompter-JNI.cpp b/examples/tv-app/android/java/MyUserPrompter-JNI.cpp index 4eb0abe25645da..6d586d99c1c67f 100644 --- a/examples/tv-app/android/java/MyUserPrompter-JNI.cpp +++ b/examples/tv-app/android/java/MyUserPrompter-JNI.cpp @@ -227,15 +227,6 @@ bool JNIMyUserPrompter::DisplaysPasscodeAndQRCode() return false; } -/** - * Called to prompt the user for consent to allow the app commissioneeName/vendorId/productId to be installed. - * For example "[commissioneeName] is requesting permission to install app to this TV, approve?" - */ -void JNIMyUserPrompter::PromptForAppInstallOKPermission(uint16_t vendorId, uint16_t productId, const char * commissioneeName) -{ - ChipLogError(Zcl, "JNIMyUserPrompter::PromptForAppInstallOKPermission Needs Implementation"); -} - /** * Called to display the given setup passcode to the user, * for commissioning the given commissioneeName with the given vendorId and productId, diff --git a/examples/tv-app/android/java/MyUserPrompter-JNI.h b/examples/tv-app/android/java/MyUserPrompter-JNI.h index 3d2e7f14afb75e..408346326a6fd6 100644 --- a/examples/tv-app/android/java/MyUserPrompter-JNI.h +++ b/examples/tv-app/android/java/MyUserPrompter-JNI.h @@ -29,7 +29,6 @@ class JNIMyUserPrompter : public UserPrompter void PromptForCommissionOKPermission(uint16_t vendorId, uint16_t productId, const char * commissioneeName) override; void PromptForCommissionPasscode(uint16_t vendorId, uint16_t productId, const char * commissioneeName, uint16_t pairingHint, const char * pairingInstruction) override; - void PromptForAppInstallOKPermission(uint16_t vendorId, uint16_t productId, const char * commissioneeName) override; void HidePromptsOnCancel(uint16_t vendorId, uint16_t productId, const char * commissioneeName) override; bool DisplaysPasscodeAndQRCode() override; void PromptWithCommissionerPasscode(uint16_t vendorId, uint16_t productId, const char * commissioneeName, uint32_t passcode, From 4e0302aa8330cf174f694c864ba95bc09861797a Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Tue, 18 Jun 2024 09:01:56 +0000 Subject: [PATCH 3/7] Restyled by whitespace --- examples/tv-app/tv-common/src/AppTv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tv-app/tv-common/src/AppTv.cpp b/examples/tv-app/tv-common/src/AppTv.cpp index 22a154d21a154b..de2370f734228f 100644 --- a/examples/tv-app/tv-common/src/AppTv.cpp +++ b/examples/tv-app/tv-common/src/AppTv.cpp @@ -588,7 +588,7 @@ void ContentAppFactoryImpl::InstallContentApp(uint16_t vendorId, uint16_t produc mContentApps.emplace_back(std::move(ptr)); } else if (vendorId == 9050 && productId == 22) - { + { auto ptr = std::make_unique("Vendor3", vendorId, "App3", productId, "Version3", "20202021", make_default_supported_clusters()); mContentApps.emplace_back(std::move(ptr)); From 2e6e42a169ed57aa39adfc349e19f1916ae1dda2 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Tue, 18 Jun 2024 09:01:58 +0000 Subject: [PATCH 4/7] Restyled by clang-format --- examples/tv-app/tv-common/src/AppTv.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/examples/tv-app/tv-common/src/AppTv.cpp b/examples/tv-app/tv-common/src/AppTv.cpp index de2370f734228f..d712c4103fb121 100644 --- a/examples/tv-app/tv-common/src/AppTv.cpp +++ b/examples/tv-app/tv-common/src/AppTv.cpp @@ -577,32 +577,32 @@ void ContentAppFactoryImpl::InstallContentApp(uint16_t vendorId, uint16_t produc ChipLogProgress(DeviceLayer, "ContentAppFactoryImpl: InstallContentApp vendorId=%d productId=%d ", vendorId, productId); if (vendorId == 1 && productId == 11) { - auto ptr = std::make_unique("Vendor1", vendorId, "exampleid", productId, "Version1", - "34567890", make_default_supported_clusters()); + auto ptr = std::make_unique("Vendor1", vendorId, "exampleid", productId, "Version1", "34567890", + make_default_supported_clusters()); mContentApps.emplace_back(std::move(ptr)); } else if (vendorId == 65521 && productId == 32769) { - auto ptr = std::make_unique("Vendor2", vendorId, "exampleString", productId, "Version2", - "20202021", make_default_supported_clusters()); + auto ptr = std::make_unique("Vendor2", vendorId, "exampleString", productId, "Version2", "20202021", + make_default_supported_clusters()); mContentApps.emplace_back(std::move(ptr)); } else if (vendorId == 9050 && productId == 22) { auto ptr = std::make_unique("Vendor3", vendorId, "App3", productId, "Version3", "20202021", - make_default_supported_clusters()); + make_default_supported_clusters()); mContentApps.emplace_back(std::move(ptr)); } else if (vendorId == 1111 && productId == 22) { - auto ptr = std::make_unique("TestSuiteVendor", vendorId, "applicationId", productId, "v2", - "20202021", make_default_supported_clusters()); + auto ptr = std::make_unique("TestSuiteVendor", vendorId, "applicationId", productId, "v2", "20202021", + make_default_supported_clusters()); mContentApps.emplace_back(std::move(ptr)); } else { - auto ptr = std::make_unique("NewAppVendor", vendorId, "newAppApplicationId", productId, "v2", - "20202021", make_default_supported_clusters()); + auto ptr = std::make_unique("NewAppVendor", vendorId, "newAppApplicationId", productId, "v2", "20202021", + make_default_supported_clusters()); mContentApps.emplace_back(std::move(ptr)); } } @@ -641,7 +641,8 @@ void ContentAppFactoryImpl::PrintInstalledApps() { auto app = contentApp.get(); - ChipLogProgress(DeviceLayer, "Content app vid=%d pid=%d is on ep=%d", app->GetApplicationBasicDelegate()->HandleGetVendorId(), + ChipLogProgress(DeviceLayer, "Content app vid=%d pid=%d is on ep=%d", + app->GetApplicationBasicDelegate()->HandleGetVendorId(), app->GetApplicationBasicDelegate()->HandleGetProductId(), app->GetEndpointId()); } } From 8a3dae8b8343a911b13ee6334280ecc3739da666 Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Tue, 18 Jun 2024 18:42:50 +0200 Subject: [PATCH 5/7] Update per comments --- examples/tv-app/android/java/TVApp-JNI.cpp | 6 +++--- examples/tv-app/tv-common/include/AppTv.h | 3 ++- examples/tv-app/tv-common/src/AppTv.cpp | 2 +- src/controller/CommissionerDiscoveryController.cpp | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/tv-app/android/java/TVApp-JNI.cpp b/examples/tv-app/android/java/TVApp-JNI.cpp index a15f99f8fb7f87..04b5f4199edcaa 100644 --- a/examples/tv-app/android/java/TVApp-JNI.cpp +++ b/examples/tv-app/android/java/TVApp-JNI.cpp @@ -240,7 +240,7 @@ class MyPincodeService : public PasscodeService }; MyPincodeService gMyPincodeService; -class MyAppInstallationService : public AppInstallationService +class SampleTvAppInstallationService : public AppInstallationService { bool LookupTargetContentApp(uint16_t vendorId, uint16_t productId) override { @@ -248,7 +248,7 @@ class MyAppInstallationService : public AppInstallationService } }; -MyAppInstallationService gMyAppInstallationService; +SampleTvAppInstallationService gSampleTvAppInstallationService; class MyPostCommissioningListener : public PostCommissioningListener { @@ -382,7 +382,7 @@ void TvAppJNI::InitializeCommissioner(JNIMyUserPrompter * userPrompter) if (cdc != nullptr && userPrompter != nullptr) { cdc->SetPasscodeService(&gMyPincodeService); - cdc->SetAppInstallationService(&gMyAppInstallationService); + cdc->SetAppInstallationService(&gSampleTvAppInstallationService); cdc->SetUserPrompter(userPrompter); cdc->SetPostCommissioningListener(&gMyPostCommissioningListener); } diff --git a/examples/tv-app/tv-common/include/AppTv.h b/examples/tv-app/tv-common/include/AppTv.h index 799087e7be56b4..43c1a071a59081 100644 --- a/examples/tv-app/tv-common/include/AppTv.h +++ b/examples/tv-app/tv-common/include/AppTv.h @@ -150,7 +150,8 @@ class DLL_EXPORT ContentAppFactoryImpl : public ContentAppFactory // Remove the app from the list of mContentApps bool UninstallContentApp(uint16_t vendorId, uint16_t productId); // Print mContentApps and endpoints - void PrintInstalledApps(); + void LogInstalledApps(); + // TODO: method to retireve list of mContentApps protected: std::vector> mContentApps; diff --git a/examples/tv-app/tv-common/src/AppTv.cpp b/examples/tv-app/tv-common/src/AppTv.cpp index d712c4103fb121..03422c3fa462e7 100644 --- a/examples/tv-app/tv-common/src/AppTv.cpp +++ b/examples/tv-app/tv-common/src/AppTv.cpp @@ -635,7 +635,7 @@ bool ContentAppFactoryImpl::UninstallContentApp(uint16_t vendorId, uint16_t prod return false; } -void ContentAppFactoryImpl::PrintInstalledApps() +void ContentAppFactoryImpl::LogInstalledApps() { for (auto & contentApp : mContentApps) { diff --git a/src/controller/CommissionerDiscoveryController.cpp b/src/controller/CommissionerDiscoveryController.cpp index 7d5fde3a7ca93a..c1b5482d4846a8 100644 --- a/src/controller/CommissionerDiscoveryController.cpp +++ b/src/controller/CommissionerDiscoveryController.cpp @@ -231,6 +231,7 @@ void CommissionerDiscoveryController::InternalOk() ChipLogDetail(AppServer, "UX InternalOk: app not installed."); // TODO: Prepare app to be installed or add it to the mContentApps + // Draft PR: https://github.com/project-chip/connectedhomeip/pull/33982 } if (client->GetUDCClientProcessingState() != UDCClientProcessingState::kPromptingUser) From 77d20744ddca22fc2125496d175cd10d1c0bf30e Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Tue, 18 Jun 2024 18:42:50 +0200 Subject: [PATCH 6/7] Update per comments --- examples/tv-app/tv-common/include/AppTv.h | 3 ++- src/controller/CommissionerDiscoveryController.cpp | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/tv-app/tv-common/include/AppTv.h b/examples/tv-app/tv-common/include/AppTv.h index 43c1a071a59081..026f125339aba6 100644 --- a/examples/tv-app/tv-common/include/AppTv.h +++ b/examples/tv-app/tv-common/include/AppTv.h @@ -151,7 +151,8 @@ class DLL_EXPORT ContentAppFactoryImpl : public ContentAppFactory bool UninstallContentApp(uint16_t vendorId, uint16_t productId); // Print mContentApps and endpoints void LogInstalledApps(); - // TODO: method to retireve list of mContentApps + // TODO: method to retrieve list of mContentApps + // https://github.com/project-chip/connectedhomeip/issues/34020 protected: std::vector> mContentApps; diff --git a/src/controller/CommissionerDiscoveryController.cpp b/src/controller/CommissionerDiscoveryController.cpp index c1b5482d4846a8..7f13a4323d2f5c 100644 --- a/src/controller/CommissionerDiscoveryController.cpp +++ b/src/controller/CommissionerDiscoveryController.cpp @@ -229,9 +229,6 @@ void CommissionerDiscoveryController::InternalOk() if (!mAppInstallationService->LookupTargetContentApp(client->GetVendorId(), client->GetProductId())) { ChipLogDetail(AppServer, "UX InternalOk: app not installed."); - - // TODO: Prepare app to be installed or add it to the mContentApps - // Draft PR: https://github.com/project-chip/connectedhomeip/pull/33982 } if (client->GetUDCClientProcessingState() != UDCClientProcessingState::kPromptingUser) From 8bf7d58e287b70507d323cc3148473ab4004a281 Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Mon, 24 Jun 2024 09:12:26 +0200 Subject: [PATCH 7/7] Update Content app nullptrs --- .../src/main/java/com/matter/tv/server/model/ContentApp.java | 2 +- .../java/com/matter/tv/server/service/AppPlatformService.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/model/ContentApp.java b/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/model/ContentApp.java index 6b5856870eba58..8ffa891b1aff05 100644 --- a/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/model/ContentApp.java +++ b/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/model/ContentApp.java @@ -67,7 +67,7 @@ public void setEndpointId(int endpoint) { } public Set getSupportedClusters() { - return Collections.unmodifiableSet(supportedClusters); + return supportedClusters != null ? Collections.unmodifiableSet(supportedClusters) : Collections.EMPTY_SET; } public String getVersion() { diff --git a/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/service/AppPlatformService.java b/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/service/AppPlatformService.java index 32a5a9c2e2d865..766c451967316d 100644 --- a/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/service/AppPlatformService.java +++ b/examples/tv-app/android/App/platform-app/src/main/java/com/matter/tv/server/service/AppPlatformService.java @@ -198,6 +198,7 @@ private Collection mapSupportedClusters( Collection supportedClusters) { return supportedClusters .stream() + .filter(Objects::nonNull) .map(AppPlatformService::mapSupportedCluster) .collect(Collectors.toList()); }