Fix LauncherProvider newScreenId issue

Remove maxScreenId from LauncherProvider and whenever we need
a new screenId, query the database to calculate a new screenId.
Also converted and refactored AddWorkspaceItemsTaskTest
and added some extra test cases.

Test: manual & AddWorkspaceItemsTaskTest.kt
Bug: 199160559
Change-Id: I185f6823fed171d778af0130497f5ffaf89c0a70
This commit is contained in:
Andras Kloczl
2021-10-15 21:16:48 +01:00
committed by Alex Chau
parent f75725830a
commit 953eb8041e
5 changed files with 13 additions and 62 deletions
@@ -292,7 +292,7 @@ public class ModelWriter {
FileLog.d(TAG, "removing items from db " + items.stream().map(
(item) -> item.getTargetComponent() == null ? ""
: item.getTargetComponent().getPackageName()).collect(
Collectors.joining(",")), new Exception());
Collectors.joining(",")));
notifyDelete(items);
enqueueDeleteRunnable(() -> {
for (ItemInfo item : items) {