Loading core/api/current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -8452,7 +8452,7 @@ package android.appwidget { method public int describeContents(); method public final android.os.UserHandle getProfile(); method @NonNull public android.content.pm.ActivityInfo getProviderInfo(); method @Nullable public final String loadDescription(@NonNull android.content.Context); method @Nullable public final CharSequence loadDescription(@NonNull android.content.Context); method public final android.graphics.drawable.Drawable loadIcon(@NonNull android.content.Context, int); method public final String loadLabel(android.content.pm.PackageManager); method public final android.graphics.drawable.Drawable loadPreviewImage(@NonNull android.content.Context, int); Loading @@ -8470,7 +8470,7 @@ package android.appwidget { field public static final int WIDGET_FEATURE_RECONFIGURABLE = 1; // 0x1 field public int autoAdvanceViewId; field public android.content.ComponentName configure; field @IdRes public int descriptionResource; field @IdRes public int descriptionRes; field public int icon; field public int initialKeyguardLayout; field public int initialLayout; core/java/android/appwidget/AppWidgetProviderInfo.java +17 −8 Original line number Diff line number Diff line Loading @@ -332,12 +332,13 @@ public class AppWidgetProviderInfo implements Parcelable { /** * Resource id for the description of the AppWidget. * * <p>This field corresponds to the <code>android:description</code> attribute in the AppWidget * meta-data file. */ @SuppressLint("MutableBareField") @IdRes public int descriptionResource; public int descriptionRes; /** * Flags indicating various features supported by the widget. These are hints to the widget Loading Loading @@ -385,7 +386,7 @@ public class AppWidgetProviderInfo implements Parcelable { this.widgetCategory = in.readInt(); this.providerInfo = in.readTypedObject(ActivityInfo.CREATOR); this.widgetFeatures = in.readInt(); this.descriptionResource = in.readInt(); this.descriptionRes = in.readInt(); } /** Loading Loading @@ -442,14 +443,22 @@ public class AppWidgetProviderInfo implements Parcelable { return loadDrawable(context, density, previewImage, false); } /** Loads localized description for the app widget. */ /** * Loads localized description for the app widget. * * <p>Description is intended to be displayed in the UI of the widget picker. * * @param context Context for accessing resources. * * @return CharSequence for app widget description for the current locale. */ @Nullable public final String loadDescription(@NonNull Context context) { if (ResourceId.isValid(descriptionResource)) { public final CharSequence loadDescription(@NonNull Context context) { if (ResourceId.isValid(descriptionRes)) { return context.getPackageManager() .getText( providerInfo.packageName, descriptionResource, descriptionRes, providerInfo.applicationInfo) .toString() .trim(); Loading Loading @@ -499,7 +508,7 @@ public class AppWidgetProviderInfo implements Parcelable { out.writeInt(this.widgetCategory); out.writeTypedObject(this.providerInfo, flags); out.writeInt(this.widgetFeatures); out.writeInt(this.descriptionResource); out.writeInt(this.descriptionRes); } @Override Loading Loading @@ -528,7 +537,7 @@ public class AppWidgetProviderInfo implements Parcelable { that.widgetCategory = this.widgetCategory; that.providerInfo = this.providerInfo; that.widgetFeatures = this.widgetFeatures; that.descriptionResource = this.descriptionResource; that.descriptionRes = this.descriptionRes; return that; } Loading services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -2673,7 +2673,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku AppWidgetProviderInfo.WIDGET_CATEGORY_HOME_SCREEN); info.widgetFeatures = sa.getInt( com.android.internal.R.styleable.AppWidgetProviderInfo_widgetFeatures, 0); info.descriptionResource = sa.getResourceId( info.descriptionRes = sa.getResourceId( com.android.internal.R.styleable.AppWidgetProviderInfo_description, Resources.ID_NULL); sa.recycle(); Loading Loading
core/api/current.txt +2 −2 Original line number Diff line number Diff line Loading @@ -8452,7 +8452,7 @@ package android.appwidget { method public int describeContents(); method public final android.os.UserHandle getProfile(); method @NonNull public android.content.pm.ActivityInfo getProviderInfo(); method @Nullable public final String loadDescription(@NonNull android.content.Context); method @Nullable public final CharSequence loadDescription(@NonNull android.content.Context); method public final android.graphics.drawable.Drawable loadIcon(@NonNull android.content.Context, int); method public final String loadLabel(android.content.pm.PackageManager); method public final android.graphics.drawable.Drawable loadPreviewImage(@NonNull android.content.Context, int); Loading @@ -8470,7 +8470,7 @@ package android.appwidget { field public static final int WIDGET_FEATURE_RECONFIGURABLE = 1; // 0x1 field public int autoAdvanceViewId; field public android.content.ComponentName configure; field @IdRes public int descriptionResource; field @IdRes public int descriptionRes; field public int icon; field public int initialKeyguardLayout; field public int initialLayout;
core/java/android/appwidget/AppWidgetProviderInfo.java +17 −8 Original line number Diff line number Diff line Loading @@ -332,12 +332,13 @@ public class AppWidgetProviderInfo implements Parcelable { /** * Resource id for the description of the AppWidget. * * <p>This field corresponds to the <code>android:description</code> attribute in the AppWidget * meta-data file. */ @SuppressLint("MutableBareField") @IdRes public int descriptionResource; public int descriptionRes; /** * Flags indicating various features supported by the widget. These are hints to the widget Loading Loading @@ -385,7 +386,7 @@ public class AppWidgetProviderInfo implements Parcelable { this.widgetCategory = in.readInt(); this.providerInfo = in.readTypedObject(ActivityInfo.CREATOR); this.widgetFeatures = in.readInt(); this.descriptionResource = in.readInt(); this.descriptionRes = in.readInt(); } /** Loading Loading @@ -442,14 +443,22 @@ public class AppWidgetProviderInfo implements Parcelable { return loadDrawable(context, density, previewImage, false); } /** Loads localized description for the app widget. */ /** * Loads localized description for the app widget. * * <p>Description is intended to be displayed in the UI of the widget picker. * * @param context Context for accessing resources. * * @return CharSequence for app widget description for the current locale. */ @Nullable public final String loadDescription(@NonNull Context context) { if (ResourceId.isValid(descriptionResource)) { public final CharSequence loadDescription(@NonNull Context context) { if (ResourceId.isValid(descriptionRes)) { return context.getPackageManager() .getText( providerInfo.packageName, descriptionResource, descriptionRes, providerInfo.applicationInfo) .toString() .trim(); Loading Loading @@ -499,7 +508,7 @@ public class AppWidgetProviderInfo implements Parcelable { out.writeInt(this.widgetCategory); out.writeTypedObject(this.providerInfo, flags); out.writeInt(this.widgetFeatures); out.writeInt(this.descriptionResource); out.writeInt(this.descriptionRes); } @Override Loading Loading @@ -528,7 +537,7 @@ public class AppWidgetProviderInfo implements Parcelable { that.widgetCategory = this.widgetCategory; that.providerInfo = this.providerInfo; that.widgetFeatures = this.widgetFeatures; that.descriptionResource = this.descriptionResource; that.descriptionRes = this.descriptionRes; return that; } Loading
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -2673,7 +2673,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku AppWidgetProviderInfo.WIDGET_CATEGORY_HOME_SCREEN); info.widgetFeatures = sa.getInt( com.android.internal.R.styleable.AppWidgetProviderInfo_widgetFeatures, 0); info.descriptionResource = sa.getResourceId( info.descriptionRes = sa.getResourceId( com.android.internal.R.styleable.AppWidgetProviderInfo_description, Resources.ID_NULL); sa.recycle(); Loading