Commit 9c9a90f9 authored by John Heroy's avatar John Heroy Committed by Commit Bot

Sync 'false' prefs value for multidevice if feature flag is not enabled.

This change ensures that the ARC user preference for SMS Connect is false
if the feature flag is disabled, and the user-set preference (default: true)
when the feature flag is enabled.

Bug: 718617
Change-Id: I8389cf0082b29c3356d760acf44c83d8b8cf0848
Reviewed-on: https://chromium-review.googlesource.com/726322Reviewed-by: default avatarDavid Jacobo <djacobo@chromium.org>
Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
Commit-Queue: John Heroy <jheroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510105}
parent 3bb8abd4
......@@ -8,6 +8,7 @@
#include "ash/public/cpp/ash_pref_names.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/gtest_prod_util.h"
#include "base/json/json_writer.h"
#include "base/memory/singleton.h"
......@@ -16,6 +17,7 @@
#include "chrome/browser/chromeos/arc/arc_session_manager.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/network/network_handler.h"
......@@ -540,9 +542,19 @@ void ArcSettingsServiceImpl::SyncSelectToSpeakEnabled() const {
}
void ArcSettingsServiceImpl::SyncSmsConnectEnabled() const {
SendBoolPrefSettingsBroadcast(
prefs::kSmsConnectEnabled,
"org.chromium.arc.intent_helper.SET_SMS_CONNECT_ENABLED");
// Only sync the preferences value if the feature flag is enabled, otherwise
// sync a 'false' value.
std::string action =
std::string("org.chromium.arc.intent_helper.SET_SMS_CONNECT_ENABLED");
if (!base::FeatureList::IsEnabled(features::kMultidevice)) {
const PrefService::Preference* pref =
registrar_.prefs()->FindPreference(prefs::kSmsConnectEnabled);
DCHECK(pref);
SendBoolValueSettingsBroadcast(false, pref->IsManaged(), action);
return;
}
SendBoolPrefSettingsBroadcast(prefs::kSmsConnectEnabled, action);
}
void ArcSettingsServiceImpl::SyncSpokenFeedbackEnabled() const {
......
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