diff --git a/src/app/app-platform/ContentAppPlatform.cpp b/src/app/app-platform/ContentAppPlatform.cpp index 014dec90fc7492..6555e55b04aaba 100644 --- a/src/app/app-platform/ContentAppPlatform.cpp +++ b/src/app/app-platform/ContentAppPlatform.cpp @@ -398,7 +398,7 @@ void ContentAppPlatform::SetCurrentApp(ContentApp * app) bool ContentAppPlatform::IsCurrentApp(ContentApp * app) { - if (HasCurrentApp()) + if (!HasCurrentApp()) { return false; } diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp index 6f38acf9acb163..39d9d0c8a21a0a 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp +++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp @@ -278,6 +278,16 @@ bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * co { ContentAppPlatform::GetInstance().SetCurrentApp(app); } + else + { + ChipLogError(Zcl, "ApplicationLauncher target app not found"); + LauncherResponseType response; + const char * buf = "data"; + response.data = ByteSpan(from_const_char(buf), strlen(buf)); + response.status = ApplicationLauncherStatusEnum::kAppNotAvailable; + responder.Success(response); + return true; + } #endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED ChipLogError(Zcl, "ApplicationLauncher handling launch"); @@ -354,6 +364,7 @@ bool emberAfApplicationLauncherClusterStopAppCallback(app::CommandHandler * comm if (app != nullptr) { ContentAppPlatform::GetInstance().UnsetIfCurrentApp(app); + app->GetApplicationBasicDelegate()->SetApplicationStatus(ApplicationStatusEnum::kStopped); } #endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED