am 76980e33: Merge "Fix binding problem with no screens (issue 11768766)" into jb-ub-now-jolly-elf
* commit '76980e33978b3d1aa1fd870e98995c713ba2e1d0': Fix binding problem with no screens (issue 11768766)
This commit is contained in:
@@ -2041,12 +2041,6 @@ public class LauncherModel extends BroadcastReceiver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we aren't filtering on a screen, then the set of items to load is the full set of
|
|
||||||
// items given.
|
|
||||||
if (currentScreenId < 0) {
|
|
||||||
throw new RuntimeException("Unexpected screen id");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Order the set of items by their containers first, this allows use to walk through the
|
// Order the set of items by their containers first, this allows use to walk through the
|
||||||
// list sequentially, build up a list of containers that are in the specified screen,
|
// list sequentially, build up a list of containers that are in the specified screen,
|
||||||
// as well as all items in those containers.
|
// as well as all items in those containers.
|
||||||
@@ -2084,11 +2078,6 @@ public class LauncherModel extends BroadcastReceiver {
|
|||||||
ArrayList<LauncherAppWidgetInfo> appWidgets,
|
ArrayList<LauncherAppWidgetInfo> appWidgets,
|
||||||
ArrayList<LauncherAppWidgetInfo> currentScreenWidgets,
|
ArrayList<LauncherAppWidgetInfo> currentScreenWidgets,
|
||||||
ArrayList<LauncherAppWidgetInfo> otherScreenWidgets) {
|
ArrayList<LauncherAppWidgetInfo> otherScreenWidgets) {
|
||||||
// If we aren't filtering on a screen, then the set of items to load is the full set of
|
|
||||||
// widgets given.
|
|
||||||
if (currentScreenId < 0) {
|
|
||||||
throw new RuntimeException("Unexpected screen id");
|
|
||||||
}
|
|
||||||
|
|
||||||
for (LauncherAppWidgetInfo widget : appWidgets) {
|
for (LauncherAppWidgetInfo widget : appWidgets) {
|
||||||
if (widget == null) continue;
|
if (widget == null) continue;
|
||||||
@@ -2107,11 +2096,6 @@ public class LauncherModel extends BroadcastReceiver {
|
|||||||
HashMap<Long, FolderInfo> folders,
|
HashMap<Long, FolderInfo> folders,
|
||||||
HashMap<Long, FolderInfo> currentScreenFolders,
|
HashMap<Long, FolderInfo> currentScreenFolders,
|
||||||
HashMap<Long, FolderInfo> otherScreenFolders) {
|
HashMap<Long, FolderInfo> otherScreenFolders) {
|
||||||
// If we aren't filtering on a screen, then the set of items to load is the full set of
|
|
||||||
// widgets given.
|
|
||||||
if (currentScreenId < 0) {
|
|
||||||
throw new RuntimeException("Unexpected screen id");
|
|
||||||
}
|
|
||||||
|
|
||||||
for (long id : folders.keySet()) {
|
for (long id : folders.keySet()) {
|
||||||
ItemInfo info = itemsIdMap.get(id);
|
ItemInfo info = itemsIdMap.get(id);
|
||||||
@@ -2261,13 +2245,15 @@ public class LauncherModel extends BroadcastReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final boolean isLoadingSynchronously = (synchronizeBindPage > -1);
|
final boolean isLoadingSynchronously = (synchronizeBindPage > -1);
|
||||||
final int currentScreen = isLoadingSynchronously ? synchronizeBindPage :
|
int currScreen = isLoadingSynchronously ? synchronizeBindPage :
|
||||||
oldCallbacks.getCurrentWorkspaceScreen();
|
oldCallbacks.getCurrentWorkspaceScreen();
|
||||||
if (currentScreen >= orderedScreenIds.size()) {
|
if (currScreen >= orderedScreenIds.size()) {
|
||||||
Log.w(TAG, "Invalid screen id to synchronously load");
|
// There may be no workspace screens (just hotseat items and an empty page).
|
||||||
return;
|
currScreen = -1;
|
||||||
}
|
}
|
||||||
final long currentScreenId = orderedScreenIds.get(currentScreen);
|
final int currentScreen = currScreen;
|
||||||
|
final long currentScreenId =
|
||||||
|
currentScreen < 0 ? -1 : orderedScreenIds.get(currentScreen);
|
||||||
|
|
||||||
// Load all the items that are on the current page first (and in the process, unbind
|
// Load all the items that are on the current page first (and in the process, unbind
|
||||||
// all the existing workspace items before we call startBinding() below.
|
// all the existing workspace items before we call startBinding() below.
|
||||||
|
|||||||
Reference in New Issue
Block a user