Index: sync/internal_api/sync_manager_impl.cc |
diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc |
index 1a26fe048f9e196b8dc6e762637b0a06b43bb2a3..32b5b9ec91450c7a11752225e7d189d05b91ce5c 100644 |
--- a/sync/internal_api/sync_manager_impl.cc |
+++ b/sync/internal_api/sync_manager_impl.cc |
@@ -185,6 +185,7 @@ class SyncManagerImpl::SyncInternal |
const SyncCredentials& credentials, |
scoped_ptr<syncer::SyncNotifier> sync_notifier, |
const std::string& restored_key_for_bootstrapping, |
+ bool keystore_encryption_enabled, |
SyncManager::TestingMode testing_mode, |
Encryptor* encryptor, |
UnrecoverableErrorHandler* unrecoverable_error_handler, |
@@ -722,6 +723,7 @@ bool SyncManagerImpl::Init( |
const SyncCredentials& credentials, |
scoped_ptr<syncer::SyncNotifier> sync_notifier, |
const std::string& restored_key_for_bootstrapping, |
+ bool keystore_encryption_enabled, |
SyncManager::TestingMode testing_mode, |
Encryptor* encryptor, |
UnrecoverableErrorHandler* unrecoverable_error_handler, |
@@ -744,6 +746,7 @@ bool SyncManagerImpl::Init( |
credentials, |
sync_notifier.Pass(), |
restored_key_for_bootstrapping, |
+ keystore_encryption_enabled, |
testing_mode, |
encryptor, |
unrecoverable_error_handler, |
@@ -852,6 +855,15 @@ void SyncManagerImpl::ConfigureSyncer( |
// encryption key or not (requires opening a transaction). crbug.com/129665. |
ConfigurationParams::KeystoreKeyStatus keystore_key_status = |
ConfigurationParams::KEYSTORE_KEY_UNNECESSARY; |
+ if (data_->session_context() && |
+ data_->session_context()->keystore_encryption_enabled()) { |
+ ReadTransaction trans(FROM_HERE, GetUserShare()); |
+ Cryptographer* cryptographer = trans.GetCryptographer(); |
+ keystore_key_status = |
+ (cryptographer->HasKeystoreKey() ? |
+ ConfigurationParams::KEYSTORE_KEY_UNNECESSARY : |
+ ConfigurationParams::KEYSTORE_KEY_NEEDED); |
+ } |
ConfigurationParams params(GetSourceFromReason(reason), |
types_to_config, |
@@ -888,6 +900,7 @@ bool SyncManagerImpl::SyncInternal::Init( |
const SyncCredentials& credentials, |
scoped_ptr<syncer::SyncNotifier> sync_notifier, |
const std::string& restored_key_for_bootstrapping, |
+ bool keystore_encryption_enabled, |
SyncManager::TestingMode testing_mode, |
Encryptor* encryptor, |
UnrecoverableErrorHandler* unrecoverable_error_handler, |
@@ -962,7 +975,8 @@ bool SyncManagerImpl::SyncInternal::Init( |
&throttled_data_type_tracker_, |
listeners, |
&debug_info_event_listener_, |
- &traffic_recorder_)); |
+ &traffic_recorder_, |
+ keystore_encryption_enabled)); |
session_context()->set_account_name(credentials.email); |
scheduler_.reset(new SyncScheduler(name_, session_context(), new Syncer())); |
} |