Remove DownloadLaterPromptStatus prefs
DownloadLater dialog is not launched, so remove the prefs.
Bug: 1337109
Change-Id: I316cd1527ff1314aa851b0dbdb21ff61ca7a820f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3733069
Reviewed-by: Lei Zhang <[email protected]>
Commit-Queue: Min Qin <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1019366}
diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadDialogBridge.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadDialogBridge.java
index e8d18b5..57f262ae 100644
--- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadDialogBridge.java
+++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadDialogBridge.java
@@ -227,13 +227,10 @@
private void showDownloadLaterDialog() {
assert mPrefService != null;
- @DownloadLaterPromptStatus
- int promptStatus = mPrefService.getInteger(Pref.DOWNLOAD_LATER_PROMPT_STATUS);
PropertyModel.Builder builder =
new PropertyModel.Builder(DownloadLaterDialogProperties.ALL_KEYS)
.with(DownloadLaterDialogProperties.CONTROLLER, mDownloadLaterDialog)
.with(DownloadLaterDialogProperties.INITIAL_CHOICE, mDownloadLaterChoice)
- .with(DownloadLaterDialogProperties.DONT_SHOW_AGAIN_SELECTION, promptStatus)
.with(DownloadLaterDialogProperties.SUBTITLE_TEXT,
getDownloadLaterDialogSubtitle())
.with(DownloadLaterDialogProperties.SHOW_DATE_TIME_PICKER_OPTION,
diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadDialogBridgeUnitTest.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadDialogBridgeUnitTest.java
index 21f13fd4..86d6f7aa 100644
--- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadDialogBridgeUnitTest.java
+++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadDialogBridgeUnitTest.java
@@ -40,7 +40,6 @@
import org.chromium.chrome.browser.download.dialogs.DownloadLaterDialogProperties;
import org.chromium.chrome.browser.download.dialogs.DownloadLocationDialogCoordinator;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
-import org.chromium.chrome.browser.preferences.Pref;
import org.chromium.chrome.test.util.browser.Features;
import org.chromium.components.prefs.PrefService;
import org.chromium.net.ConnectionType;
@@ -107,8 +106,6 @@
mBridge =
new DownloadDialogBridge(FAKE_NATIVE_HOLDER, mDownloadLaterDialog, mLocationDialog);
mBridge.setPrefServiceForTesting(mPrefService);
- when(mPrefService.getInteger(Pref.DOWNLOAD_LATER_PROMPT_STATUS))
- .thenReturn(DownloadLaterPromptStatus.SHOW_INITIAL);
}
@After
diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogCoordinator.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogCoordinator.java
index d05b2f9..82c2e6eb 100644
--- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogCoordinator.java
+++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogCoordinator.java
@@ -13,7 +13,6 @@
import org.chromium.chrome.browser.download.DownloadLaterMetrics.DownloadLaterUiEvent;
import org.chromium.chrome.browser.download.R;
import org.chromium.chrome.browser.download.dialogs.DownloadDateTimePickerDialogProperties.State;
-import org.chromium.chrome.browser.preferences.Pref;
import org.chromium.components.prefs.PrefService;
import org.chromium.ui.modaldialog.DialogDismissalCause;
import org.chromium.ui.modaldialog.ModalDialogManager;
@@ -173,26 +172,14 @@
private void notifyComplete(long time) {
assert mController != null;
- maybeUpdatePromptStatus();
mController.onDownloadLaterDialogComplete(mDownloadLaterChoice, time);
}
private void notifyCancel() {
assert mController != null;
- maybeUpdatePromptStatus();
mController.onDownloadLaterDialogCanceled();
}
- private void maybeUpdatePromptStatus() {
- assert mCustomView != null;
- assert mPrefService != null;
- Integer promptStatus = mCustomView.getPromptStatus();
- if (promptStatus != null) {
- mPrefService.setInteger(
- Pref.DOWNLOAD_LATER_PROMPT_STATUS, mCustomView.getPromptStatus());
- }
- }
-
// ModalDialogProperties.Controller implementation.
@Override
public void onClick(PropertyModel model, int buttonType) {
diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogView.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogView.java
index c8356204..32ea5f0 100644
--- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogView.java
+++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLaterDialogView.java
@@ -22,7 +22,6 @@
import androidx.annotation.Nullable;
-import org.chromium.chrome.browser.download.DownloadLaterPromptStatus;
import org.chromium.chrome.browser.download.R;
import org.chromium.components.browser_ui.widget.RadioButtonWithDescription;
import org.chromium.ui.modelutil.PropertyKey;
@@ -55,9 +54,6 @@
view.setController(model.get(DownloadLaterDialogProperties.CONTROLLER));
} else if (propertyKey == DownloadLaterDialogProperties.INITIAL_CHOICE) {
view.setChoice(model.get(DownloadLaterDialogProperties.INITIAL_CHOICE));
- } else if (propertyKey == DownloadLaterDialogProperties.DONT_SHOW_AGAIN_SELECTION) {
- view.setCheckbox(
- model.get(DownloadLaterDialogProperties.DONT_SHOW_AGAIN_SELECTION));
} else if (propertyKey == DownloadLaterDialogProperties.DONT_SHOW_AGAIN_DISABLED) {
view.setCheckboxEnabled(
!model.get(DownloadLaterDialogProperties.DONT_SHOW_AGAIN_DISABLED));
@@ -131,22 +127,10 @@
mDownloadLater.setVisibility(showDateTimePicker ? View.VISIBLE : View.GONE);
}
- void setCheckbox(@DownloadLaterPromptStatus int promptStatus) {
- mCheckBox.setVisibility(VISIBLE);
- mCheckBox.setChecked(promptStatus == DownloadLaterPromptStatus.DONT_SHOW);
- }
-
void setCheckboxEnabled(boolean enabled) {
mCheckBox.setEnabled(enabled);
}
- Integer getPromptStatus() {
- if (mCheckBox.getVisibility() == View.GONE || !mCheckBox.isEnabled()) return null;
-
- return mCheckBox.isChecked() ? DownloadLaterPromptStatus.DONT_SHOW
- : DownloadLaterPromptStatus.SHOW_PREFERENCE;
- }
-
void setSubtitle(@Nullable CharSequence subtitle) {
mSubtitle.setText(TextUtils.isEmpty(subtitle) ? "" : subtitle);
}
diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/settings/DownloadSettings.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/settings/DownloadSettings.java
index 70297fa..f0dcbd0 100644
--- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/settings/DownloadSettings.java
+++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/settings/DownloadSettings.java
@@ -12,11 +12,8 @@
import androidx.preference.PreferenceFragmentCompat;
import org.chromium.chrome.browser.download.DownloadDialogBridge;
-import org.chromium.chrome.browser.download.DownloadLaterPromptStatus;
import org.chromium.chrome.browser.download.DownloadPromptStatus;
import org.chromium.chrome.browser.download.R;
-import org.chromium.chrome.browser.flags.ChromeFeatureList;
-import org.chromium.chrome.browser.preferences.Pref;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate;
import org.chromium.components.browser_ui.settings.ChromeSwitchPreference;
@@ -31,12 +28,10 @@
public class DownloadSettings
extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener {
public static final String PREF_LOCATION_CHANGE = "location_change";
- public static final String PREF_DOWNLOAD_LATER_PROMPT_ENABLED = "download_later_prompt_enabled";
public static final String PREF_LOCATION_PROMPT_ENABLED = "location_prompt_enabled";
private PrefService mPrefService;
private DownloadLocationPreference mLocationChangePref;
- private ChromeSwitchPreference mDownloadLaterPromptEnabledPref;
private ChromeSwitchPreference mLocationPromptEnabledPref;
private ManagedPreferenceDelegate mLocationPromptEnabledPrefDelegate;
@@ -46,15 +41,7 @@
SettingsUtils.addPreferencesFromResource(this, R.xml.download_preferences);
mPrefService = UserPrefs.get(Profile.getLastUsedRegularProfile());
- mDownloadLaterPromptEnabledPref =
- (ChromeSwitchPreference) findPreference(PREF_DOWNLOAD_LATER_PROMPT_ENABLED);
- mDownloadLaterPromptEnabledPref.setOnPreferenceChangeListener(this);
-
boolean locationManaged = DownloadDialogBridge.isLocationDialogManaged();
- if (locationManaged || !ChromeFeatureList.isEnabled(ChromeFeatureList.DOWNLOAD_LATER)) {
- getPreferenceScreen().removePreference(
- findPreference(PREF_DOWNLOAD_LATER_PROMPT_ENABLED));
- }
mLocationPromptEnabledPref =
(ChromeSwitchPreference) findPreference(PREF_LOCATION_PROMPT_ENABLED);
@@ -91,14 +78,6 @@
private void updateDownloadSettings() {
mLocationChangePref.updateSummary();
- if (ChromeFeatureList.isEnabled(ChromeFeatureList.DOWNLOAD_LATER)) {
- @DownloadLaterPromptStatus
- int downloadLaterPromptStatus =
- mPrefService.getInteger(Pref.DOWNLOAD_LATER_PROMPT_STATUS);
- mDownloadLaterPromptEnabledPref.setChecked(
- !(downloadLaterPromptStatus == DownloadLaterPromptStatus.DONT_SHOW));
- }
-
if (DownloadDialogBridge.isLocationDialogManaged()) {
// Location prompt can be controlled by the enterprise policy.
mLocationPromptEnabledPref.setChecked(
@@ -115,23 +94,7 @@
// Preference.OnPreferenceChangeListener implementation.
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
- if (PREF_DOWNLOAD_LATER_PROMPT_ENABLED.equals(preference.getKey())) {
- if (!ChromeFeatureList.isEnabled(ChromeFeatureList.DOWNLOAD_LATER)) return false;
- @DownloadLaterPromptStatus
- int downloadLaterPromptStatus =
- mPrefService.getInteger(Pref.DOWNLOAD_LATER_PROMPT_STATUS);
- if (!(boolean) newValue) {
- mPrefService.setInteger(
- Pref.DOWNLOAD_LATER_PROMPT_STATUS, DownloadLaterPromptStatus.DONT_SHOW);
- return true;
- }
-
- // Only update if the download later dialog has been shown before.
- if (downloadLaterPromptStatus != DownloadLaterPromptStatus.SHOW_INITIAL) {
- mPrefService.setInteger(Pref.DOWNLOAD_LATER_PROMPT_STATUS,
- DownloadLaterPromptStatus.SHOW_PREFERENCE);
- }
- } else if (PREF_LOCATION_PROMPT_ENABLED.equals(preference.getKey())) {
+ if (PREF_LOCATION_PROMPT_ENABLED.equals(preference.getKey())) {
if ((boolean) newValue) {
// Only update if the download location dialog has been shown before.
if (DownloadDialogBridge.getPromptForDownloadAndroid()
diff --git a/chrome/browser/download/chrome_download_manager_delegate_unittest.cc b/chrome/browser/download/chrome_download_manager_delegate_unittest.cc
index 3fe5e62..e1b010a 100644
--- a/chrome/browser/download/chrome_download_manager_delegate_unittest.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate_unittest.cc
@@ -331,12 +331,6 @@
#if BUILDFLAG(IS_ANDROID)
pref_service_->SetInteger(prefs::kPromptForDownloadAndroid,
static_cast<int>(DownloadPromptStatus::DONT_SHOW));
-
- if (base::FeatureList::IsEnabled(download::features::kDownloadLater)) {
- pref_service_->SetInteger(
- prefs::kDownloadLaterPromptStatus,
- static_cast<int>(DownloadLaterPromptStatus::kDontShow));
- }
#endif
}
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc
index 06698e1..5bf18835 100644
--- a/chrome/browser/download/download_prefs.cc
+++ b/chrome/browser/download/download_prefs.cc
@@ -202,12 +202,6 @@
prompt_for_download_android_.Init(prefs::kPromptForDownloadAndroid, prefs);
RecordDownloadPromptStatus(
static_cast<DownloadPromptStatus>(*prompt_for_download_android_));
- if (base::FeatureList::IsEnabled(download::features::kDownloadLater)) {
- prompt_for_download_later_.Init(prefs::kDownloadLaterPromptStatus, prefs);
- RecordDownloadLaterPromptStatus(
- static_cast<DownloadLaterPromptStatus>(*prompt_for_download_later_));
- }
-
#endif
download_path_.Init(prefs::kDownloadDefaultDirectory, prefs);
save_file_path_.Init(prefs::kSaveFileDefaultDirectory, prefs);
@@ -309,13 +303,6 @@
static_cast<int>(download_prompt_status),
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
- if (base::FeatureList::IsEnabled(download::features::kDownloadLater)) {
- registry->RegisterIntegerPref(
- prefs::kDownloadLaterPromptStatus,
- static_cast<int>(DownloadLaterPromptStatus::kShowInitial),
- user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
- }
-
registry->RegisterBooleanPref(prefs::kShowMissingSdCardErrorAndroid, true);
#endif
}
@@ -410,27 +397,10 @@
}
bool DownloadPrefs::PromptDownloadLater() const {
-#if BUILDFLAG(IS_ANDROID)
- if (prompt_for_download_.IsManaged())
- return false;
-
- if (base::FeatureList::IsEnabled(download::features::kDownloadLater)) {
- return *prompt_for_download_later_ !=
- static_cast<int>(DownloadLaterPromptStatus::kDontShow);
- }
-#endif
-
return false;
}
bool DownloadPrefs::HasDownloadLaterPromptShown() const {
-#if BUILDFLAG(IS_ANDROID)
- if (base::FeatureList::IsEnabled(download::features::kDownloadLater)) {
- return *prompt_for_download_later_ !=
- static_cast<int>(DownloadLaterPromptStatus::kShowInitial);
- }
-#endif
-
return false;
}
diff --git a/chrome/browser/download/download_prefs.h b/chrome/browser/download/download_prefs.h
index 3be27e2..d8c3ce0 100644
--- a/chrome/browser/download/download_prefs.h
+++ b/chrome/browser/download/download_prefs.h
@@ -158,7 +158,6 @@
BooleanPrefMember prompt_for_download_;
#if BUILDFLAG(IS_ANDROID)
IntegerPrefMember prompt_for_download_android_;
- IntegerPrefMember prompt_for_download_later_;
#endif
FilePathPrefMember download_path_;
diff --git a/chrome/browser/download/download_prefs_unittest.cc b/chrome/browser/download/download_prefs_unittest.cc
index 39b00ee..14726e00 100644
--- a/chrome/browser/download/download_prefs_unittest.cc
+++ b/chrome/browser/download/download_prefs_unittest.cc
@@ -60,11 +60,6 @@
content::BrowserTaskEnvironment task_environment_;
base::HistogramTester histogram_tester;
-#if BUILDFLAG(IS_ANDROID)
- base::test::ScopedFeatureList feature_list;
- feature_list.InitAndEnableFeature(download::features::kDownloadLater);
-#endif // BUILDFLAG(IS_ANDROID)
-
// Download prefs are registered when creating the profile.
TestingProfile profile;
DownloadPrefs prefs(&profile);
@@ -73,18 +68,10 @@
// Download prompt prefs should be registered correctly.
histogram_tester.ExpectBucketCount("MobileDownload.DownloadPromptStatus",
DownloadPromptStatus::SHOW_INITIAL, 1);
- histogram_tester.ExpectBucketCount("MobileDownload.DownloadLaterPromptStatus",
- DownloadPromptStatus::SHOW_INITIAL, 1);
int prompt_status = profile.GetTestingPrefService()->GetInteger(
prefs::kPromptForDownloadAndroid);
EXPECT_EQ(prompt_status,
static_cast<int>(DownloadPromptStatus::SHOW_INITIAL));
-
- int download_later_prompt_status =
- profile.GetTestingPrefService()->GetInteger(
- prefs::kDownloadLaterPromptStatus);
- EXPECT_EQ(download_later_prompt_status,
- static_cast<int>(DownloadLaterPromptStatus::kShowInitial));
#endif // BUILDFLAG(IS_ANDROID)
}
@@ -686,36 +673,9 @@
#endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_ANDROID)
-TEST(DownloadPrefsTest, DownloadLaterPrefs) {
- base::test::ScopedFeatureList feature_list;
- feature_list.InitAndEnableFeature(download::features::kDownloadLater);
-
- content::BrowserTaskEnvironment task_environment_;
- TestingProfile profile;
- DownloadPrefs prefs(&profile);
-
- EXPECT_TRUE(prefs.PromptDownloadLater());
- EXPECT_FALSE(prefs.HasDownloadLaterPromptShown());
-
- profile.GetPrefs()->SetInteger(
- prefs::kDownloadLaterPromptStatus,
- static_cast<int>(DownloadLaterPromptStatus::kShowPreference));
- EXPECT_TRUE(prefs.PromptDownloadLater());
- EXPECT_TRUE(prefs.HasDownloadLaterPromptShown());
-
- profile.GetPrefs()->SetInteger(
- prefs::kDownloadLaterPromptStatus,
- static_cast<int>(DownloadLaterPromptStatus::kDontShow));
- EXPECT_FALSE(prefs.PromptDownloadLater());
- EXPECT_TRUE(prefs.HasDownloadLaterPromptShown());
-}
-
-// Verfies the returned value of PromptForDownload() and PromptDownloadLater()
+// Verfies the returned value of PromptForDownload()
// when prefs::kPromptForDownload is managed by enterprise policy,
TEST(DownloadPrefsTest, ManagedPromptForDownload) {
- base::test::ScopedFeatureList feature_list;
- feature_list.InitAndEnableFeature(download::features::kDownloadLater);
-
content::BrowserTaskEnvironment task_environment_;
TestingProfile profile;
profile.GetTestingPrefService()->SetManagedPref(
@@ -723,17 +683,12 @@
DownloadPrefs prefs(&profile);
profile.GetPrefs()->SetInteger(
- prefs::kDownloadLaterPromptStatus,
- static_cast<int>(DownloadLaterPromptStatus::kShowPreference));
- profile.GetPrefs()->SetInteger(
prefs::kPromptForDownloadAndroid,
static_cast<int>(DownloadPromptStatus::DONT_SHOW));
- EXPECT_FALSE(prefs.PromptDownloadLater());
EXPECT_TRUE(prefs.PromptForDownload());
profile.GetTestingPrefService()->SetManagedPref(
prefs::kPromptForDownload, std::make_unique<base::Value>(false));
- EXPECT_FALSE(prefs.PromptDownloadLater());
EXPECT_FALSE(prefs.PromptForDownload());
}
diff --git a/chrome/browser/download/download_prompt_status.h b/chrome/browser/download/download_prompt_status.h
index c77f6fa..dde912a 100644
--- a/chrome/browser/download/download_prompt_status.h
+++ b/chrome/browser/download/download_prompt_status.h
@@ -15,14 +15,4 @@
MAX_VALUE
};
-// The status of the download later prompt.
-// A Java counterpart will be generated for this enum.
-// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.download
-enum class DownloadLaterPromptStatus {
- kShowInitial, // Show the prompt because it hasn't been shown before.
- kShowPreference, // Show the prompt because user indicated preference.
- kDontShow, // Don't show the prompt because user indicated preference.
- kMaxValue = kDontShow
-};
-
#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PROMPT_STATUS_H_
diff --git a/chrome/browser/download/download_stats.cc b/chrome/browser/download/download_stats.cc
index 1fbfb6a4..2b13d1a1 100644
--- a/chrome/browser/download/download_stats.cc
+++ b/chrome/browser/download/download_stats.cc
@@ -99,12 +99,6 @@
base::UmaHistogramEnumeration("MobileDownload.DownloadPromptStatus", status,
DownloadPromptStatus::MAX_VALUE);
}
-
-void RecordDownloadLaterPromptStatus(DownloadLaterPromptStatus status) {
- base::UmaHistogramEnumeration("MobileDownload.DownloadLaterPromptStatus",
- status);
-}
-
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_CHROMEOS)
diff --git a/chrome/browser/download/download_stats.h b/chrome/browser/download/download_stats.h
index f2ef18d..9e3615d 100644
--- a/chrome/browser/download/download_stats.h
+++ b/chrome/browser/download/download_stats.h
@@ -175,9 +175,6 @@
#if BUILDFLAG(IS_ANDROID)
// Records whether the download dialog is shown to the user.
void RecordDownloadPromptStatus(DownloadPromptStatus status);
-
-// Records whether the download later dialog is shown to the user.
-void RecordDownloadLaterPromptStatus(DownloadLaterPromptStatus status);
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_CHROMEOS)
diff --git a/chrome/browser/download/download_stats_unittest.cc b/chrome/browser/download/download_stats_unittest.cc
index f49ed7d..429a828 100644
--- a/chrome/browser/download/download_stats_unittest.cc
+++ b/chrome/browser/download/download_stats_unittest.cc
@@ -17,9 +17,6 @@
constexpr char kDownloadPromptStatusHistogram[] =
"MobileDownload.DownloadPromptStatus";
-constexpr char kDownloadLaterPromptStatusHistogram[] =
- "MobileDownload.DownloadLaterPromptStatus";
-
TEST(DownloadStatsTest, RecordDownloadPromptStatus) {
base::HistogramTester histogram_tester;
RecordDownloadPromptStatus(DownloadPromptStatus::SHOW_INITIAL);
@@ -33,15 +30,6 @@
DownloadPromptStatus::DONT_SHOW, 1);
histogram_tester.ExpectTotalCount(kDownloadPromptStatusHistogram, 3);
}
-
-TEST(DownloadStatsTest, RecordDownloadLaterPromptStatus) {
- base::HistogramTester histogram_tester;
- RecordDownloadLaterPromptStatus(DownloadLaterPromptStatus::kDontShow);
- histogram_tester.ExpectBucketCount(kDownloadLaterPromptStatusHistogram,
- DownloadLaterPromptStatus::kDontShow, 1);
- histogram_tester.ExpectTotalCount(kDownloadLaterPromptStatusHistogram, 1);
-}
-
#endif // BUILDFLAG(IS_ANDROID)
TEST(DownloadStatsTest, RecordDownloadCancelReason) {
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 0905a4a..d25d2e9 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -766,6 +766,12 @@
const char kPrivacySandboxPreferencesReconciled[] =
"privacy_sandbox.preferences_reconciled";
+#if BUILDFLAG(IS_ANDROID)
+// Deprecated 06/2022.
+const char kDownloadLaterPromptStatus[] =
+ "download.download_later_prompt_status";
+#endif // BUILDFLAG(IS_ANDROID)
+
// Register local state used only for migration (clearing or moving to a new
// key).
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -1002,6 +1008,10 @@
#endif // BUILDFLAG(ENABLE_DICE_SUPPORT)
registry->RegisterBooleanPref(kPrivacySandboxPreferencesReconciled, false);
+
+#if BUILDFLAG(IS_ANDROID)
+ registry->RegisterIntegerPref(kDownloadLaterPromptStatus, 0);
+#endif // BUILDFLAG(IS_ANDROID)
}
} // namespace
@@ -1954,6 +1964,7 @@
#if BUILDFLAG(IS_ANDROID)
// Added 06/2022.
syncer::MigrateSyncRequestedPrefPostMice(profile_prefs);
+ profile_prefs->ClearPref(kDownloadLaterPromptStatus);
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_CHROMEOS_ASH)