Commit 8afaa388 authored by qinmin's avatar qinmin Committed by Commit bot

Fix an issue that download entries in SharedPreferences is not removed when exiting app

SharedPreference.edit() creates a new editor.
So calling this method twice creates 2 different editors.
And the apply() call from the 2nd editor has no effect on the first editor.

BUG=459403

Review URL: https://codereview.chromium.org/930303003

Cr-Commit-Position: refs/heads/master@{#316956}
parent af5bda38
......@@ -200,8 +200,7 @@ public class DownloadManagerService extends BroadcastReceiver implements
Log.w(TAG, "Download failed: Cleared download id:" + id);
}
}
mSharedPrefs.edit().remove(DOWNLOAD_NOTIFICATION_IDS);
mSharedPrefs.edit().apply();
mSharedPrefs.edit().remove(DOWNLOAD_NOTIFICATION_IDS).apply();
}
if (mSharedPrefs.contains(PENDING_OMA_DOWNLOADS)) {
Set<String> omaDownloads = getStoredDownloadInfo(PENDING_OMA_DOWNLOADS);
......
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