Commit 7da098a1 authored by Josh Horwich's avatar Josh Horwich Committed by Commit Bot

arc: Make SET_REPORTING_CONSENT false for managed users

Keep usage & diagnostics false during ARC setup if the user does not
see the ARC ToS dialog due to all relevant settings being managed,
even if usage & diagnostics is enabled for the device.

Also removes the notification added by crrev.com/c/1086354.

Bug: b/73338614, 859104, 855448
Test: Opt in to ARC with managed and unmanaged users
Change-Id: If5bd6b10d4059df97af0b6c14c8f8a15ceaaddc0
Reviewed-on: https://chromium-review.googlesource.com/1115712
Commit-Queue: Josh Horwich <jhorwich@chromium.org>
Reviewed-by: default avatarLuis Hector Chavez <lhchavez@chromium.org>
Reviewed-by: default avatarLong Cheng <lgcheng@google.com>
Cr-Commit-Position: refs/heads/master@{#571532}
parent ca7c8289
...@@ -4539,16 +4539,6 @@ ...@@ -4539,16 +4539,6 @@
<message name="IDS_ARC_OPT_IN_DIALOG_METRICS_DISABLED" desc="Message in the opt-in dialog for Android apps in case metrics are disabled on the device. User has an option to active them using opt-in dialog"> <message name="IDS_ARC_OPT_IN_DIALOG_METRICS_DISABLED" desc="Message in the opt-in dialog for Android apps in case metrics are disabled on the device. User has an option to active them using opt-in dialog">
Send system data. Automatically send diagnostic and device and app usage data to Google. You can change this at any time in your device <ph name="BEGIN_LINK1">&lt;a href="#" id="settings-link"&gt;</ph>settings<ph name="END_LINK1">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph>. If you turned on additional Web &#38; App Activity, this information will be stored with your account so you can manage it in My Activity. <ph name="BEGIN_LINK2">&lt;a href="#" id="learn-more-link-metrics"&gt;</ph>Learn More<ph name="END_LINK2">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph> Send system data. Automatically send diagnostic and device and app usage data to Google. You can change this at any time in your device <ph name="BEGIN_LINK1">&lt;a href="#" id="settings-link"&gt;</ph>settings<ph name="END_LINK1">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph>. If you turned on additional Web &#38; App Activity, this information will be stored with your account so you can manage it in My Activity. <ph name="BEGIN_LINK2">&lt;a href="#" id="learn-more-link-metrics"&gt;</ph>Learn More<ph name="END_LINK2">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph>
</message> </message>
<message name="IDS_ARC_NOTIFICATION_METRICS_ENABLED_MANAGED_TITLE" desc="Title of notification shown to managed users who don't see the opt-in dialog as all settings are managed.">
Send system data
</message>
<message name="IDS_ARC_NOTIFICATION_METRICS_ENABLED_MANAGED_MESSAGE" desc="Message of notification shown to managed users who don't see the opt-in dialog as all settings are managed.">
This device currently automatically sends diagnostic and device and app usage data to Google. This setting is enforced by the owner. If you turned on additional Web &#38; App Activity, this information will be stored with your account so you can manage it in My Activity.
This is general information about your device and how you use it (such as battery level, app usage, and network connectivity). The data will be used to improve Google's products and services for everyone. Some aggregated information will help partners, such as Android developers, make their apps and products better, too.
Turning off this feature doesn't affect your device's ability to send the information needed for essential services such as system updates and security.
You can control this feature from Settings &gt; Google. Select Usage &#38; diagnostics from the menu.
</message>
<message name="IDS_ARC_OPT_IN_DIALOG_BACKUP_RESTORE" desc="Message in the opt-in dialog for users to enable Backup and Restore for Android apps."> <message name="IDS_ARC_OPT_IN_DIALOG_BACKUP_RESTORE" desc="Message in the opt-in dialog for users to enable Backup and Restore for Android apps.">
Back up to Google Drive. Easily restore your data or switch device at any time. Your backup includes app data. <ph name="BEGIN_LINK1">&lt;a href="#" id="learn-more-link-backup-restore"&gt;</ph>Learn More<ph name="END_LINK1">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph> Back up to Google Drive. Easily restore your data or switch device at any time. Your backup includes app data. <ph name="BEGIN_LINK1">&lt;a href="#" id="learn-more-link-backup-restore"&gt;</ph>Learn More<ph name="END_LINK1">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph>
</message> </message>
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "chrome/browser/chromeos/arc/arc_migration_guide_notification.h" #include "chrome/browser/chromeos/arc/arc_migration_guide_notification.h"
...@@ -35,8 +34,6 @@ ...@@ -35,8 +34,6 @@
#include "chrome/browser/ui/app_list/arc/arc_pai_starter.h" #include "chrome/browser/ui/app_list/arc/arc_pai_starter.h"
#include "chrome/browser/ui/ash/multi_user/multi_user_util.h" #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
#include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/simple_message_box.h"
#include "chrome/grit/generated_resources.h"
#include "chromeos/chromeos_switches.h" #include "chromeos/chromeos_switches.h"
#include "chromeos/cryptohome/cryptohome_parameters.h" #include "chromeos/cryptohome/cryptohome_parameters.h"
#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dbus_thread_manager.h"
...@@ -53,7 +50,6 @@ ...@@ -53,7 +50,6 @@
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/session_manager/core/session_manager.h" #include "components/session_manager/core/session_manager.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/display/types/display_constants.h" #include "ui/display/types/display_constants.h"
namespace arc { namespace arc {
...@@ -94,27 +90,6 @@ chromeos::SessionManagerClient* GetSessionManagerClient() { ...@@ -94,27 +90,6 @@ chromeos::SessionManagerClient* GetSessionManagerClient() {
return chromeos::DBusThreadManager::Get()->GetSessionManagerClient(); return chromeos::DBusThreadManager::Get()->GetSessionManagerClient();
} }
void ShowUMAConsentMessageBox() {
session_manager::SessionManager* manager =
session_manager::SessionManager::Get();
// SessionManager may not be available in unittests.
// TODO(lgcheng@) Temporarily drop this warning if login screen is still
// present. Fix this when we have full spec what EDU requests.
if (!manager ||
manager->session_state() != session_manager::SessionState::ACTIVE) {
LOG(ERROR) << "Login screen is still present. Dropping request to show UMA "
"consent message box";
return;
}
chrome::ShowWarningMessageBox(
nullptr,
l10n_util::GetStringUTF16(
IDS_ARC_NOTIFICATION_METRICS_ENABLED_MANAGED_TITLE),
l10n_util::GetStringUTF16(
IDS_ARC_NOTIFICATION_METRICS_ENABLED_MANAGED_MESSAGE));
}
// Returns true if launching the Play Store on OptIn succeeded is needed. // Returns true if launching the Play Store on OptIn succeeded is needed.
// Launch Play Store app, except for the following cases: // Launch Play Store app, except for the following cases:
// * When Opt-in verification is disabled (for tests); // * When Opt-in verification is disabled (for tests);
...@@ -801,13 +776,11 @@ void ArcSessionManager::MaybeStartTermsOfServiceNegotiation() { ...@@ -801,13 +776,11 @@ void ArcSessionManager::MaybeStartTermsOfServiceNegotiation() {
} }
if (!IsArcTermsOfServiceNegotiationNeeded(profile_)) { if (!IsArcTermsOfServiceNegotiationNeeded(profile_)) {
// Show a notification about stats reporting if enabled in the case where
// it isn't shown during ToS negotiation.
if (IsArcStatsReportingEnabled() && if (IsArcStatsReportingEnabled() &&
!profile_->GetPrefs()->GetBoolean(prefs::kArcTermsAccepted)) { !profile_->GetPrefs()->GetBoolean(prefs::kArcTermsAccepted)) {
VLOG(1) << "Showing stats reporting notification"; // Don't enable stats reporting for users who are not shown the reporting
base::ThreadTaskRunnerHandle::Get()->PostTask( // notice during ARC setup.
FROM_HERE, base::BindOnce(&ShowUMAConsentMessageBox)); profile_->GetPrefs()->SetBoolean(prefs::kArcSkippedReportingNotice, true);
} }
// Moves to next state, Android management check, immediately, as if // Moves to next state, Android management check, immediately, as if
......
...@@ -526,6 +526,15 @@ void ArcSettingsServiceImpl::SyncReportingConsent(bool initial_sync) const { ...@@ -526,6 +526,15 @@ void ArcSettingsServiceImpl::SyncReportingConsent(bool initial_sync) const {
// reporting notice during ARC setup. // reporting notice during ARC setup.
return; return;
} }
if (consent && initial_sync &&
profile_->GetPrefs()->GetBoolean(prefs::kArcSkippedReportingNotice)) {
// Explicitly leave reporting off for users who did not get a reporting
// notice during setup, but otherwise would have reporting on due to the
// result of |IsArcStatsReportingEnabled()| during setup. Typically this is
// due to the fact that ArcSessionManager was able to skip the setup UI for
// managed users.
consent = false;
}
base::DictionaryValue extras; base::DictionaryValue extras;
extras.SetBoolean("reportingConsent", consent); extras.SetBoolean("reportingConsent", consent);
SendSettingsBroadcast("org.chromium.arc.intent_helper.SET_REPORTING_CONSENT", SendSettingsBroadcast("org.chromium.arc.intent_helper.SET_REPORTING_CONSENT",
......
...@@ -70,6 +70,9 @@ const char kArcSetNotificationsEnabledDeferred[] = ...@@ -70,6 +70,9 @@ const char kArcSetNotificationsEnabledDeferred[] =
"arc.set_notifications_enabled_deferred"; "arc.set_notifications_enabled_deferred";
// A preference that indicates status of Android sign-in. // A preference that indicates status of Android sign-in.
const char kArcSignedIn[] = "arc.signedin"; const char kArcSignedIn[] = "arc.signedin";
// A preference that indicates that ARC skipped the setup UI flows that
// contain a notice related to reporting of diagnostic information.
const char kArcSkippedReportingNotice[] = "arc.skipped.reporting.notice";
// A preference that indicates an ARC comaptible filesystem was chosen for // A preference that indicates an ARC comaptible filesystem was chosen for
// the user directory (i.e., the user finished required migration.) // the user directory (i.e., the user finished required migration.)
const char kArcCompatibleFilesystemChosen[] = const char kArcCompatibleFilesystemChosen[] =
...@@ -125,6 +128,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { ...@@ -125,6 +128,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterListPref(kArcFastAppReinstallPackages); registry->RegisterListPref(kArcFastAppReinstallPackages);
registry->RegisterBooleanPref(kArcPolicyComplianceReported, false); registry->RegisterBooleanPref(kArcPolicyComplianceReported, false);
registry->RegisterBooleanPref(kArcSignedIn, false); registry->RegisterBooleanPref(kArcSignedIn, false);
registry->RegisterBooleanPref(kArcSkippedReportingNotice, false);
registry->RegisterBooleanPref(kArcTermsAccepted, false); registry->RegisterBooleanPref(kArcTermsAccepted, false);
registry->RegisterBooleanPref(kArcTermsShownInOobe, false); registry->RegisterBooleanPref(kArcTermsShownInOobe, false);
registry->RegisterBooleanPref(kArcVoiceInteractionValuePropAccepted, false); registry->RegisterBooleanPref(kArcVoiceInteractionValuePropAccepted, false);
......
...@@ -31,6 +31,7 @@ ARC_EXPORT extern const char kArcPushInstallAppsRequested[]; ...@@ -31,6 +31,7 @@ ARC_EXPORT extern const char kArcPushInstallAppsRequested[];
ARC_EXPORT extern const char kArcPushInstallAppsPending[]; ARC_EXPORT extern const char kArcPushInstallAppsPending[];
ARC_EXPORT extern const char kArcSetNotificationsEnabledDeferred[]; ARC_EXPORT extern const char kArcSetNotificationsEnabledDeferred[];
ARC_EXPORT extern const char kArcSignedIn[]; ARC_EXPORT extern const char kArcSignedIn[];
ARC_EXPORT extern const char kArcSkippedReportingNotice[];
ARC_EXPORT extern const char kArcSupervisionTransition[]; ARC_EXPORT extern const char kArcSupervisionTransition[];
ARC_EXPORT extern const char kArcCompatibleFilesystemChosen[]; ARC_EXPORT extern const char kArcCompatibleFilesystemChosen[];
ARC_EXPORT extern const char kArcVoiceInteractionValuePropAccepted[]; ARC_EXPORT extern const char kArcVoiceInteractionValuePropAccepted[];
......
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