Commit b191d8c5 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Wallet on Android: Require initial Sync setup to be complete

Bug: 1113713
Change-Id: I60253242c830519186f9513caf4f93737c6f990f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343025Reviewed-by: default avatarJared Saul <jsaul@google.com>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796313}
parent 190edfe4
...@@ -8,10 +8,12 @@ ...@@ -8,10 +8,12 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
#include "build/build_config.h"
#include "components/autofill/core/common/autofill_prefs.h" #include "components/autofill/core/common/autofill_prefs.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/sync/driver/sync_auth_util.h" #include "components/sync/driver/sync_auth_util.h"
#include "components/sync/driver/sync_service.h" #include "components/sync/driver/sync_service.h"
#include "components/sync/driver/sync_user_settings.h"
#include "google_apis/gaia/google_service_auth_error.h" #include "google_apis/gaia/google_service_auth_error.h"
namespace browser_sync { namespace browser_sync {
...@@ -87,6 +89,12 @@ AutofillWalletModelTypeController::GetPreconditionState() const { ...@@ -87,6 +89,12 @@ AutofillWalletModelTypeController::GetPreconditionState() const {
autofill::prefs::kAutofillWalletImportEnabled) && autofill::prefs::kAutofillWalletImportEnabled) &&
pref_service_->GetBoolean(autofill::prefs::kAutofillCreditCardEnabled) && pref_service_->GetBoolean(autofill::prefs::kAutofillCreditCardEnabled) &&
!sync_service_->GetAuthError().IsPersistentError(); !sync_service_->GetAuthError().IsPersistentError();
#if defined(OS_ANDROID)
// On Android, it's also required that the initial Sync setup is complete
// (i.e. the user has previously opted in to Sync-the-feature, even if it's
// not enabled right now).
preconditions_met &= sync_service_->GetUserSettings()->IsFirstSetupComplete();
#endif
return preconditions_met ? PreconditionState::kPreconditionsMet return preconditions_met ? PreconditionState::kPreconditionsMet
: PreconditionState::kMustStopAndClearData; : PreconditionState::kMustStopAndClearData;
} }
......
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