Commit be1a89ff authored by Jit Yao Yap's avatar Jit Yao Yap Committed by Commit Bot

Re-add default values for DeviceReportingProto

The CL (https://crrev.com/c/2418989) removed the default values in
DeviceReportingProto since the protobuf default values are not
respected in the Chrome. However, the server-side team feels that this
removing the default values is unsafe as it can introduce unexpected
behavior changes.

This CL serves as a compromise where the default values are
re-introduced to DeviceReportingProto and comments are added to indicate
that the default values used in Chrome have to be kept in sync with the
default values in the protobuf.

Change-Id: Icb0922a4ed6a68897069854049b5302b2f9ef94c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2549300
Commit-Queue: Jit Yao Yap <jityao@google.com>
Reviewed-by: default avatarAlexander Hendrich <hendrich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830093}
parent c788f0a7
......@@ -68,6 +68,8 @@ const char kZeroTouchEnrollmentHandsOff[] = "hands-off";
// Default frequency for uploading enterprise status reports. Can be overriden
// by Device Policy.
// Keep the default value in sync with device_status_frequency in
// DeviceReportingProto in components/policy/proto/chrome_device_policy.proto.
constexpr base::TimeDelta kDeviceStatusUploadFrequency =
base::TimeDelta::FromHours(3);
......
......@@ -192,10 +192,11 @@ void ChildStatusCollector::UpdateReportingSettings() {
}
// Settings related.
// Keep the default values in sync with DeviceReportingProto in
// chrome/browser/chromeos/policy/status_collector/child_status_collector.cc.
report_version_info_ = true;
cros_settings_->GetBoolean(chromeos::kReportDeviceVersionInfo,
&report_version_info_);
report_boot_mode_ = true;
cros_settings_->GetBoolean(chromeos::kReportDeviceBootMode,
&report_boot_mode_);
......
......@@ -1545,6 +1545,8 @@ void DeviceStatusCollector::UpdateReportingSettings() {
return;
}
// Keep the default values in sync with DeviceReportingProto in
// components/policy/proto/chrome_device_policy.proto.
if (!cros_settings_->GetBoolean(chromeos::kReportDeviceVersionInfo,
&report_version_info_)) {
report_version_info_ = true;
......
......@@ -112,34 +112,40 @@ message NetworkHostnameProto {
}
// Policies to turn on portions of the device status reports.
// If changed, the default values have to be updated in
// chrome/browser/chromeos/policy/status_collector/device_status_collector.cc
// and
// chrome/browser/chromeos/policy/status_collector/child_status_collector.cc.
message DeviceReportingProto {
optional bool report_version_info = 1;
optional bool report_activity_times = 2;
optional bool report_boot_mode = 3;
optional bool report_location = 4;
optional bool report_network_interfaces = 5;
optional bool report_users = 6;
optional bool report_hardware_status = 7;
optional bool report_session_status = 8;
optional bool report_os_update_status = 10;
optional bool report_running_kiosk_app = 11;
optional bool report_power_status = 12;
optional bool report_storage_status = 13;
optional bool report_board_status = 14;
optional bool report_cpu_info = 15;
optional bool report_graphics_status = 16;
optional bool report_crash_report_info = 17;
optional bool report_timezone_info = 18;
optional bool report_memory_info = 19;
optional bool report_backlight_info = 20;
optional bool report_app_info = 21;
optional bool report_bluetooth_info = 22;
optional bool report_fan_info = 23;
optional bool report_vpd_info = 24;
optional bool report_system_info = 25;
// Frequency to report device status.
optional int64 device_status_frequency = 9;
optional bool report_version_info = 1 [default = true];
optional bool report_activity_times = 2 [default = true];
optional bool report_boot_mode = 3 [default = true];
optional bool report_location = 4 [default = false];
optional bool report_network_interfaces = 5 [default = true];
optional bool report_users = 6 [default = true];
optional bool report_hardware_status = 7 [default = true];
optional bool report_session_status = 8 [default = true];
optional bool report_os_update_status = 10 [default = false];
optional bool report_running_kiosk_app = 11 [default = false];
optional bool report_power_status = 12 [default = false];
optional bool report_storage_status = 13 [default = false];
optional bool report_board_status = 14 [default = false];
optional bool report_cpu_info = 15 [default = false];
optional bool report_graphics_status = 16 [default = false];
optional bool report_crash_report_info = 17 [default = false];
optional bool report_timezone_info = 18 [default = false];
optional bool report_memory_info = 19 [default = false];
optional bool report_backlight_info = 20 [default = false];
optional bool report_app_info = 21 [default = false];
optional bool report_bluetooth_info = 22 [default = false];
optional bool report_fan_info = 23 [default = false];
optional bool report_vpd_info = 24 [default = false];
optional bool report_system_info = 25 [default = false];
// Frequency to report device status, default to 3 hours.
// If changed, the default value has to be updated in
// chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.cc.
optional int64 device_status_frequency = 9 [default = 10800000];
}
message EphemeralUsersEnabledProto {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment