diff options
| author | 2019-02-04 15:28:42 -0800 | |
|---|---|---|
| committer | 2019-02-04 15:28:42 -0800 | |
| commit | f4d604feed0bccb6b67add8924e812f1a185e697 (patch) | |
| tree | 9684ce5980a1ffa85f2e28a7c8692cd189f773a6 | |
| parent | affa55b49baebce7ae1b8bb893e015379df83a49 (diff) | |
Restrict RemoteViews unsupported app usage
Bug: 123769709
Bug: 123769713
Bug: 123769498
Bug: 123769458
Change-Id: I0338faaa26a7196457f8719480ee487820993d86
| -rw-r--r-- | core/java/android/widget/RemoteViews.java | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java index 2dec4e87e662..8514b85cec00 100644 --- a/core/java/android/widget/RemoteViews.java +++ b/core/java/android/widget/RemoteViews.java @@ -206,13 +206,13 @@ public class RemoteViews implements Parcelable, Filter { * * @hide */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) public ApplicationInfo mApplication; /** * The resource ID of the layout file. (Added to the parcel) */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) private final int mLayoutId; /** @@ -224,13 +224,13 @@ public class RemoteViews implements Parcelable, Filter { * An array of actions to perform on the view tree once it has been * inflated */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) private ArrayList<Action> mActions; /** * Maps bitmaps to unique indicies to avoid Bitmap duplication. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) private BitmapCache mBitmapCache; /** @@ -252,7 +252,7 @@ public class RemoteViews implements Parcelable, Filter { * RemoteViews. */ private RemoteViews mLandscape = null; - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) private RemoteViews mPortrait = null; @ApplyFlags @@ -430,7 +430,7 @@ public class RemoteViews implements Parcelable, Filter { // Do nothing } - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) public int mergeBehavior() { return MERGE_REPLACE; } @@ -466,7 +466,7 @@ public class RemoteViews implements Parcelable, Filter { // Nothing to visit by default } - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) int viewId; } @@ -499,7 +499,7 @@ public class RemoteViews implements Parcelable, Filter { * * @hide */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) public void mergeRemoteViews(RemoteViews newRv) { if (newRv == null) return; // We first copy the new RemoteViews, as the process of merging modifies the way the actions @@ -690,7 +690,7 @@ public class RemoteViews implements Parcelable, Filter { return SET_PENDING_INTENT_TEMPLATE_TAG; } - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) PendingIntent pendingIntentTemplate; } @@ -1138,7 +1138,7 @@ public class RemoteViews implements Parcelable, Filter { private static class BitmapCache { - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) ArrayList<Bitmap> mBitmaps; int mBitmapMemory = -1; @@ -1190,9 +1190,9 @@ public class RemoteViews implements Parcelable, Filter { private class BitmapReflectionAction extends Action { int bitmapId; - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) Bitmap bitmap; - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) String methodName; BitmapReflectionAction(int viewId, String methodName, Bitmap bitmap) { @@ -1258,10 +1258,10 @@ public class RemoteViews implements Parcelable, Filter { static final int COLOR_STATE_LIST = 15; static final int ICON = 16; - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) String methodName; int type; - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) Object value; ReflectionAction(int viewId, String methodName, int type, Object value) { @@ -1554,7 +1554,7 @@ public class RemoteViews implements Parcelable, Filter { * ViewGroup methods that are related to adding Views. */ private class ViewGroupActionAdd extends Action { - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) private RemoteViews mNestedViews; private int mIndex; @@ -2469,7 +2469,7 @@ public class RemoteViews implements Parcelable, Filter { * Returns an estimate of the bitmap heap memory usage for this RemoteViews. */ /** @hide */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) public int estimateMemoryUsage() { return mBitmapCache.getBitmapMemory(); } @@ -2517,7 +2517,7 @@ public class RemoteViews implements Parcelable, Filter { * * @hide */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) public void addView(int viewId, RemoteViews nestedView, int index) { addAction(new ViewGroupActionAdd(viewId, nestedView, index)); } @@ -2992,8 +2992,9 @@ public class RemoteViews implements Parcelable, Filter { * See {@link Adapter#getViewTypeCount()}. * * @hide + * @deprecated this appears to have no users outside of UnsupportedAppUsage? */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) public void setRemoteAdapter(int viewId, ArrayList<RemoteViews> list, int viewTypeCount) { addAction(new SetRemoteViewsAdapterList(viewId, list, viewTypeCount)); } |