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

Commit cb4c7c12 authored by Yogisha Dixit's avatar Yogisha Dixit
Browse files

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
parent cdef99ec
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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 = {
+1 −1
Original line number Diff line number Diff line
@@ -8154,7 +8154,7 @@
            <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" />
           <flag name="configuration_optional" value="0x4" />
        </attr>
        <!-- A resource identifier for a string containing a short description of the widget. -->
        <attr name="description" />