OpenLauncherTeam / openlauncher

Customizable and Open Source Launcher for Android
Apache License 2.0
1.41k stars 413 forks source link

Improve app manager async task to fix possible race condition #580

Closed cmtjk closed 4 years ago

cmtjk commented 4 years ago

To fix a possible race condition mentioned in https://github.com/OpenLauncherTeam/openlauncher/pull/561 I've refactored the AppManager.java's AsyncGetApps task.

All global variables modified by doInBackground() are replaced by temporary variables. New assignments of global variables are done in onPostExecute() which is executed in the main thread.