Android 11.0 Launcher3 desktop displays multiple identical app icons solution

1 Introduction

In the customized development of the 11.0 system ROM, in the native desktop of the Launcher3 system, when displaying the desktop, when disabling and enabling the function test of the app, it will be found that there are multiple icons of the same app displayed on the desktop

This is not very good for the experience of Launcher3, so in order to optimize the product, we need to solve this bug and make the product more perfect

2. The core class of the solution to display multiple identical app icons on the desktop

packages/apps/Launcher3/src/com/android/launcher3/model/PackageUpdatedTask.java
packages/apps/Launcher3/src/com/android/launcher3/LauncherModel.java

3. The core function analysis and implementation of the solution to display multiple identical app icons on the desktop

3.1 Source code analysis of related app updates and installations in LauncherModel.java

 /**
   * Maintains in-memory state of the Launcher. It is expected that there should be only one
   * LauncherModel object held in a static. Also provide APIs for updating the database state
   * for the Launcher.
   */
  public class LauncherModel extends LauncherApps.Callback implements InstallSessio

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/129428825#comments_27147717