Fix crash when Workspace item is added to two panel home

Test: Run com.android.launcher3.ui.widgetRequestPinItemTest#testPinShortcut tests
      and com.android.launcher3.ui.TaplTestsLauncher3#testWorkspace
Bug: 199150824
Change-Id: I8550970806eb0b9bfc246d4fb76ffbd0415b7647
This commit is contained in:
Alex Chau 2021-09-08 20:46:32 +01:00
parent 71e766dcea
commit 817e0fa812
1 changed files with 3 additions and 0 deletions

View File

@ -2227,6 +2227,9 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
ArrayList<ItemInfo> addAnimated) {
// Add the new screens
if (newScreens != null) {
// newScreens can contain an empty right panel that is already bound, but not known
// by BgDataModel.
newScreens.removeAllValues(mWorkspace.mScreenOrder);
bindAddScreens(newScreens);
}