Install/Uninstall Screen AI library based on usage.
Screen AI library component or DLC was installed or uninstalled based on
feature flags. This would result in downloading the library for all
users once the flags are enabled by default.
To change the behavior, each time the library is used, a pref is saved
which indicates the last used time, and the library is kept on disk and updated for 30 days after the last used time.
AX-Relnotes: n/a
Bug: 1278249
Change-Id: I23b230c0bea8a49f5138f7738dddb736929cac90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4545761
Commit-Queue: Ramin Halavati <[email protected]>
Reviewed-by: David Tseng <[email protected]>
Reviewed-by: Dominic Battre <[email protected]>
Reviewed-by: David Roger <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1147840}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 2bc5695..9aa9afc 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -842,6 +842,12 @@
const char kSamlPasswordSyncToken[] = "saml.password_sync_token";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+// Deprecated 05/2023.
+#if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
+const char kScreenAIScheduledDeletionTimePrefName[] =
+ "accessibility.screen_ai.scheduled_deletion_time";
+#endif
+
// Register local state used only for migration (clearing or moving to a new
// key).
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -940,6 +946,12 @@
// Deprecated 05/2023.
registry->RegisterBooleanPref(kPPAPISharedImagesSwapChainAllowed, true);
+
+// Deprecated 05/2023.
+#if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
+ registry->RegisterTimePref(kScreenAIScheduledDeletionTimePrefName,
+ base::Time());
+#endif
}
// Register prefs used only for migration (clearing or moving to a new key).
@@ -1946,6 +1958,11 @@
// Added 05/2023
local_state->ClearPref(kPPAPISharedImagesSwapChainAllowed);
+// Added 05/2023.
+#if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
+ local_state->ClearPref(kScreenAIScheduledDeletionTimePrefName);
+#endif
+
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS