Skip to content

Commit

Permalink
User/sachinta/fix deployment manager telemetry (#2802)
Browse files Browse the repository at this point in the history
* Fix DeploymentManager Initialize Activity's incorrect event name

* Fix DeploymentManager Initialize Activity lifetime

Co-authored-by: Santosh Chintalapati <sachinta@ntdev.microsoft.com>
  • Loading branch information
sachintaMSFT and Santosh Chintalapati authored Aug 4, 2022
1 parent ecbbca8 commit 1b7a14a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
17 changes: 9 additions & 8 deletions dev/Deployment/DeploymentManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,22 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem

winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentResult DeploymentManager::Initialize()
{
::WindowsAppRuntime::Deployment::Activity::Context::Get().GetActivity().Start(false,
Security::IntegrityLevel::IsElevated(),
AppModel::Identity::IsPackagedProcess(),
Security::IntegrityLevel::GetIntegrityLevel());
::WindowsAppRuntime::Deployment::Activity::Context::Get().SetActivity(WindowsAppRuntimeDeployment_TraceLogger::Initialize::Start(false,
Security::IntegrityLevel::IsElevated(),
AppModel::Identity::IsPackagedProcess(),
Security::IntegrityLevel::GetIntegrityLevel()));

FAIL_FAST_HR_IF(HRESULT_FROM_WIN32(APPMODEL_ERROR_NO_PACKAGE), !AppModel::Identity::IsPackagedProcess());
return Initialize(GetCurrentFrameworkPackageFullName());
}

winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentResult DeploymentManager::Initialize(winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentInitializeOptions const& deploymentInitializeOptions)
{
::WindowsAppRuntime::Deployment::Activity::Context::Get().GetActivity().Start(deploymentInitializeOptions.ForceDeployment(),
Security::IntegrityLevel::IsElevated(),
AppModel::Identity::IsPackagedProcess(),
Security::IntegrityLevel::GetIntegrityLevel());
::WindowsAppRuntime::Deployment::Activity::Context::Get().SetActivity(WindowsAppRuntimeDeployment_TraceLogger::Initialize::Start(
deploymentInitializeOptions.ForceDeployment(),
Security::IntegrityLevel::IsElevated(),
AppModel::Identity::IsPackagedProcess(),
Security::IntegrityLevel::GetIntegrityLevel()));

FAIL_FAST_HR_IF(HRESULT_FROM_WIN32(APPMODEL_ERROR_NO_PACKAGE), !AppModel::Identity::IsPackagedProcess());
return Initialize(GetCurrentFrameworkPackageFullName(), deploymentInitializeOptions);
Expand Down
5 changes: 2 additions & 3 deletions dev/Deployment/DeploymentTraceLogging.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ class WindowsAppRuntimeDeployment_TraceLogger final : public wil::TraceLoggingPr
}
else
{
TraceLoggingClassWriteStop(Install,
TraceLoggingClassWriteStop(Initialize,
_GENERIC_PARTB_FIELDS_ENABLED,
TraceLoggingValue(preInitializeStatus, "preInitializeStatus"),
TraceLoggingValue(isFullTrustPackage, "isFullTrustPackage"));
TraceLoggingValue(preInitializeStatus, "preInitializeStatus"));
}
}
END_ACTIVITY_CLASS();
Expand Down

0 comments on commit 1b7a14a

Please sign in to comment.