Jailing the saved instance state of all the dynamically generated views

Using itemId instead of generating a new id for each item. This is because
if the process gets killed, View.generateId will get reset but we will still
receive the generated item id map in onRestoreInstance. This will cause
conflicts with newly generated item ids.

We wrap all the generated homescreen views inside a single sparse array. This
ensures that we do not cause any conflict with dynamically generated views in
other parts of the UI.

Bug: 16840760
Change-Id: I6fe69c2e1dd463402f51222715fae31b9d4dd240
This commit is contained in:
Sunny Goyal
2015-08-27 17:45:46 -07:00
parent de7ae659ff
commit d1a0e8b5c8
5 changed files with 90 additions and 45 deletions
+1
View File
@@ -579,6 +579,7 @@ public class Workspace extends PagedView
CellLayout customScreen = (CellLayout)
mLauncher.getLayoutInflater().inflate(R.layout.workspace_screen, this, false);
customScreen.disableDragTarget();
customScreen.disableJailContent();
mWorkspaceScreens.put(CUSTOM_CONTENT_SCREEN_ID, customScreen);
mScreenOrder.add(0, CUSTOM_CONTENT_SCREEN_ID);