summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Launcher.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2012-10-04 16:53:44 -0700
committerAdam Cohen <adamcohen@google.com>2012-10-04 16:53:44 -0700
commitdd70d66852bb8bd16f55796e546ba290360d1198 (patch)
tree5f9bedc0faebee02f2d36c81e4b028c4d2ab88ee /src/com/android/launcher2/Launcher.java
parenta2042d0ae9dffcfeafe4e2e0b00cee069ce5f773 (diff)
downloadandroid_packages_apps_Trebuchet-dd70d66852bb8bd16f55796e546ba290360d1198.tar.gz
android_packages_apps_Trebuchet-dd70d66852bb8bd16f55796e546ba290360d1198.tar.bz2
android_packages_apps_Trebuchet-dd70d66852bb8bd16f55796e546ba290360d1198.zip
Fix for widgets with config not getting size info (issue 7266053)
Change-Id: I0b55555ed38d4f2a70345d1b6316a075a9346111
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r--src/com/android/launcher2/Launcher.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 4ae9c7d26..3fdf5c3ce 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1746,13 +1746,25 @@ public final class Launcher extends Activity
// In this case, we either need to start an activity to get permission to bind
// the widget, or we need to start an activity to configure the widget, or both.
appWidgetId = getAppWidgetHost().allocateAppWidgetId();
- if (mAppWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId, info.componentName)) {
+ Bundle options = info.bindOptions;
+
+ boolean success = false;
+ if (options != null) {
+ success = mAppWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId,
+ info.componentName, options);
+ } else {
+ success = mAppWidgetManager.bindAppWidgetIdIfAllowed(appWidgetId,
+ info.componentName);
+ }
+ if (success) {
addAppWidgetImpl(appWidgetId, info, null, info.info);
} else {
mPendingAddWidgetInfo = info.info;
Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_BIND);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_PROVIDER, info.componentName);
+ // TODO: we need to make sure that this accounts for the options bundle.
+ // intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_OPTIONS, options);
startActivityForResult(intent, REQUEST_BIND_APPWIDGET);
}
}