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
This commit is contained in:
Adam Cohen
2012-11-04 12:03:12 -08:00
parent 6275b3f1f3
commit 180cfd5feb
2 changed files with 5 additions and 2 deletions

View File

@@ -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);

View File

@@ -260,7 +260,7 @@ public class AppWidgetProviderInfo implements Parcelable {
that.minResizeWidth = this.minResizeHeight;
that.minResizeHeight = this.minResizeHeight;
that.updatePeriodMillis = this.updatePeriodMillis;
that.initialLayout = that.initialLayout;
that.initialLayout = this.initialLayout;
that.initialKeyguardLayout = this.initialKeyguardLayout;
that.configure = this.configure == null ? null : this.configure.clone();
that.label = this.label == null ? null : this.label.substring(0);