Fix a potential concurrency issue for loading CDB file

Bug: 158919530

Change-Id: I00ddbaeebaed3aa669948cde7fbac0cf4ad86301
This commit is contained in:
Hyunyoung Song
2020-06-18 22:57:50 -07:00
parent adb6352bac
commit d98d5ebedc
4 changed files with 11 additions and 4 deletions

View File

@@ -28,6 +28,7 @@ import com.android.launcher3.folder.FolderNameProvider;
import com.android.launcher3.logging.InstanceId;
import com.android.launcher3.logging.InstanceIdSequence;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.util.Executors;
/**
* Interface defining an object that can receive a drag.
@@ -84,7 +85,9 @@ public interface DropTarget {
public DragObject(Context context) {
if (FeatureFlags.FOLDER_NAME_SUGGEST.get()) {
folderNameProvider = FolderNameProvider.newInstance(context);
Executors.MODEL_EXECUTOR.post(() -> {
folderNameProvider = FolderNameProvider.newInstance(context);
});
}
}