Adding a DB update path to handle the QSB position change

> Renamed the id of 1st screen to 0 and making space for the QSB
by running the grid migration task.
> Added a feature flag to easily disable the QSB-in-workspace behavior

Change-Id: Ie3369f0d4433d916e9d6215d414770d4333f3e26
This commit is contained in:
Sunny Goyal
2016-06-10 12:22:04 -07:00
parent b25b2c41c2
commit a9e2f5abb3
8 changed files with 297 additions and 49 deletions
+5 -1
View File
@@ -510,6 +510,9 @@ public class Workspace extends PagedView
* @param qsb an exisitng qsb to recycle or null.
*/
public void bindAndInitFirstWorkspaceScreen(View qsb) {
if (!FeatureFlags.QSB_ON_FIRST_SCREEN) {
return;
}
// Add the first page
CellLayout firstPage = insertNewWorkspaceScreen(Workspace.FIRST_SCREEN_ID, 0);
@@ -909,7 +912,8 @@ public class Workspace extends PagedView
long id = mWorkspaceScreens.keyAt(i);
CellLayout cl = mWorkspaceScreens.valueAt(i);
// FIRST_SCREEN_ID can never be removed.
if (id > FIRST_SCREEN_ID && cl.getShortcutsAndWidgets().getChildCount() == 0) {
if ((!FeatureFlags.QSB_ON_FIRST_SCREEN || id > FIRST_SCREEN_ID)
&& cl.getShortcutsAndWidgets().getChildCount() == 0) {
removeScreens.add(id);
}
}