[SmartLock] Delete ProximityAuthLocalStatePrefManager
Now that sign in with Smart Lock is deprecated, we no longer need to
access any Smart Lock prefs outside of a user profile. This cl removes
Smart Lock local state prefs and the ProximityAuthLocalStatePrefManager.
TEST=existing unittests pass, manually tested Smart Lock with strongbad
and pixel4a.
Change-Id: I364801111bc8260fc0f7cb1b3225fcea77781644
Bug: b/227674947
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4335758
Reviewed-by: Tommy Nyquist <[email protected]>
Reviewed-by: Ryan Hansberry <[email protected]>
Commit-Queue: Brittany Hartmire <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1117868}
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_service.cc b/chrome/browser/ash/login/easy_unlock/easy_unlock_service.cc
index e758b12..e9a3dc6 100644
--- a/chrome/browser/ash/login/easy_unlock/easy_unlock_service.cc
+++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_service.cc
@@ -34,7 +34,6 @@
#include "chromeos/ash/components/dbus/dbus_thread_manager.h"
#include "chromeos/ash/components/login/auth/public/user_context.h"
#include "chromeos/ash/components/multidevice/logging/logging.h"
-#include "chromeos/ash/components/proximity_auth/proximity_auth_local_state_pref_manager.h"
#include "chromeos/ash/components/proximity_auth/proximity_auth_profile_pref_manager.h"
#include "chromeos/ash/components/proximity_auth/proximity_auth_system.h"
#include "chromeos/ash/components/proximity_auth/screenlock_bridge.h"
@@ -146,7 +145,6 @@
// static
void EasyUnlockService::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterDictionaryPref(prefs::kEasyUnlockHardlockState);
- proximity_auth::ProximityAuthLocalStatePrefManager::RegisterPrefs(registry);
}
// static
@@ -158,8 +156,7 @@
return;
for (const std::string& pref :
- std::vector<std::string>{prefs::kEasyUnlockHardlockState,
- prefs::kEasyUnlockLocalStateUserPrefs}) {
+ std::vector<std::string>{prefs::kEasyUnlockHardlockState}) {
ScopedDictPrefUpdate update(local_state, pref);
update->Remove(account_id.GetUserEmail());
}
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_service.h b/chrome/browser/ash/login/easy_unlock/easy_unlock_service.h
index 17b19768..12b9f9f1 100644
--- a/chrome/browser/ash/login/easy_unlock/easy_unlock_service.h
+++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_service.h
@@ -63,6 +63,7 @@
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
// Registers Easy Unlock local state entries.
+ // TODO(b/227674947): Delete
static void RegisterPrefs(PrefRegistrySimple* registry);
// Removes the hardlock state for the given user.
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular.cc b/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular.cc
index bfc62c6b..e31ec35d 100644
--- a/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular.cc
+++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_service_regular.cc
@@ -186,8 +186,6 @@
pref_manager_ =
std::make_unique<proximity_auth::ProximityAuthProfilePrefManager>(
profile()->GetPrefs(), multidevice_setup_client_);
- pref_manager_->StartSyncingToLocalState(g_browser_process->local_state(),
- GetAccountId());
// If `device_sync_client_` is not ready yet, wait for it to call back on
// OnReady().
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 2aeb117f..3826c517 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -818,6 +818,11 @@
"ash.signout_screenshot.duration";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+// Deprecated 03/2023.
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+const char kEasyUnlockLocalStateUserPrefs[] = "easy_unlock.user_prefs";
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
// Register local state used only for migration (clearing or moving to a new
// key).
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -910,6 +915,11 @@
registry->RegisterTimeDeltaPref(kGlanceablesSignoutScreenshotDuration,
base::TimeDelta());
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+// Deprecated 03/2023.
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+ registry->RegisterDictionaryPref(kEasyUnlockLocalStateUserPrefs);
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
// Register prefs used only for migration (clearing or moving to a new key).
@@ -1882,6 +1892,11 @@
local_state->ClearPref(kGlanceablesSignoutScreenshotDuration);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+// Added 03/2023.
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+ local_state->ClearPref(kEasyUnlockLocalStateUserPrefs);
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS