[FIX] Prevent item from being added twice by first checking them
This MR is intended to fix a bug which is caused when the user adds PWA if app installation is going on that results in having a duplicate icon of the recently installed app. Description
Related issuese/backlog#1947 (closed)
Type of change
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- This change requires a documentation update
How has this been tested?
This Fix can be tested by following these steps.
(Pinterest is used as an example here.)
- Make sure the Pinterest app is not installed (Neither full apk nor PWA)
- Open "Apps", search for Pinterest, and multiple variants of Pinterest will be shown.
- First, click on Install on the first Pinterest (Full Apk), then while the installation is going on, click on install for the Pinterest Lite, then at the same time install Pinterest PWA.
- Do not jump to the launcher in between. Wait till all the variants are installed.
- Once all three variants are downloaded and installed in Apps, Go to home (Launcher).
- Without this fix, BlissLauncher will have a double icons of Pinterest Lite and Pinterest (Full).
- With this fix apk, there should be only one icon corresponding to one variant.
- My code follows the style guidelines of this project
- I have performed a self-review of my own code
- I have commented my code, particularly in hard-to-understand areas
- I have made corresponding changes to the documentation
- New and existing unit tests pass locally with my changes
- Any dependent changes have been merged and published in downstream modules