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

Commit a401dc51 authored by Steven Ng's avatar Steven Ng
Browse files

Add a new widget feature value, configuration_optional

If configuration_optional is present, the widget provides a default
configuration. The host may decide not to launch the provided
configuration activity.

Design doc: go/deferrable-widget-config

Test: Successfully built blueline-userdebug. Since this CL only adds
a new value for an existing field, no unit test will be added at this
point. Once we introduce unit tests for widget configurations xml, we
will add related unit tests.

Bug: 177977976
Change-Id: I507cba0b9b8900f9b9616d76c48eb0ed9c50ed72
parent f44439cd
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -8342,6 +8342,7 @@ package android.appwidget {
    field public static final int WIDGET_CATEGORY_HOME_SCREEN = 1; // 0x1
    field public static final int WIDGET_CATEGORY_HOME_SCREEN = 1; // 0x1
    field public static final int WIDGET_CATEGORY_KEYGUARD = 2; // 0x2
    field public static final int WIDGET_CATEGORY_KEYGUARD = 2; // 0x2
    field public static final int WIDGET_CATEGORY_SEARCHBOX = 4; // 0x4
    field public static final int WIDGET_CATEGORY_SEARCHBOX = 4; // 0x4
    field public static final int WIDGET_FEATURE_CONFIGURATION_OPTIONAL = 3; // 0x3
    field public static final int WIDGET_FEATURE_HIDE_FROM_PICKER = 2; // 0x2
    field public static final int WIDGET_FEATURE_HIDE_FROM_PICKER = 2; // 0x2
    field public static final int WIDGET_FEATURE_RECONFIGURABLE = 1; // 0x1
    field public static final int WIDGET_FEATURE_RECONFIGURABLE = 1; // 0x1
    field public int autoAdvanceViewId;
    field public int autoAdvanceViewId;
+10 −0
Original line number Original line Diff line number Diff line
@@ -112,10 +112,19 @@ public class AppWidgetProviderInfo implements Parcelable {
     */
     */
    public static final int WIDGET_FEATURE_HIDE_FROM_PICKER = 2;
    public static final int WIDGET_FEATURE_HIDE_FROM_PICKER = 2;


    /**
     * The widget provides a default configuration. The host may choose not to launch the provided
     * configuration activity.
     *
     * @see #widgetFeatures
     */
    public static final int WIDGET_FEATURE_CONFIGURATION_OPTIONAL = 3;

    /** @hide */
    /** @hide */
    @IntDef(flag = true, prefix = { "FLAG_" }, value = {
    @IntDef(flag = true, prefix = { "FLAG_" }, value = {
            WIDGET_FEATURE_RECONFIGURABLE,
            WIDGET_FEATURE_RECONFIGURABLE,
            WIDGET_FEATURE_HIDE_FROM_PICKER,
            WIDGET_FEATURE_HIDE_FROM_PICKER,
            WIDGET_FEATURE_CONFIGURATION_OPTIONAL
    })
    })
    @Retention(RetentionPolicy.SOURCE)
    @Retention(RetentionPolicy.SOURCE)
    public @interface FeatureFlags {}
    public @interface FeatureFlags {}
@@ -269,6 +278,7 @@ public class AppWidgetProviderInfo implements Parcelable {
     *
     *
     * @see #WIDGET_FEATURE_RECONFIGURABLE
     * @see #WIDGET_FEATURE_RECONFIGURABLE
     * @see #WIDGET_FEATURE_HIDE_FROM_PICKER
     * @see #WIDGET_FEATURE_HIDE_FROM_PICKER
     * @see #WIDGET_FEATURE_CONFIGURATION_OPTIONAL
     */
     */
    @FeatureFlags
    @FeatureFlags
    public int widgetFeatures;
    public int widgetFeatures;
+3 −0
Original line number Original line Diff line number Diff line
@@ -7985,6 +7985,9 @@
            <!-- The widget is added directly by the app, and does not need to appear in
            <!-- The widget is added directly by the app, and does not need to appear in
                 the global list of available widgets -->
                 the global list of available widgets -->
            <flag name="hide_from_picker" value="0x2" />
            <flag name="hide_from_picker" value="0x2" />
              <!-- The widget provides a default configuration. The host may decide not to launch
                   the provided configuration activity. -->
           <flag name="configuration_optional" value="0x3" />
        </attr>
        </attr>
    </declare-styleable>
    </declare-styleable>