From 1fcd0c7132d836c6ab5aaee5a0f834810beff4ee Mon Sep 17 00:00:00 2001 From: Sihua Ma Date: Fri, 12 Jan 2024 00:13:58 +0000 Subject: Revert "Deprecate notifyAppWidgetViewDataChanged" This reverts commit e61404814947b611c68853050a4a22aeebe728bc. Reason for revert: Delay @Deprecated annotation (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:9bed3e0364c87c75f80d7f356ec89122a2396744) Merged-In: I6714a25a77e54eaac3f0953e58298385650bd55e Change-Id: I6714a25a77e54eaac3f0953e58298385650bd55e --- core/api/current.txt | 4 ++-- core/java/android/appwidget/AppWidgetManager.java | 26 ++--------------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index 1b5c953c21c6..690e023b225f 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -9478,8 +9478,8 @@ package android.appwidget { method @NonNull public java.util.List getInstalledProvidersForProfile(@Nullable android.os.UserHandle); method public static android.appwidget.AppWidgetManager getInstance(android.content.Context); method public boolean isRequestPinAppWidgetSupported(); - method @Deprecated public void notifyAppWidgetViewDataChanged(int[], int); - method @Deprecated public void notifyAppWidgetViewDataChanged(int, int); + method public void notifyAppWidgetViewDataChanged(int[], int); + method public void notifyAppWidgetViewDataChanged(int, int); method public void partiallyUpdateAppWidget(int[], android.widget.RemoteViews); method public void partiallyUpdateAppWidget(int, android.widget.RemoteViews); method public boolean requestPinAppWidget(@NonNull android.content.ComponentName, @Nullable android.os.Bundle, @Nullable android.app.PendingIntent); diff --git a/core/java/android/appwidget/AppWidgetManager.java b/core/java/android/appwidget/AppWidgetManager.java index 4cf9fcab9092..356ffd477780 100644 --- a/core/java/android/appwidget/AppWidgetManager.java +++ b/core/java/android/appwidget/AppWidgetManager.java @@ -820,18 +820,7 @@ public class AppWidgetManager { * * @param appWidgetIds The AppWidget instances to notify of view data changes. * @param viewId The collection view id. - * @deprecated The corresponding API - * {@link RemoteViews#setRemoteAdapter(int, Intent)} associated with this method has been - * deprecated. Moving forward please use - * {@link RemoteViews#setRemoteAdapter(int, android.widget.RemoteViews.RemoteCollectionItems)} - * instead to set {@link android.widget.RemoteViews.RemoteCollectionItems} for the remote - * adapter and update the widget views by calling {@link #updateAppWidget(int[], RemoteViews)}, - * {@link #updateAppWidget(int, RemoteViews)}, - * {@link #updateAppWidget(ComponentName, RemoteViews)}, - * {@link #partiallyUpdateAppWidget(int[], RemoteViews)}, - * or {@link #partiallyUpdateAppWidget(int, RemoteViews)}, whichever applicable. - */ - @Deprecated + */ public void notifyAppWidgetViewDataChanged(int[] appWidgetIds, int viewId) { if (mService == null) { return; @@ -882,18 +871,7 @@ public class AppWidgetManager { * * @param appWidgetId The AppWidget instance to notify of view data changes. * @param viewId The collection view id. - * @deprecated The corresponding API - * {@link RemoteViews#setRemoteAdapter(int, Intent)} associated with this method has been - * deprecated. Moving forward please use - * {@link RemoteViews#setRemoteAdapter(int, android.widget.RemoteViews.RemoteCollectionItems)} - * instead to set {@link android.widget.RemoteViews.RemoteCollectionItems} for the remote - * adapter and update the widget views by calling {@link #updateAppWidget(int[], RemoteViews)}, - * {@link #updateAppWidget(int, RemoteViews)}, - * {@link #updateAppWidget(ComponentName, RemoteViews)}, - * {@link #partiallyUpdateAppWidget(int[], RemoteViews)}, - * or {@link #partiallyUpdateAppWidget(int, RemoteViews)}, whichever applicable. - */ - @Deprecated + */ public void notifyAppWidgetViewDataChanged(int appWidgetId, int viewId) { if (mService == null) { return; -- cgit v1.2.3 From 6ee349657118ba1a3a9c21b6aeae77335f420b30 Mon Sep 17 00:00:00 2001 From: Sihua Ma Date: Fri, 12 Jan 2024 00:19:12 +0000 Subject: Revert "Deprecate setRemoteAdapter that takes service intent" This reverts commit 3cca6996a46b212d37295d46d824e32cf968124d. Reason for revert: Delay @Deprecated annotation (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:511e868a723c4322d1b4c66ea92ef91ddfdcdc91) Merged-In: Id009fd46ccbf7ad9336d6edab8e835f4e4065d08 Change-Id: Id009fd46ccbf7ad9336d6edab8e835f4e4065d08 --- core/api/current.txt | 2 +- core/java/android/widget/RemoteViews.java | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index 690e023b225f..9b5316fb79b5 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -59609,7 +59609,7 @@ package android.widget { method public void setRadioGroupChecked(@IdRes int, @IdRes int); method public void setRelativeScrollPosition(@IdRes int, int); method @Deprecated public void setRemoteAdapter(int, @IdRes int, android.content.Intent); - method @Deprecated public void setRemoteAdapter(@IdRes int, android.content.Intent); + method public void setRemoteAdapter(@IdRes int, android.content.Intent); method public void setRemoteAdapter(@IdRes int, @NonNull android.widget.RemoteViews.RemoteCollectionItems); method public void setScrollPosition(@IdRes int, int); method public void setShort(@IdRes int, String, short); diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java index 8ad10af7250a..0dd12bae4664 100644 --- a/core/java/android/widget/RemoteViews.java +++ b/core/java/android/widget/RemoteViews.java @@ -4944,10 +4944,7 @@ public class RemoteViews implements Parcelable, Filter { * @param viewId The id of the {@link AdapterView} * @param intent The intent of the service which will be * providing data to the RemoteViewsAdapter - * @deprecated use - * {@link #setRemoteAdapter(int, android.widget.RemoteViews.RemoteCollectionItems)} instead */ - @Deprecated public void setRemoteAdapter(@IdRes int viewId, Intent intent) { if (remoteAdapterConversion()) { addAction(new SetRemoteCollectionItemListAdapterAction(viewId, intent)); -- cgit v1.2.3