Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 180cfd5f authored by Adam Cohen's avatar Adam Cohen
Browse files

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
parent 6275b3f1
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);