From a401dc515c7aff0128ee3f17a1089939f9c9c201 Mon Sep 17 00:00:00 2001 From: Steven Ng Date: Fri, 15 Jan 2021 19:24:45 +0000 Subject: 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 --- core/java/android/appwidget/AppWidgetProviderInfo.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core/java/android') diff --git a/core/java/android/appwidget/AppWidgetProviderInfo.java b/core/java/android/appwidget/AppWidgetProviderInfo.java index c4333ac44e34..062076bb15ef 100644 --- a/core/java/android/appwidget/AppWidgetProviderInfo.java +++ b/core/java/android/appwidget/AppWidgetProviderInfo.java @@ -112,10 +112,19 @@ public class AppWidgetProviderInfo implements Parcelable { */ 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 */ @IntDef(flag = true, prefix = { "FLAG_" }, value = { WIDGET_FEATURE_RECONFIGURABLE, WIDGET_FEATURE_HIDE_FROM_PICKER, + WIDGET_FEATURE_CONFIGURATION_OPTIONAL }) @Retention(RetentionPolicy.SOURCE) public @interface FeatureFlags {} @@ -269,6 +278,7 @@ public class AppWidgetProviderInfo implements Parcelable { * * @see #WIDGET_FEATURE_RECONFIGURABLE * @see #WIDGET_FEATURE_HIDE_FROM_PICKER + * @see #WIDGET_FEATURE_CONFIGURATION_OPTIONAL */ @FeatureFlags public int widgetFeatures; -- cgit v1.2.3