diff options
| author | 2017-09-22 02:43:24 +0000 | |
|---|---|---|
| committer | 2017-09-22 02:43:24 +0000 | |
| commit | 3583e1f079364c480efab408ebd323d18f7c65ad (patch) | |
| tree | 071c09cb3ea132caa9317ebbb6d46903e2919cd8 /services/appwidget/java | |
| parent | 79b94a58a4a670ceccba7134eefb4d597dce0b35 (diff) | |
| parent | 1807cb4a8896cfa9b187840e403b2b0cc56abf08 (diff) | |
Merge "Add checking values not to save illegal value to appwidgets.xml" am: 941d4b2135
am: 1807cb4a88
Change-Id: I6e02c6dead092e8727f8ef76eaf689ef0cfec376
Diffstat (limited to 'services/appwidget/java')
| -rw-r--r-- | services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java index aad44314e6cb..16a927c3c09a 100644 --- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java +++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java @@ -2426,14 +2426,14 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku out.attribute(null, "p", Integer.toHexString(widget.provider.tag)); } if (widget.options != null) { - out.attribute(null, "min_width", Integer.toHexString(widget.options.getInt( - AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH))); - out.attribute(null, "min_height", Integer.toHexString(widget.options.getInt( - AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT))); - out.attribute(null, "max_width", Integer.toHexString(widget.options.getInt( - AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH))); - out.attribute(null, "max_height", Integer.toHexString(widget.options.getInt( - AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT))); + int minWidth = widget.options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH); + int minHeight = widget.options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT); + int maxWidth = widget.options.getInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH); + int maxHeight = widget.options.getInt(AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT); + out.attribute(null, "min_width", Integer.toHexString((minWidth > 0) ? minWidth : 0)); + out.attribute(null, "min_height", Integer.toHexString((minHeight > 0) ? minHeight : 0)); + out.attribute(null, "max_width", Integer.toHexString((maxWidth > 0) ? maxWidth : 0)); + out.attribute(null, "max_height", Integer.toHexString((maxHeight > 0) ? maxHeight : 0)); out.attribute(null, "host_category", Integer.toHexString(widget.options.getInt( AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY))); } |