Logging error when we do not get a valid appWidgetId back from the configuration widget. (Bug 6407704)

Change-Id: Ib58b9f43b63edb211059728f7b65560704295c76
This commit is contained in:
Winson Chung
2012-04-27 15:24:02 -07:00
parent 727f0e1292
commit 5aaab774cf
+7 -1
View File
@@ -568,7 +568,13 @@ public final class Launcher extends Activity
if (isWidgetDrop) {
int appWidgetId = data != null ?
data.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1) : -1;
completeTwoStageWidgetDrop(resultCode, appWidgetId);
if (appWidgetId < 0) {
Log.e(TAG, "Error: appWidgetId (EXTRA_APPWIDGET_ID) was not returned from the \\" +
"widget configuration activity.");
completeTwoStageWidgetDrop(RESULT_CANCELED, appWidgetId);
} else {
completeTwoStageWidgetDrop(resultCode, appWidgetId);
}
return;
}