Commit 94902d17 authored by Jordy Greenblatt's avatar Jordy Greenblatt Committed by Commit Bot

[CrOS MultiDevice] Migrate Android Messages pref to multidevice prefs

The new unified setup project for multi device features involved
consolidating the infrastructure for all the existing features (Instant
Tethering, SmartLock) as well as the infrastructure for features that
are not fully built (Android Messages).

-------

This is a screenshot of the console showing the pref
https://drive.google.com/open?id=0B1-cJJPK-cu6OGxTQnNLMEFHWDhibXJOSVJwclBoVGlFRF84

Change-Id: I7cedd5c9b7608ddea4f3914b1c0eb11f1ea1c7d3
Bug: 824568
Reviewed-on: https://chromium-review.googlesource.com/1154032Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarBernhard Bauer <bauerb@chromium.org>
Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
Reviewed-by: default avatarLuis Hector Chavez <lhchavez@chromium.org>
Commit-Queue: Jordy Greenblatt <jordynass@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579168}
parent 7ed165b5
......@@ -476,8 +476,10 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() {
settings_api::PrefType::PREF_TYPE_NUMBER;
// Multidevice settings.
(*s_whitelist)[chromeos::multidevice_setup::kSuiteEnabledPrefName] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)
[chromeos::multidevice_setup::kMultiDeviceSuiteEnabledPrefName] =
[chromeos::multidevice_setup::kAndroidMessagesFeatureEnabledPrefName] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Native Printing settings.
......
......@@ -759,7 +759,7 @@ const char* incognito_whitelist[] = {
arc::prefs::kArcSupervisionTransition,
arc::prefs::kArcCompatibleFilesystemChosen,
arc::prefs::kArcVoiceInteractionValuePropAccepted,
arc::prefs::kEcryptfsMigrationStrategy, arc::prefs::kSmsConnectEnabled,
arc::prefs::kEcryptfsMigrationStrategy,
arc::prefs::kVoiceInteractionEnabled,
arc::prefs::kVoiceInteractionContextEnabled,
arc::prefs::kVoiceInteractionHotwordEnabled,
......
......@@ -32,7 +32,7 @@
<div id="multidevice-label">[[getLabelText_(pageContentData)]]</div>
<div class="secondary" id="mutltideviceSubLabel" inner-h-t-m-l=
"[[getSubLabelInnerHtml_(pageContentData,
prefs.multidevice_setup.enable_feature_suite.value)]]">
prefs.multidevice_setup.suite_enabled.value)]]">
</div>
</div>
<template is="dom-if"
......@@ -51,7 +51,7 @@
</template>
<template is="dom-if" if="[[showToggle_(pageContentData)]]" restamp>
<settings-multidevice-feature-toggle
pref="{{prefs.multidevice_setup.enable_feature_suite}}">
pref="{{prefs.multidevice_setup.suite_enabled}}">
</settings-multidevice-feature-toggle>
</template>
</div>
......
......@@ -73,7 +73,7 @@ Polymer({
case settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_VERIFICATION:
return this.i18nAdvanced('multideviceVerificationText');
default:
return this.getPref('multidevice_setup.enable_feature_suite').value ?
return this.getPref('multidevice_setup.suite_enabled').value ?
this.i18n('multideviceEnabled') :
this.i18n('multideviceDisabled');
}
......
......@@ -25,12 +25,11 @@
</style>
<div class="settings-box first">
<div id="status-text-container" class="start"
enabled$=
"[[prefs.multidevice_setup.enable_feature_suite.value]]">
[[getStatusText_(prefs.multidevice_setup.enable_feature_suite.value)]]
enabled$="[[prefs.multidevice_setup.suite_enabled.value]]">
[[getStatusText_(prefs.multidevice_setup.suite_enabled.value)]]
</div>
<settings-multidevice-feature-toggle
pref="{{prefs.multidevice_setup.enable_feature_suite}}">
pref="{{prefs.multidevice_setup.suite_enabled}}">
</settings-multidevice-feature-toggle>
</div>
<template is="dom-if"
......@@ -46,7 +45,7 @@
controlling Easy Unlock and make sure it's effectively
password protected. -->
<settings-multidevice-feature-toggle
pref="{{prefs.multidevice_setup.enable_feature_suite}}">
pref="{{prefs.multidevice_setup.suite_enabled}}">
</settings-multidevice-feature-toggle>
</div>
</settings-multidevice-feature-item>
......
......@@ -45,7 +45,7 @@ Polymer({
* @private
*/
getStatusText_: function() {
return this.getPref('multidevice_setup.enable_feature_suite').value ?
return this.getPref('multidevice_setup.suite_enabled').value ?
this.i18n('multideviceEnabled') :
this.i18n('multideviceDisabled');
},
......
......@@ -10,11 +10,27 @@ namespace chromeos {
namespace multidevice_setup {
const char kMultiDeviceSuiteEnabledPrefName[] =
"multidevice_setup.enable_feature_suite";
// Note that the pref names have slightly inconsistent naming conventions
// because some were named before the unified MultiDeviceSetup project and we
// wanted to avoid changing the internal names of existing prefs. The general
// naming pattern for each individual feature enabling pref moving forward
// should be of the form
// const char k[FeatureName]FeatureEnabledPrefName =
// "multidevice_setup.[feature_name]_enabled";
// This pref is a gatekeeper for all MultiDevice features (e.g. Easy Unlock,
// Instant Tethering). Setting the pref to 'true' is necessary but not
// sufficient to enable the individual features, which are each controlled by
// their own pref and may involve additional setup steps.
const char kSuiteEnabledPrefName[] = "multidevice_setup.suite_enabled";
// Individual feature prefs.
const char kAndroidMessagesFeatureEnabledPrefName[] =
"multidevice.sms_connect_enabled";
void RegisterFeaturePrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(kMultiDeviceSuiteEnabledPrefName, false);
registry->RegisterBooleanPref(kSuiteEnabledPrefName, false);
registry->RegisterBooleanPref(kAndroidMessagesFeatureEnabledPrefName, false);
}
} // namespace multidevice_setup
......
......@@ -11,11 +11,8 @@ namespace chromeos {
namespace multidevice_setup {
// This pref is a gatekeeper for all MultiDevice features (e.g. Easy Unlock,
// Instant Tethering). Setting the pref to 'true' is necessary but not
// sufficient to enable the individual features, which are each controlled by
// their own pref and may involve additional setup steps.
extern const char kMultiDeviceSuiteEnabledPrefName[];
extern const char kSuiteEnabledPrefName[];
extern const char kAndroidMessagesFeatureEnabledPrefName[];
void RegisterFeaturePrefs(PrefRegistrySimple* registry);
......
......@@ -89,9 +89,6 @@ const char kArcVoiceInteractionValuePropAccepted[] =
// Integer pref indicating the ecryptfs to ext4 migration strategy. One of
// options: forbidden = 0, migrate = 1, wipe = 2 or ask the user = 3.
const char kEcryptfsMigrationStrategy[] = "ecryptfs_migration_strategy";
// A preference that indicates whether the SMS Connect feature is enabled.
const char kSmsConnectEnabled[] = "multidevice.sms_connect_enabled";
// A preference that indicates the user has accepted voice interaction activity
// control settings.
const char kVoiceInteractionActivityControlAccepted[] =
......@@ -147,7 +144,6 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(kArcTermsAccepted, false);
registry->RegisterBooleanPref(kArcTermsShownInOobe, false);
registry->RegisterBooleanPref(kArcVoiceInteractionValuePropAccepted, false);
registry->RegisterBooleanPref(kSmsConnectEnabled, true);
registry->RegisterBooleanPref(kVoiceInteractionContextEnabled, false);
registry->RegisterBooleanPref(kVoiceInteractionEnabled, false);
registry->RegisterBooleanPref(kVoiceInteractionHotwordEnabled, false);
......
......@@ -38,7 +38,6 @@ ARC_EXPORT extern const char kArcSupervisionTransition[];
ARC_EXPORT extern const char kArcCompatibleFilesystemChosen[];
ARC_EXPORT extern const char kArcVoiceInteractionValuePropAccepted[];
ARC_EXPORT extern const char kEcryptfsMigrationStrategy[];
ARC_EXPORT extern const char kSmsConnectEnabled[];
// TODO(b/110211045): Move Assistant related prefs to ash.
ARC_EXPORT extern const char kVoiceInteractionActivityControlAccepted[];
......
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