Loading core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -54698,6 +54698,7 @@ package android.widget { method public void setLabelFor(@IdRes int, @IdRes int); method public void setLightBackgroundLayoutId(@LayoutRes int); method public void setLong(@IdRes int, String, long); method public void setOnCheckedChangeResponse(@IdRes int, @NonNull android.widget.RemoteViews.RemoteResponse); method public void setOnClickFillInIntent(@IdRes int, android.content.Intent); method public void setOnClickPendingIntent(@IdRes int, android.app.PendingIntent); method public void setOnClickResponse(@IdRes int, @NonNull android.widget.RemoteViews.RemoteResponse); Loading @@ -54724,6 +54725,7 @@ package android.widget { method public void showPrevious(@IdRes int); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.widget.RemoteViews> CREATOR; field public static final String EXTRA_CHECKED = "android.widget.extra.CHECKED"; field public static final String EXTRA_SHARED_ELEMENT_BOUNDS = "android.widget.extra.SHARED_ELEMENT_BOUNDS"; } core/java/android/appwidget/AppWidgetHost.java +6 −6 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ import android.os.ServiceManager; import android.util.DisplayMetrics; import android.util.SparseArray; import android.widget.RemoteViews; import android.widget.RemoteViews.OnClickHandler; import android.widget.RemoteViews.InteractionHandler; import com.android.internal.R; import com.android.internal.appwidget.IAppWidgetHost; Loading Loading @@ -71,7 +71,7 @@ public class AppWidgetHost { private final int mHostId; private final Callbacks mCallbacks; private final SparseArray<AppWidgetHostView> mViews = new SparseArray<>(); private OnClickHandler mOnClickHandler; private InteractionHandler mInteractionHandler; static class Callbacks extends IAppWidgetHost.Stub { private final WeakReference<Handler> mWeakHandler; Loading Loading @@ -175,10 +175,10 @@ public class AppWidgetHost { * @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public AppWidgetHost(Context context, int hostId, OnClickHandler handler, Looper looper) { public AppWidgetHost(Context context, int hostId, InteractionHandler handler, Looper looper) { mContextOpPackageName = context.getOpPackageName(); mHostId = hostId; mOnClickHandler = handler; mInteractionHandler = handler; mHandler = new UpdateHandler(looper); mCallbacks = new Callbacks(mHandler); mDisplayMetrics = context.getResources().getDisplayMetrics(); Loading Loading @@ -401,7 +401,7 @@ public class AppWidgetHost { return null; } AppWidgetHostView view = onCreateView(context, appWidgetId, appWidget); view.setOnClickHandler(mOnClickHandler); view.setInteractionHandler(mInteractionHandler); view.setAppWidget(appWidgetId, appWidget); synchronized (mViews) { mViews.put(appWidgetId, view); Loading @@ -423,7 +423,7 @@ public class AppWidgetHost { */ protected AppWidgetHostView onCreateView(Context context, int appWidgetId, AppWidgetProviderInfo appWidget) { return new AppWidgetHostView(context, mOnClickHandler); return new AppWidgetHostView(context, mInteractionHandler); } /** Loading core/java/android/appwidget/AppWidgetHostView.java +13 −13 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.FrameLayout; import android.widget.RemoteViews; import android.widget.RemoteViews.OnClickHandler; import android.widget.RemoteViews.InteractionHandler; import android.widget.RemoteViewsAdapter.RemoteAdapterConnectionCallback; import android.widget.TextView; Loading Loading @@ -90,7 +90,7 @@ public class AppWidgetHostView extends FrameLayout { View mView; int mViewMode = VIEW_MODE_NOINIT; int mLayoutId = -1; private OnClickHandler mOnClickHandler; private InteractionHandler mInteractionHandler; private boolean mOnLightBackground; PointF mCurrentSize = null; Loading @@ -107,9 +107,9 @@ public class AppWidgetHostView extends FrameLayout { /** * @hide */ public AppWidgetHostView(Context context, OnClickHandler handler) { public AppWidgetHostView(Context context, InteractionHandler handler) { this(context, android.R.anim.fade_in, android.R.anim.fade_out); mOnClickHandler = getHandler(handler); mInteractionHandler = getHandler(handler); } /** Loading @@ -135,8 +135,8 @@ public class AppWidgetHostView extends FrameLayout { * @param handler * @hide */ public void setOnClickHandler(OnClickHandler handler) { mOnClickHandler = getHandler(handler); public void setInteractionHandler(InteractionHandler handler) { mInteractionHandler = getHandler(handler); } /** Loading Loading @@ -518,7 +518,7 @@ public class AppWidgetHostView extends FrameLayout { // layout matches, try recycling it if (content == null && layoutId == mLayoutId) { try { remoteViews.reapply(mContext, mView, mOnClickHandler); remoteViews.reapply(mContext, mView, mInteractionHandler); content = mView; recycled = true; if (LOGD) Log.d(TAG, "was able to recycle existing layout"); Loading @@ -530,7 +530,7 @@ public class AppWidgetHostView extends FrameLayout { // Try normal RemoteView inflation if (content == null) { try { content = remoteViews.apply(mContext, this, mOnClickHandler, mCurrentSize); content = remoteViews.apply(mContext, this, mInteractionHandler, mCurrentSize); if (LOGD) Log.d(TAG, "had to inflate new layout"); } catch (RuntimeException e) { exception = e; Loading Loading @@ -582,7 +582,7 @@ public class AppWidgetHostView extends FrameLayout { mView, mAsyncExecutor, new ViewApplyListener(remoteViews, layoutId, true), mOnClickHandler, mInteractionHandler, mCurrentSize); } catch (Exception e) { // Reapply failed. Try apply Loading @@ -593,7 +593,7 @@ public class AppWidgetHostView extends FrameLayout { this, mAsyncExecutor, new ViewApplyListener(remoteViews, layoutId, false), mOnClickHandler, mInteractionHandler, mCurrentSize); } } Loading Loading @@ -625,7 +625,7 @@ public class AppWidgetHostView extends FrameLayout { AppWidgetHostView.this, mAsyncExecutor, new ViewApplyListener(mViews, mLayoutId, false), mOnClickHandler, mInteractionHandler, mCurrentSize); } else { applyContent(null, false, e); Loading Loading @@ -808,11 +808,11 @@ public class AppWidgetHostView extends FrameLayout { return null; } private OnClickHandler getHandler(OnClickHandler handler) { private InteractionHandler getHandler(InteractionHandler handler) { return (view, pendingIntent, response) -> { AppWidgetManager.getInstance(mContext).noteAppWidgetTapped(mAppWidgetId); if (handler != null) { return handler.onClickHandler(view, pendingIntent, response); return handler.onInteraction(view, pendingIntent, response); } else { return RemoteViews.startPendingIntent(view, pendingIntent, response.getLaunchOptions(view)); Loading core/java/android/widget/AbsListView.java +3 −3 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.SurroundingText; import android.view.inspector.InspectableProperty; import android.view.inspector.InspectableProperty.EnumEntry; import android.widget.RemoteViews.OnClickHandler; import android.widget.RemoteViews.InteractionHandler; import com.android.internal.R; Loading Loading @@ -6419,11 +6419,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te * * @hide */ public void setRemoteViewsOnClickHandler(OnClickHandler handler) { public void setRemoteViewsInteractionHandler(InteractionHandler handler) { // Ensure that we don't already have a RemoteViewsAdapter that is bound to an existing // service handling the specified intent. if (mRemoteAdapter != null) { mRemoteAdapter.setRemoteViewsOnClickHandler(handler); mRemoteAdapter.setRemoteViewsInteractionHandler(handler); } } Loading core/java/android/widget/AdapterViewAnimator.java +3 −3 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; import android.view.ViewGroup; import android.widget.RemoteViews.OnClickHandler; import android.widget.RemoteViews.InteractionHandler; import java.util.ArrayList; import java.util.HashMap; Loading Loading @@ -1016,11 +1016,11 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter> * * @hide */ public void setRemoteViewsOnClickHandler(OnClickHandler handler) { public void setRemoteViewsOnClickHandler(InteractionHandler handler) { // Ensure that we don't already have a RemoteViewsAdapter that is bound to an existing // service handling the specified intent. if (mRemoteViewsAdapter != null) { mRemoteViewsAdapter.setRemoteViewsOnClickHandler(handler); mRemoteViewsAdapter.setRemoteViewsInteractionHandler(handler); } } Loading Loading
core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -54698,6 +54698,7 @@ package android.widget { method public void setLabelFor(@IdRes int, @IdRes int); method public void setLightBackgroundLayoutId(@LayoutRes int); method public void setLong(@IdRes int, String, long); method public void setOnCheckedChangeResponse(@IdRes int, @NonNull android.widget.RemoteViews.RemoteResponse); method public void setOnClickFillInIntent(@IdRes int, android.content.Intent); method public void setOnClickPendingIntent(@IdRes int, android.app.PendingIntent); method public void setOnClickResponse(@IdRes int, @NonNull android.widget.RemoteViews.RemoteResponse); Loading @@ -54724,6 +54725,7 @@ package android.widget { method public void showPrevious(@IdRes int); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.widget.RemoteViews> CREATOR; field public static final String EXTRA_CHECKED = "android.widget.extra.CHECKED"; field public static final String EXTRA_SHARED_ELEMENT_BOUNDS = "android.widget.extra.SHARED_ELEMENT_BOUNDS"; }
core/java/android/appwidget/AppWidgetHost.java +6 −6 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ import android.os.ServiceManager; import android.util.DisplayMetrics; import android.util.SparseArray; import android.widget.RemoteViews; import android.widget.RemoteViews.OnClickHandler; import android.widget.RemoteViews.InteractionHandler; import com.android.internal.R; import com.android.internal.appwidget.IAppWidgetHost; Loading Loading @@ -71,7 +71,7 @@ public class AppWidgetHost { private final int mHostId; private final Callbacks mCallbacks; private final SparseArray<AppWidgetHostView> mViews = new SparseArray<>(); private OnClickHandler mOnClickHandler; private InteractionHandler mInteractionHandler; static class Callbacks extends IAppWidgetHost.Stub { private final WeakReference<Handler> mWeakHandler; Loading Loading @@ -175,10 +175,10 @@ public class AppWidgetHost { * @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public AppWidgetHost(Context context, int hostId, OnClickHandler handler, Looper looper) { public AppWidgetHost(Context context, int hostId, InteractionHandler handler, Looper looper) { mContextOpPackageName = context.getOpPackageName(); mHostId = hostId; mOnClickHandler = handler; mInteractionHandler = handler; mHandler = new UpdateHandler(looper); mCallbacks = new Callbacks(mHandler); mDisplayMetrics = context.getResources().getDisplayMetrics(); Loading Loading @@ -401,7 +401,7 @@ public class AppWidgetHost { return null; } AppWidgetHostView view = onCreateView(context, appWidgetId, appWidget); view.setOnClickHandler(mOnClickHandler); view.setInteractionHandler(mInteractionHandler); view.setAppWidget(appWidgetId, appWidget); synchronized (mViews) { mViews.put(appWidgetId, view); Loading @@ -423,7 +423,7 @@ public class AppWidgetHost { */ protected AppWidgetHostView onCreateView(Context context, int appWidgetId, AppWidgetProviderInfo appWidget) { return new AppWidgetHostView(context, mOnClickHandler); return new AppWidgetHostView(context, mInteractionHandler); } /** Loading
core/java/android/appwidget/AppWidgetHostView.java +13 −13 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.FrameLayout; import android.widget.RemoteViews; import android.widget.RemoteViews.OnClickHandler; import android.widget.RemoteViews.InteractionHandler; import android.widget.RemoteViewsAdapter.RemoteAdapterConnectionCallback; import android.widget.TextView; Loading Loading @@ -90,7 +90,7 @@ public class AppWidgetHostView extends FrameLayout { View mView; int mViewMode = VIEW_MODE_NOINIT; int mLayoutId = -1; private OnClickHandler mOnClickHandler; private InteractionHandler mInteractionHandler; private boolean mOnLightBackground; PointF mCurrentSize = null; Loading @@ -107,9 +107,9 @@ public class AppWidgetHostView extends FrameLayout { /** * @hide */ public AppWidgetHostView(Context context, OnClickHandler handler) { public AppWidgetHostView(Context context, InteractionHandler handler) { this(context, android.R.anim.fade_in, android.R.anim.fade_out); mOnClickHandler = getHandler(handler); mInteractionHandler = getHandler(handler); } /** Loading @@ -135,8 +135,8 @@ public class AppWidgetHostView extends FrameLayout { * @param handler * @hide */ public void setOnClickHandler(OnClickHandler handler) { mOnClickHandler = getHandler(handler); public void setInteractionHandler(InteractionHandler handler) { mInteractionHandler = getHandler(handler); } /** Loading Loading @@ -518,7 +518,7 @@ public class AppWidgetHostView extends FrameLayout { // layout matches, try recycling it if (content == null && layoutId == mLayoutId) { try { remoteViews.reapply(mContext, mView, mOnClickHandler); remoteViews.reapply(mContext, mView, mInteractionHandler); content = mView; recycled = true; if (LOGD) Log.d(TAG, "was able to recycle existing layout"); Loading @@ -530,7 +530,7 @@ public class AppWidgetHostView extends FrameLayout { // Try normal RemoteView inflation if (content == null) { try { content = remoteViews.apply(mContext, this, mOnClickHandler, mCurrentSize); content = remoteViews.apply(mContext, this, mInteractionHandler, mCurrentSize); if (LOGD) Log.d(TAG, "had to inflate new layout"); } catch (RuntimeException e) { exception = e; Loading Loading @@ -582,7 +582,7 @@ public class AppWidgetHostView extends FrameLayout { mView, mAsyncExecutor, new ViewApplyListener(remoteViews, layoutId, true), mOnClickHandler, mInteractionHandler, mCurrentSize); } catch (Exception e) { // Reapply failed. Try apply Loading @@ -593,7 +593,7 @@ public class AppWidgetHostView extends FrameLayout { this, mAsyncExecutor, new ViewApplyListener(remoteViews, layoutId, false), mOnClickHandler, mInteractionHandler, mCurrentSize); } } Loading Loading @@ -625,7 +625,7 @@ public class AppWidgetHostView extends FrameLayout { AppWidgetHostView.this, mAsyncExecutor, new ViewApplyListener(mViews, mLayoutId, false), mOnClickHandler, mInteractionHandler, mCurrentSize); } else { applyContent(null, false, e); Loading Loading @@ -808,11 +808,11 @@ public class AppWidgetHostView extends FrameLayout { return null; } private OnClickHandler getHandler(OnClickHandler handler) { private InteractionHandler getHandler(InteractionHandler handler) { return (view, pendingIntent, response) -> { AppWidgetManager.getInstance(mContext).noteAppWidgetTapped(mAppWidgetId); if (handler != null) { return handler.onClickHandler(view, pendingIntent, response); return handler.onInteraction(view, pendingIntent, response); } else { return RemoteViews.startPendingIntent(view, pendingIntent, response.getLaunchOptions(view)); Loading
core/java/android/widget/AbsListView.java +3 −3 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.SurroundingText; import android.view.inspector.InspectableProperty; import android.view.inspector.InspectableProperty.EnumEntry; import android.widget.RemoteViews.OnClickHandler; import android.widget.RemoteViews.InteractionHandler; import com.android.internal.R; Loading Loading @@ -6419,11 +6419,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te * * @hide */ public void setRemoteViewsOnClickHandler(OnClickHandler handler) { public void setRemoteViewsInteractionHandler(InteractionHandler handler) { // Ensure that we don't already have a RemoteViewsAdapter that is bound to an existing // service handling the specified intent. if (mRemoteAdapter != null) { mRemoteAdapter.setRemoteViewsOnClickHandler(handler); mRemoteAdapter.setRemoteViewsInteractionHandler(handler); } } Loading
core/java/android/widget/AdapterViewAnimator.java +3 −3 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; import android.view.ViewGroup; import android.widget.RemoteViews.OnClickHandler; import android.widget.RemoteViews.InteractionHandler; import java.util.ArrayList; import java.util.HashMap; Loading Loading @@ -1016,11 +1016,11 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter> * * @hide */ public void setRemoteViewsOnClickHandler(OnClickHandler handler) { public void setRemoteViewsOnClickHandler(InteractionHandler handler) { // Ensure that we don't already have a RemoteViewsAdapter that is bound to an existing // service handling the specified intent. if (mRemoteViewsAdapter != null) { mRemoteViewsAdapter.setRemoteViewsOnClickHandler(handler); mRemoteViewsAdapter.setRemoteViewsInteractionHandler(handler); } } Loading