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

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

Issue 2217413002: arc: Fix sync related issue with old container. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: arc: Sync related issue. Created 4 years, 4 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc b/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc
index 5e196ce172a480bdcb1e3d0fbc3a2323e6a72713..ea0efa28637797ba1fe927374a554be60eac2873 100644
--- a/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc
+++ b/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc
@@ -23,6 +23,8 @@ namespace {
using syncer::SyncChange;
using ArcSyncItem = ArcPackageSyncableService::SyncItem;
+constexpr int64_t kNoAndroidID = 0;
+
std::unique_ptr<ArcSyncItem> CreateSyncItemFromSyncSpecifics(
const sync_pb::ArcPackageSpecifics& specifics) {
return base::MakeUnique<ArcSyncItem>(
@@ -266,6 +268,13 @@ void ArcPackageSyncableService::OnPackageInstalled(
// Pending install item. Confirm install.
if (install_iter != pending_install_items_.end()) {
+ if (install_iter->second->last_backup_android_id == kNoAndroidID &&
+ package_info.last_backup_android_id != kNoAndroidID) {
+ pending_install_items_.erase(install_iter);
+ SendSyncChange(package_info, SyncChange::ACTION_UPDATE);
+ return;
+ }
+
sync_items_[package_name] = std::move(install_iter->second);
pending_install_items_.erase(install_iter);
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698