Merge "Extending timeout workaround for updating the widget tray after we get a packages-changed broadcast. (Bug 6602951)" into jb-dev
This commit is contained in:
@@ -547,13 +547,14 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
|
|||||||
// TODO: this isn't ideal, but we actually need to delay here. This call is triggered
|
// TODO: this isn't ideal, but we actually need to delay here. This call is triggered
|
||||||
// by a broadcast receiver, and in order for it to work correctly, we need to know that
|
// by a broadcast receiver, and in order for it to work correctly, we need to know that
|
||||||
// the AppWidgetService has already received and processed the same broadcast. Since there
|
// the AppWidgetService has already received and processed the same broadcast. Since there
|
||||||
// is no guarantee about ordering of broadcast receipt, we just delay here. Ideally,
|
// is no guarantee about ordering of broadcast receipt, we just delay here. This is a
|
||||||
// we should have a more precise way of ensuring the AppWidgetService is up to date.
|
// workaround until we add a callback from AppWidgetService to AppWidgetHost when widget
|
||||||
|
// packages are added, updated or removed.
|
||||||
postDelayed(new Runnable() {
|
postDelayed(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
updatePackages();
|
updatePackages();
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 1500);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updatePackages() {
|
public void updatePackages() {
|
||||||
@@ -574,6 +575,9 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
|
|||||||
if (minSpanX <= LauncherModel.getCellCountX() &&
|
if (minSpanX <= LauncherModel.getCellCountX() &&
|
||||||
minSpanY <= LauncherModel.getCellCountY()) {
|
minSpanY <= LauncherModel.getCellCountY()) {
|
||||||
mWidgets.add(widget);
|
mWidgets.add(widget);
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "Widget " + widget.provider + " can not fit on this device (" +
|
||||||
|
widget.minWidth + ", " + widget.minHeight + ")");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e(TAG, "Widget " + widget.provider + " has invalid dimensions (" +
|
Log.e(TAG, "Widget " + widget.provider + " has invalid dimensions (" +
|
||||||
|
|||||||
Reference in New Issue
Block a user