Fix the icon load issue when Playstore is off and on.
When Playstore is removed, OnAppStatesChanged is called, and then OnAppRemoved is called. 1: Playstore removed 2: OnAppStatesChanged 3: OnAppRemoved When OnAppStatesChanged is called, ArcApps updates the icon key, so AppServiceAppItem and AppServiceAppIconLoader reload icon with mojom. 1: Playstore removed 2: OnAppStatesChanged -> AppServiceAppItem::LoadIcon -> AppServiceAppIconLoader::LoadIcon Before ArcApps receives the load calls, ArcIconOnceLoader's OnAppRemoved has clear the ArcAppIcon. So when ArcIconOnceLoader receives the load icon calls from AppServiceAppItem and AppServiceAppIconLoader, ArcIconOnceLoader won't clear the ArcAppIcon again, and ArcIconOnceLoader still calls ArcIconOnceLoader to load icon. 1: Playstore removed 2: OnAppStatesChanged -> AppServiceAppItem::LoadIcon -> AppServiceAppIconLoader::LoadIcon 3: OnAppRemoved -> ArcIconOnceLoader::OnAppRemoved 4: ArcIconOnceLoader::LoadIcon -> Create ArcAppIcon to load icon However, the ARC apps have been removed, so ArcAppIcon can't load the icon, and ArcIconOnceLoader and IconCoalescer just keep waiting the icon load result. Modify ArcApps, when the app has been removed, don't call ArcIconOnceLoader to load the icon. Tried to update ArcAppIcon to return result when time out, but that method doesn't work. Because when Playstore is re-enabled, MaybeRequestIcon should be called to ask Arc pref to reload the icon, but ArcIconOnceLoader doesn't know when the app is re-installed, so it can't call MaybeRequestIcon to reload the icon, so when Playstore is re-enabled, it still can't load the icon. b:149229735 Change-Id: I2ac61fe598f9e9d0314a248150f8897c3eb57e83 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2072337 Commit-Queue: Nancy Wang <nancylingwang@chromium.org> Reviewed-by:Dominick Ng <dominickn@chromium.org> Cr-Commit-Position: refs/heads/master@{#750449}
Showing
Please register or sign in to comment