diff options
| author | Adam Cohen <adamcohen@google.com> | 2012-11-04 12:03:12 -0800 |
|---|---|---|
| committer | Adam Cohen <adamcohen@google.com> | 2012-11-04 12:05:44 -0800 |
| commit | 180cfd5feb4fe415d04494bf00f2013896f93b77 (patch) | |
| tree | fb1e5fc9a6d82dcf2ad93b9264853fb0db98496a /core/java/android/appwidget/AppWidgetHostView.java | |
| parent | 6275b3f1f3de7b0ca285e8f57a6d6014b0fa95b3 (diff) | |
If a default keyguard layout isn't specified, fallback to the default layout
-> Also fixing a typo in AppWidgetProvider clone() -- this was the cause of
the "couldn't load widget". It wasn't getting expressed before for various
reasons.
Change-Id: Ib7114565a414d66facd8b4baeb97d5a71e96b5e9
Diffstat (limited to 'core/java/android/appwidget/AppWidgetHostView.java')
| -rw-r--r-- | core/java/android/appwidget/AppWidgetHostView.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/android/appwidget/AppWidgetHostView.java b/core/java/android/appwidget/AppWidgetHostView.java index be6a770e6f33..52771eebecbb 100644 --- a/core/java/android/appwidget/AppWidgetHostView.java +++ b/core/java/android/appwidget/AppWidgetHostView.java @@ -553,7 +553,10 @@ public class AppWidgetHostView extends FrameLayout { if (options.containsKey(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY)) { int category = options.getInt(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY); if (category == AppWidgetProviderInfo.WIDGET_CATEGORY_KEYGUARD) { - layoutId = mInfo.initialKeyguardLayout; + int kgLayoutId = mInfo.initialKeyguardLayout; + // If a default keyguard layout is not specified, use the standard + // default layout. + layoutId = kgLayoutId == 0 ? layoutId : kgLayoutId; } } defaultView = inflater.inflate(layoutId, this, false); |
