Commit f331bc87 authored by Matt Menard's avatar Matt Menard Committed by Commit Bot

Add privacy notifications for app info and activity

When app installation info and activity is being collected from the
user, we need to inform them on the chrome://management page.

Bug: 1058453
Change-Id: I6b771870e68b55afe01cce9666a3625472ddcad0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2170171
Commit-Queue: Matt Menard <mattme@google.com>
Reviewed-by: default avatarThiemo Nagel <tnagel@chromium.org>
Reviewed-by: default avatarAnqing Zhao <anqing@chromium.org>
Reviewed-by: default avatarSergey Poromov <poromov@chromium.org>
Reviewed-by: default avatarRoman Aleksandrov <raleksandrov@google.com>
Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782075}
parent 8d628b4f
...@@ -408,6 +408,9 @@ bool ChildStatusCollector::ShouldReportHardwareStatus() const { ...@@ -408,6 +408,9 @@ bool ChildStatusCollector::ShouldReportHardwareStatus() const {
bool ChildStatusCollector::ShouldReportCrashReportInfo() const { bool ChildStatusCollector::ShouldReportCrashReportInfo() const {
return false; return false;
} }
bool ChildStatusCollector::ShouldReportAppInfoAndActivity() const {
return false;
}
void ChildStatusCollector::OnOSVersion(const std::string& version) { void ChildStatusCollector::OnOSVersion(const std::string& version) {
os_version_ = version; os_version_ = version;
......
...@@ -80,6 +80,7 @@ class ChildStatusCollector : public StatusCollector, ...@@ -80,6 +80,7 @@ class ChildStatusCollector : public StatusCollector,
bool ShouldReportUsers() const override; bool ShouldReportUsers() const override;
bool ShouldReportHardwareStatus() const override; bool ShouldReportHardwareStatus() const override;
bool ShouldReportCrashReportInfo() const override; bool ShouldReportCrashReportInfo() const override;
bool ShouldReportAppInfoAndActivity() const override;
// Returns the amount of time the child has used so far today. If there is no // Returns the amount of time the child has used so far today. If there is no
// user logged in, it returns 0. // user logged in, it returns 0.
......
...@@ -2544,6 +2544,9 @@ bool DeviceStatusCollector::ShouldReportHardwareStatus() const { ...@@ -2544,6 +2544,9 @@ bool DeviceStatusCollector::ShouldReportHardwareStatus() const {
bool DeviceStatusCollector::ShouldReportCrashReportInfo() const { bool DeviceStatusCollector::ShouldReportCrashReportInfo() const {
return report_crash_report_info_ && stat_reporting_pref_; return report_crash_report_info_ && stat_reporting_pref_;
} }
bool DeviceStatusCollector::ShouldReportAppInfoAndActivity() const {
return report_app_info_;
}
void DeviceStatusCollector::OnOSVersion(const std::string& version) { void DeviceStatusCollector::OnOSVersion(const std::string& version) {
os_version_ = version; os_version_ = version;
......
...@@ -209,6 +209,7 @@ class DeviceStatusCollector : public StatusCollector, ...@@ -209,6 +209,7 @@ class DeviceStatusCollector : public StatusCollector,
bool ShouldReportUsers() const override; bool ShouldReportUsers() const override;
bool ShouldReportHardwareStatus() const override; bool ShouldReportHardwareStatus() const override;
bool ShouldReportCrashReportInfo() const override; bool ShouldReportCrashReportInfo() const override;
bool ShouldReportAppInfoAndActivity() const override;
static void RegisterPrefs(PrefRegistrySimple* registry); static void RegisterPrefs(PrefRegistrySimple* registry);
......
...@@ -105,6 +105,7 @@ class StatusCollector { ...@@ -105,6 +105,7 @@ class StatusCollector {
virtual bool ShouldReportUsers() const = 0; virtual bool ShouldReportUsers() const = 0;
virtual bool ShouldReportHardwareStatus() const = 0; virtual bool ShouldReportHardwareStatus() const = 0;
virtual bool ShouldReportCrashReportInfo() const = 0; virtual bool ShouldReportCrashReportInfo() const = 0;
virtual bool ShouldReportAppInfoAndActivity() const = 0;
// Returns the DeviceLocalAccount associated with the currently active kiosk // Returns the DeviceLocalAccount associated with the currently active kiosk
// session, if the session was auto-launched with zero delay (this enables // session, if the session was auto-launched with zero delay (this enables
......
...@@ -69,6 +69,7 @@ export const DeviceReportingType = { ...@@ -69,6 +69,7 @@ export const DeviceReportingType = {
STATISTIC: 'device statistics', STATISTIC: 'device statistics',
DEVICE: 'device', DEVICE: 'device',
CRASH_REPORT: 'crash report', CRASH_REPORT: 'crash report',
APP_INFO_AND_ACTIVITY: 'app info and activity',
LOGS: 'logs', LOGS: 'logs',
PRINT: 'print', PRINT: 'print',
CROSTINI: 'crostini', CROSTINI: 'crostini',
......
...@@ -221,6 +221,8 @@ Polymer({ ...@@ -221,6 +221,8 @@ Polymer({
return 'cr:computer'; return 'cr:computer';
case DeviceReportingType.CRASH_REPORT: case DeviceReportingType.CRASH_REPORT:
return 'management:crash'; return 'management:crash';
case DeviceReportingType.APP_INFO_AND_ACTIVITY:
return 'management:timelapse';
case DeviceReportingType.LOGS: case DeviceReportingType.LOGS:
return 'management:report'; return 'management:report';
case DeviceReportingType.PRINT: case DeviceReportingType.PRINT:
......
...@@ -59,6 +59,8 @@ content::WebUIDataSource* CreateManagementUIHtmlSource(Profile* profile) { ...@@ -59,6 +59,8 @@ content::WebUIDataSource* CreateManagementUIHtmlSource(Profile* profile) {
IDS_MANAGEMENT_REPORT_DEVICE_NETWORK_INTERFACES}, IDS_MANAGEMENT_REPORT_DEVICE_NETWORK_INTERFACES},
{kManagementReportUsers, IDS_MANAGEMENT_REPORT_DEVICE_USERS}, {kManagementReportUsers, IDS_MANAGEMENT_REPORT_DEVICE_USERS},
{kManagementReportCrashReports, IDS_MANAGEMENT_REPORT_DEVICE_CRASH_REPORTS}, {kManagementReportCrashReports, IDS_MANAGEMENT_REPORT_DEVICE_CRASH_REPORTS},
{kManagementReportAppInfoAndActivity,
IDS_MANAGEMENT_REPORT_APP_INFO_AND_ACTIVITY},
{kManagementPrinting, IDS_MANAGEMENT_REPORT_PRINTING}, {kManagementPrinting, IDS_MANAGEMENT_REPORT_PRINTING},
{kManagementCrostini, IDS_MANAGEMENT_CROSTINI}, {kManagementCrostini, IDS_MANAGEMENT_CROSTINI},
{kManagementCrostiniContainerConfiguration, {kManagementCrostiniContainerConfiguration,
......
...@@ -151,6 +151,8 @@ const char kManagementReportNetworkInterfaces[] = ...@@ -151,6 +151,8 @@ const char kManagementReportNetworkInterfaces[] =
"managementReportNetworkInterfaces"; "managementReportNetworkInterfaces";
const char kManagementReportUsers[] = "managementReportUsers"; const char kManagementReportUsers[] = "managementReportUsers";
const char kManagementReportCrashReports[] = "managementReportCrashReports"; const char kManagementReportCrashReports[] = "managementReportCrashReports";
const char kManagementReportAppInfoAndActivity[] =
"managementReportAppInfoAndActivity";
const char kManagementReportExtensions[] = "managementReportExtensions"; const char kManagementReportExtensions[] = "managementReportExtensions";
const char kManagementReportAndroidApplications[] = const char kManagementReportAndroidApplications[] =
"managementReportAndroidApplications"; "managementReportAndroidApplications";
...@@ -197,6 +199,7 @@ enum class DeviceReportingType { ...@@ -197,6 +199,7 @@ enum class DeviceReportingType {
kDeviceStatistics, kDeviceStatistics,
kDevice, kDevice,
kCrashReport, kCrashReport,
kAppInfoAndActivity,
kLogs, kLogs,
kPrint, kPrint,
kCrostini, kCrostini,
...@@ -219,6 +222,8 @@ std::string ToJSDeviceReportingType(const DeviceReportingType& type) { ...@@ -219,6 +222,8 @@ std::string ToJSDeviceReportingType(const DeviceReportingType& type) {
return "device"; return "device";
case DeviceReportingType::kCrashReport: case DeviceReportingType::kCrashReport:
return "crash report"; return "crash report";
case DeviceReportingType::kAppInfoAndActivity:
return "app info and activity";
case DeviceReportingType::kLogs: case DeviceReportingType::kLogs:
return "logs"; return "logs";
case DeviceReportingType::kPrint: case DeviceReportingType::kPrint:
...@@ -549,6 +554,11 @@ void ManagementUIHandler::AddDeviceReportingInfo( ...@@ -549,6 +554,11 @@ void ManagementUIHandler::AddDeviceReportingInfo(
AddDeviceReportingElement(report_sources, kManagementReportCrashReports, AddDeviceReportingElement(report_sources, kManagementReportCrashReports,
DeviceReportingType::kCrashReport); DeviceReportingType::kCrashReport);
} }
if (collector->ShouldReportAppInfoAndActivity()) {
AddDeviceReportingElement(report_sources,
kManagementReportAppInfoAndActivity,
DeviceReportingType::kAppInfoAndActivity);
}
if (uploader->upload_enabled()) { if (uploader->upload_enabled()) {
AddDeviceReportingElement(report_sources, kManagementLogUploadEnabled, AddDeviceReportingElement(report_sources, kManagementLogUploadEnabled,
DeviceReportingType::kLogs); DeviceReportingType::kLogs);
......
...@@ -33,6 +33,7 @@ extern const char kManagementReportHardwareStatus[]; ...@@ -33,6 +33,7 @@ extern const char kManagementReportHardwareStatus[];
extern const char kManagementReportNetworkInterfaces[]; extern const char kManagementReportNetworkInterfaces[];
extern const char kManagementReportUsers[]; extern const char kManagementReportUsers[];
extern const char kManagementReportCrashReports[]; extern const char kManagementReportCrashReports[];
extern const char kManagementReportAppInfoAndActivity[];
extern const char kManagementPrinting[]; extern const char kManagementPrinting[];
extern const char kManagementCrostini[]; extern const char kManagementCrostini[];
extern const char kManagementCrostiniContainerConfiguration[]; extern const char kManagementCrostiniContainerConfiguration[];
......
...@@ -100,13 +100,15 @@ class TestDeviceStatusCollector : public policy::DeviceStatusCollector { ...@@ -100,13 +100,15 @@ class TestDeviceStatusCollector : public policy::DeviceStatusCollector {
bool report_nics, bool report_nics,
bool report_users, bool report_users,
bool report_hw_status, bool report_hw_status,
bool report_crash_info) bool report_crash_info,
bool report_app_info_and_activity)
: policy::DeviceStatusCollector(local_state, nullptr), : policy::DeviceStatusCollector(local_state, nullptr),
report_activity_times_(report_activity_times), report_activity_times_(report_activity_times),
report_nics_(report_nics), report_nics_(report_nics),
report_users_(report_users), report_users_(report_users),
report_hw_status_(report_hw_status), report_hw_status_(report_hw_status),
report_crash_info_(report_crash_info) {} report_crash_info_(report_crash_info),
report_app_info_and_activity_(report_app_info_and_activity) {}
~TestDeviceStatusCollector() override = default; ~TestDeviceStatusCollector() override = default;
bool ShouldReportActivityTimes() const override { bool ShouldReportActivityTimes() const override {
...@@ -118,8 +120,12 @@ class TestDeviceStatusCollector : public policy::DeviceStatusCollector { ...@@ -118,8 +120,12 @@ class TestDeviceStatusCollector : public policy::DeviceStatusCollector {
bool ShouldReportCrashReportInfo() const override { bool ShouldReportCrashReportInfo() const override {
return report_crash_info_; return report_crash_info_;
} }
bool ShouldReportAppInfoAndActivity() const override {
return report_app_info_and_activity_;
}
// empty methods that need to be implemented but are of no use for this case. // empty methods that need to be implemented but are of no use for this
// case.
void GetStatusAsync( void GetStatusAsync(
const policy::StatusCollectorCallback& callback) override {} const policy::StatusCollectorCallback& callback) override {}
void OnSubmittedSuccessfully() override {} void OnSubmittedSuccessfully() override {}
...@@ -130,6 +136,7 @@ class TestDeviceStatusCollector : public policy::DeviceStatusCollector { ...@@ -130,6 +136,7 @@ class TestDeviceStatusCollector : public policy::DeviceStatusCollector {
bool report_users_; bool report_users_;
bool report_hw_status_; bool report_hw_status_;
bool report_crash_info_; bool report_crash_info_;
bool report_app_info_and_activity_;
}; };
class TestDeviceCloudPolicyManagerChromeOS class TestDeviceCloudPolicyManagerChromeOS
...@@ -300,6 +307,7 @@ class ManagementUIHandlerTests : public TestingBaseClass { ...@@ -300,6 +307,7 @@ class ManagementUIHandlerTests : public TestingBaseClass {
bool report_users; bool report_users;
bool report_hw_status; bool report_hw_status;
bool report_crash_info; bool report_crash_info;
bool report_app_info_and_activity;
bool upload_enabled; bool upload_enabled;
bool printing_send_username_and_filename; bool printing_send_username_and_filename;
bool crostini_report_usage; bool crostini_report_usage;
...@@ -320,6 +328,7 @@ class ManagementUIHandlerTests : public TestingBaseClass { ...@@ -320,6 +328,7 @@ class ManagementUIHandlerTests : public TestingBaseClass {
setup_config_.report_users = default_value; setup_config_.report_users = default_value;
setup_config_.report_hw_status = default_value; setup_config_.report_hw_status = default_value;
setup_config_.report_crash_info = default_value; setup_config_.report_crash_info = default_value;
setup_config_.report_app_info_and_activity = default_value;
setup_config_.upload_enabled = default_value; setup_config_.upload_enabled = default_value;
setup_config_.printing_send_username_and_filename = default_value; setup_config_.printing_send_username_and_filename = default_value;
setup_config_.crostini_report_usage = default_value; setup_config_.crostini_report_usage = default_value;
...@@ -374,8 +383,8 @@ class ManagementUIHandlerTests : public TestingBaseClass { ...@@ -374,8 +383,8 @@ class ManagementUIHandlerTests : public TestingBaseClass {
new TestDeviceStatusCollector( new TestDeviceStatusCollector(
&local_state_, GetTestConfig().report_activity_times, &local_state_, GetTestConfig().report_activity_times,
GetTestConfig().report_nics, GetTestConfig().report_users, GetTestConfig().report_nics, GetTestConfig().report_users,
GetTestConfig().report_hw_status, GetTestConfig().report_hw_status, GetTestConfig().report_crash_info,
GetTestConfig().report_crash_info); GetTestConfig().report_app_info_and_activity);
settings_.device_settings()->SetTrustedStatus( settings_.device_settings()->SetTrustedStatus(
chromeos::CrosSettingsProvider::TRUSTED); chromeos::CrosSettingsProvider::TRUSTED);
settings_.device_settings()->SetBoolean(chromeos::kSystemLogUploadEnabled, settings_.device_settings()->SetBoolean(chromeos::kSystemLogUploadEnabled,
...@@ -547,8 +556,8 @@ AssertionResult ReportingElementsToBeEQ( ...@@ -547,8 +556,8 @@ AssertionResult ReportingElementsToBeEQ(
} }
if (!tmp_expected.empty()) { if (!tmp_expected.empty()) {
AssertionResult result = AssertionFailure(); AssertionResult result = AssertionFailure();
result result << " the following messageId and reportingTypes could not be "
<< " the following messageId and reportingTypes could not be matched {"; "matched {";
for (const auto& element : tmp_expected) { for (const auto& element : tmp_expected) {
result << " messageId: " << element.first << ", reportingType " result << " messageId: " << element.first << ", reportingType "
<< element.second; << element.second;
...@@ -814,6 +823,7 @@ TEST_F(ManagementUIHandlerTests, AllEnabledDeviceReportingInfo) { ...@@ -814,6 +823,7 @@ TEST_F(ManagementUIHandlerTests, AllEnabledDeviceReportingInfo) {
{kManagementReportHardwareStatus, "device statistics"}, {kManagementReportHardwareStatus, "device statistics"},
{kManagementReportNetworkInterfaces, "device"}, {kManagementReportNetworkInterfaces, "device"},
{kManagementReportCrashReports, "crash report"}, {kManagementReportCrashReports, "crash report"},
{kManagementReportAppInfoAndActivity, "app info and activity"},
{kManagementLogUploadEnabled, "logs"}, {kManagementLogUploadEnabled, "logs"},
{kManagementPrinting, "print"}, {kManagementPrinting, "print"},
{kManagementCrostini, "crostini"}, {kManagementCrostini, "crostini"},
...@@ -835,6 +845,7 @@ TEST_F(ManagementUIHandlerTests, ...@@ -835,6 +845,7 @@ TEST_F(ManagementUIHandlerTests,
{kManagementReportHardwareStatus, "device statistics"}, {kManagementReportHardwareStatus, "device statistics"},
{kManagementReportNetworkInterfaces, "device"}, {kManagementReportNetworkInterfaces, "device"},
{kManagementReportCrashReports, "crash report"}, {kManagementReportCrashReports, "crash report"},
{kManagementReportAppInfoAndActivity, "app info and activity"},
{kManagementLogUploadEnabled, "logs"}, {kManagementLogUploadEnabled, "logs"},
{kManagementPrinting, "print"}, {kManagementPrinting, "print"},
{kManagementCrostiniContainerConfiguration, "crostini"}, {kManagementCrostiniContainerConfiguration, "crostini"},
......
...@@ -104,6 +104,9 @@ ...@@ -104,6 +104,9 @@
<message name="IDS_MANAGEMENT_REPORT_DEVICE_CRASH_REPORTS" desc="Message stating that administrators see the numbers and causes of the crashes that occurred on the device recently."> <message name="IDS_MANAGEMENT_REPORT_DEVICE_CRASH_REPORTS" desc="Message stating that administrators see the numbers and causes of the crashes that occurred on the device recently.">
Numbers and causes of the crashes that occurred recently Numbers and causes of the crashes that occurred recently
</message> </message>
<message name="IDS_MANAGEMENT_REPORT_APP_INFO_AND_ACTIVITY" desc="Message stating that administrators see application install information and activity times.">
Apps installed and how often they are used
</message>
<message name="IDS_MANAGEMENT_REPORT_PRINTING" desc="Message stating that administrators can see names of printed files."> <message name="IDS_MANAGEMENT_REPORT_PRINTING" desc="Message stating that administrators can see names of printed files.">
Names of files that you print Names of files that you print
</message> </message>
......
81b165132ac689d96a5438a121883a5f6ae9f407
\ No newline at end of file
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