Loading core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -9842,6 +9842,7 @@ package android.appwidget { field public static final int RESIZE_VERTICAL = 2; // 0x2 field public static final int WIDGET_CATEGORY_HOME_SCREEN = 1; // 0x1 field public static final int WIDGET_CATEGORY_KEYGUARD = 2; // 0x2 field @FlaggedApi("android.appwidget.flags.not_keyguard_category") public static final int WIDGET_CATEGORY_NOT_KEYGUARD = 8; // 0x8 field public static final int WIDGET_CATEGORY_SEARCHBOX = 4; // 0x4 field public static final int WIDGET_FEATURE_CONFIGURATION_OPTIONAL = 4; // 0x4 field public static final int WIDGET_FEATURE_HIDE_FROM_PICKER = 2; // 0x2 core/java/android/appwidget/AppWidgetManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -246,7 +246,8 @@ public class AppWidgetManager { * this widget. Can have the value {@link * AppWidgetProviderInfo#WIDGET_CATEGORY_HOME_SCREEN} or {@link * AppWidgetProviderInfo#WIDGET_CATEGORY_KEYGUARD} or {@link * AppWidgetProviderInfo#WIDGET_CATEGORY_SEARCHBOX}. * AppWidgetProviderInfo#WIDGET_CATEGORY_SEARCHBOX} or {@link * AppWidgetProviderInfo#WIDGET_CATEGORY_NOT_KEYGUARD}. */ public static final String OPTION_APPWIDGET_HOST_CATEGORY = "appWidgetCategory"; Loading core/java/android/appwidget/AppWidgetProviderInfo.java +15 −0 Original line number Diff line number Diff line Loading @@ -93,11 +93,26 @@ public class AppWidgetProviderInfo implements Parcelable { */ public static final int WIDGET_CATEGORY_SEARCHBOX = 4; /** * Indicates that the widget should never be shown on the keyguard. * * <p>Some keyguard style features may decide that {@link #WIDGET_CATEGORY_KEYGUARD} isn't * required to be added by an app to show on the feature when chosen by a user. * This category allows for a stronger statement about placement of the widget that, even in the * above case, this widget should not be offered on the keyguard. * * <p>Setting this category doesn't change the behavior of AppWidgetManager queries, it is the * responsibility of the widget surface to respect this value. */ @FlaggedApi(android.appwidget.flags.Flags.FLAG_NOT_KEYGUARD_CATEGORY) public static final int WIDGET_CATEGORY_NOT_KEYGUARD = 8; /** @hide */ @IntDef(flag = true, prefix = { "FLAG_" }, value = { WIDGET_CATEGORY_HOME_SCREEN, WIDGET_CATEGORY_KEYGUARD, WIDGET_CATEGORY_SEARCHBOX, WIDGET_CATEGORY_NOT_KEYGUARD, }) @Retention(RetentionPolicy.SOURCE) public @interface CategoryFlags {} Loading core/java/android/appwidget/flags.aconfig +9 −0 Original line number Diff line number Diff line Loading @@ -83,3 +83,12 @@ flag { is_exported: true is_fixed_read_only: true } flag { name: "not_keyguard_category" namespace: "app_widgets" description: "Adds the NOT_KEYGUARD category to AppWidgetInfo categories" bug: "365169792" is_exported: true is_fixed_read_only: true } core/res/res/values/attrs.xml +2 −0 Original line number Diff line number Diff line Loading @@ -9244,6 +9244,8 @@ <flag name="home_screen" value="0x1" /> <flag name="keyguard" value="0x2" /> <flag name="searchbox" value="0x4" /> <!-- @FlaggedApi("android.appwidget.flags.not_keyguard_category") --> <flag name="not_keyguard" value="0x8" /> </attr> <!-- Flags indicating various features supported by the widget. These are hints to the widget host, and do not actually change the behavior of the widget. --> Loading
core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -9842,6 +9842,7 @@ package android.appwidget { field public static final int RESIZE_VERTICAL = 2; // 0x2 field public static final int WIDGET_CATEGORY_HOME_SCREEN = 1; // 0x1 field public static final int WIDGET_CATEGORY_KEYGUARD = 2; // 0x2 field @FlaggedApi("android.appwidget.flags.not_keyguard_category") public static final int WIDGET_CATEGORY_NOT_KEYGUARD = 8; // 0x8 field public static final int WIDGET_CATEGORY_SEARCHBOX = 4; // 0x4 field public static final int WIDGET_FEATURE_CONFIGURATION_OPTIONAL = 4; // 0x4 field public static final int WIDGET_FEATURE_HIDE_FROM_PICKER = 2; // 0x2
core/java/android/appwidget/AppWidgetManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -246,7 +246,8 @@ public class AppWidgetManager { * this widget. Can have the value {@link * AppWidgetProviderInfo#WIDGET_CATEGORY_HOME_SCREEN} or {@link * AppWidgetProviderInfo#WIDGET_CATEGORY_KEYGUARD} or {@link * AppWidgetProviderInfo#WIDGET_CATEGORY_SEARCHBOX}. * AppWidgetProviderInfo#WIDGET_CATEGORY_SEARCHBOX} or {@link * AppWidgetProviderInfo#WIDGET_CATEGORY_NOT_KEYGUARD}. */ public static final String OPTION_APPWIDGET_HOST_CATEGORY = "appWidgetCategory"; Loading
core/java/android/appwidget/AppWidgetProviderInfo.java +15 −0 Original line number Diff line number Diff line Loading @@ -93,11 +93,26 @@ public class AppWidgetProviderInfo implements Parcelable { */ public static final int WIDGET_CATEGORY_SEARCHBOX = 4; /** * Indicates that the widget should never be shown on the keyguard. * * <p>Some keyguard style features may decide that {@link #WIDGET_CATEGORY_KEYGUARD} isn't * required to be added by an app to show on the feature when chosen by a user. * This category allows for a stronger statement about placement of the widget that, even in the * above case, this widget should not be offered on the keyguard. * * <p>Setting this category doesn't change the behavior of AppWidgetManager queries, it is the * responsibility of the widget surface to respect this value. */ @FlaggedApi(android.appwidget.flags.Flags.FLAG_NOT_KEYGUARD_CATEGORY) public static final int WIDGET_CATEGORY_NOT_KEYGUARD = 8; /** @hide */ @IntDef(flag = true, prefix = { "FLAG_" }, value = { WIDGET_CATEGORY_HOME_SCREEN, WIDGET_CATEGORY_KEYGUARD, WIDGET_CATEGORY_SEARCHBOX, WIDGET_CATEGORY_NOT_KEYGUARD, }) @Retention(RetentionPolicy.SOURCE) public @interface CategoryFlags {} Loading
core/java/android/appwidget/flags.aconfig +9 −0 Original line number Diff line number Diff line Loading @@ -83,3 +83,12 @@ flag { is_exported: true is_fixed_read_only: true } flag { name: "not_keyguard_category" namespace: "app_widgets" description: "Adds the NOT_KEYGUARD category to AppWidgetInfo categories" bug: "365169792" is_exported: true is_fixed_read_only: true }
core/res/res/values/attrs.xml +2 −0 Original line number Diff line number Diff line Loading @@ -9244,6 +9244,8 @@ <flag name="home_screen" value="0x1" /> <flag name="keyguard" value="0x2" /> <flag name="searchbox" value="0x4" /> <!-- @FlaggedApi("android.appwidget.flags.not_keyguard_category") --> <flag name="not_keyguard" value="0x8" /> </attr> <!-- Flags indicating various features supported by the widget. These are hints to the widget host, and do not actually change the behavior of the widget. -->