Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4930)

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc

Issue 2553783002: [Merge-M56] arc: Fix error when uninstalled default app appears in next session. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/arc/arc_app_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
index 994bf9f47210a49705a7a94298b95ed87d6d4c9f..19466c6e0659139de0362f4e15c712346ff2819b 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
@@ -857,6 +857,7 @@ void ArcAppListPrefs::AddOrUpdatePackagePrefs(
package_dict->SetString(kLastBackupAndroidId, id_str);
package_dict->SetString(kLastBackupTime, time_str);
package_dict->SetBoolean(kSystem, package.system);
+ package_dict->SetBoolean(kUninstalled, false);
}
void ArcAppListPrefs::RemovePackageFromPrefs(PrefService* prefs,
@@ -960,6 +961,7 @@ void ArcAppListPrefs::OnPackageAppListRefreshed(
std::unordered_set<std::string> apps_to_remove =
GetAppsForPackage(package_name);
+ default_apps_.MaybeMarkPackageUninstalled(package_name, false);
for (const auto& app : apps) {
apps_to_remove.erase(GetAppId(app->package_name, app->activity));
AddApp(*app);
@@ -1191,8 +1193,14 @@ std::vector<std::string> ArcAppListPrefs::GetPackagesFromPrefs(
prefs_->GetDictionary(prefs::kArcPackages);
for (base::DictionaryValue::Iterator package(*package_prefs);
!package.IsAtEnd(); package.Advance()) {
+ const base::DictionaryValue* package_info;
+ if (!package.value().GetAsDictionary(&package_info)) {
+ NOTREACHED();
+ continue;
+ }
+
bool uninstalled = false;
- package_prefs->GetBoolean(kSystem, &uninstalled);
+ package_info->GetBoolean(kUninstalled, &uninstalled);
if (installed != !uninstalled)
continue;
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/arc/arc_app_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698