Skip to content

Commit

Permalink
[chromebox_for_meetings] Enable hotlog2; gate on switch
Browse files Browse the repository at this point in the history
Bug: b:338599950
Change-Id: Iaf5459940386064cc7f7aaaab7726cb3cebc2309
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5594589
Reviewed-by: Kyle Williams <kdgwill@chromium.org>
Commit-Queue: Niko Tsirakis <ntsirakis@google.com>
Cr-Commit-Position: refs/heads/main@{#1312823}
  • Loading branch information
Niko Tsirakis authored and pull[bot] committed Jun 10, 2024
1 parent c02bd87 commit 1069698
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions chrome/browser/ash/chromebox_for_meetings/cfm_chrome_services.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@

#include "chrome/browser/ash/chromebox_for_meetings/cfm_chrome_services.h"

#include "base/command_line.h"
#include "chrome/browser/ash/chromebox_for_meetings/browser/cfm_browser_service.h"
#include "chrome/browser/ash/chromebox_for_meetings/device_info/device_info_service.h"
#include "chrome/browser/ash/chromebox_for_meetings/diagnostics/diagnostics_service.h"
#include "chrome/browser/ash/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.h"
#include "chrome/browser/ash/chromebox_for_meetings/hotlog2/data_aggregator_service.h"
#include "chrome/browser/ash/chromebox_for_meetings/logger/cfm_logger_service.h"
#include "chrome/browser/ash/chromebox_for_meetings/xu_camera/xu_camera_service.h"
#include "chromeos/ash/components/chromebox_for_meetings/features.h"
#include "chromeos/ash/components/dbus/chromebox_for_meetings/cfm_hotline_client.h"

namespace ash::cfm {

inline constexpr char kCfmEnableHotlogSwitch[] = "cfm-enable-hotlog2";

void InitializeCfmServices() {
if (!base::FeatureList::IsEnabled(features::kMojoServices) ||
!CfmHotlineClient::Get()) {
Expand All @@ -27,6 +31,12 @@ void InitializeCfmServices() {
DiagnosticsService::Initialize();
XuCameraService::Initialize();
ExternalDisplayBrightnessService::Initialize();
// TODO(b/341066822): gate Hotlog2 on LaCrOS instead of manual switch.
// Use `crosapi::browser_util::IsLacrosEnabled()` to check.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
kCfmEnableHotlogSwitch)) {
DataAggregatorService::Initialize();
}
}

void ShutdownCfmServices() {
Expand All @@ -35,6 +45,12 @@ void ShutdownCfmServices() {
return;
}

// TODO(b/341066822): gate Hotlog2 on LaCrOS instead of manual switch.
// Use `crosapi::browser_util::IsLacrosEnabled()` to check.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
kCfmEnableHotlogSwitch)) {
DataAggregatorService::Shutdown();
}
ExternalDisplayBrightnessService::Shutdown();
XuCameraService::Shutdown();
DiagnosticsService::Shutdown();
Expand Down

0 comments on commit 1069698

Please sign in to comment.