Modify ArcAppIcon to handle non-adaptive icons and migration.
When there is only 1 icon file(icon_xxx.png) for the app, there could be 2 cases: 1. The icon is not the adaptive icon 2. The system just migrated from the adaptive icon feature disabled to enabled. To distinguish these 2 scenarios, modify the arc_app_list_prefs. If the adaptive icon feature is enabled, for non-adaptive icons, save the image to both icon_xxx.png and foreground_icon_xxx.png. Then ArcAppIcon can check the files to know whether the current icon is non-adaptive icon or the system migration case. If there is no foreground icon, that means the system migration case, then we should request the icon. Otherwise, that means the icon is a non-adaptive icon. This is also preparing for the next step, removing the icon_xxx.png, so that we can have 2 png files only: foreground_icon_xxx.png: Present the foreground image for the adaptive icon or the image for the non-adaptive icon. background_icon_xxx.png: Present the background image for the adaptive icon. TODO: Add the metric to verify whether we have non-adaptive icon scenario. If all icons return from ARC side are 2 layer, for the next step, we can add some DCHECK and remove the icon_xxx.png, and force checking both the foreground and background images. BUG=1083331 Change-Id: I516c4a317040da03902f80ddbaa9876325bfbd35 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2318885Reviewed-by:Long Cheng <lgcheng@google.com> Reviewed-by:
Dominick Ng <dominickn@chromium.org> Commit-Queue: Nancy Wang <nancylingwang@chromium.org> Cr-Commit-Position: refs/heads/master@{#792122}
Showing
Please register or sign in to comment