From cb4c7c1286a010814797d1f2c1350792ef309d6a Mon Sep 17 00:00:00 2001 From: Yogisha Dixit Date: Wed, 3 Mar 2021 20:53:45 +0000 Subject: [PATCH] Fix flag value for configuration_optional widget feature. The flag value should be 4 and not 3 so that we can use bitwise operations to determine the existence of a flag. For example, we want to use the following to determine if a widget is reconfigurable: (providerInfo.widgetFeatures & WIDGET_FEATURE_RECONFIGURABLE) != 0 But if the value of WIDGET_FEATURE_CONFIGURATION_OPTIONAL is 3, the above check would fail. Test: atest FrameworksServicesTests:AppWidgetServiceImplTest, atest CtsAppWidgetTestCases Bug: 177977976 Change-Id: I15d4baae5e17acb9a0b936485a53f9b3359d65ca --- core/api/current.txt | 2 +- core/java/android/appwidget/AppWidgetProviderInfo.java | 2 +- core/res/res/values/attrs.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index 8710e613602f6..69e4d09e8588d 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -8474,7 +8474,7 @@ package android.appwidget { 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_SEARCHBOX = 4; // 0x4 - field public static final int WIDGET_FEATURE_CONFIGURATION_OPTIONAL = 3; // 0x3 + field public static final int WIDGET_FEATURE_CONFIGURATION_OPTIONAL = 4; // 0x4 field public static final int WIDGET_FEATURE_HIDE_FROM_PICKER = 2; // 0x2 field public static final int WIDGET_FEATURE_RECONFIGURABLE = 1; // 0x1 field public int autoAdvanceViewId; diff --git a/core/java/android/appwidget/AppWidgetProviderInfo.java b/core/java/android/appwidget/AppWidgetProviderInfo.java index 6ac1c1ae61ec5..1cbb2fb3a8a39 100644 --- a/core/java/android/appwidget/AppWidgetProviderInfo.java +++ b/core/java/android/appwidget/AppWidgetProviderInfo.java @@ -121,7 +121,7 @@ public class AppWidgetProviderInfo implements Parcelable { * * @see #widgetFeatures */ - public static final int WIDGET_FEATURE_CONFIGURATION_OPTIONAL = 3; + public static final int WIDGET_FEATURE_CONFIGURATION_OPTIONAL = 4; /** @hide */ @IntDef(flag = true, prefix = { "FLAG_" }, value = { diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 100983bcef0df..bb8d4139a1615 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -8154,7 +8154,7 @@ - +