Removing reference of hostView from LauncherAppWidgetInfo
LauncherAppWidgetInfo is a model item and does not need to reference
a view. Removing this dependency will allow cleaning up the
item unbinding logic
Bug: 28740269
Change-Id: I11fc2e2500b8fe29d157eefe74c70b1decdfd08d
diff --git a/src/com/android/launcher3/LauncherAppWidgetInfo.java b/src/com/android/launcher3/LauncherAppWidgetInfo.java
index 55edf45..42d6468 100644
--- a/src/com/android/launcher3/LauncherAppWidgetInfo.java
+++ b/src/com/android/launcher3/LauncherAppWidgetInfo.java
@@ -80,12 +80,6 @@
private boolean mHasNotifiedInitialWidgetSizeChanged;
- /**
- * View that holds this widget after it's been created. This view isn't created
- * until Launcher knows it's needed.
- */
- AppWidgetHostView hostView = null;
-
LauncherAppWidgetInfo(int appWidgetId, ComponentName providerName) {
if (appWidgetId == CUSTOM_WIDGET_ID) {
itemType = LauncherSettings.Favorites.ITEM_TYPE_CUSTOM_APPWIDGET;
@@ -121,25 +115,18 @@
* When we bind the widget, we should notify the widget that the size has changed if we have not
* done so already (only really for default workspace widgets).
*/
- void onBindAppWidget(Launcher launcher) {
+ void onBindAppWidget(Launcher launcher, AppWidgetHostView hostView) {
if (!mHasNotifiedInitialWidgetSizeChanged) {
AppWidgetResizeFrame.updateWidgetSizeRanges(hostView, launcher, spanX, spanY);
mHasNotifiedInitialWidgetSizeChanged = true;
}
}
-
@Override
public String toString() {
return "AppWidget(id=" + Integer.toString(appWidgetId) + ")";
}
- @Override
- void unbind() {
- super.unbind();
- hostView = null;
- }
-
public final boolean isWidgetIdValid() {
return (restoreStatus & FLAG_ID_NOT_VALID) == 0;
}