diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2017-06-12 16:26:53 -0600 |
|---|---|---|
| committer | Jeff Sharkey <jsharkey@android.com> | 2017-06-12 16:26:53 -0600 |
| commit | 90396365357c745070145a87b6036e6bb07cbae8 (patch) | |
| tree | b5c1da691037ea894a5612f88461fa44e1a4ad5e /core/java/android/widget/RemoteViews.java | |
| parent | bb0d895b9b097887b77c14cafab542c33eabd510 (diff) | |
Revert "Hide APIs not intended to ship in DR."
This reverts commit 0c28d43fe1423198f99a0518887b69a4205bc6f7.
Diffstat (limited to 'core/java/android/widget/RemoteViews.java')
| -rw-r--r-- | core/java/android/widget/RemoteViews.java | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java index d2b9018e7abd..af459855c53d 100644 --- a/core/java/android/widget/RemoteViews.java +++ b/core/java/android/widget/RemoteViews.java @@ -2418,26 +2418,24 @@ public class RemoteViews implements Parcelable, Filter { } - public RemoteViews clone() { - synchronized (this) { - Preconditions.checkState(mIsRoot, "RemoteView has been attached to another RemoteView. " - + "May only clone the root of a RemoteView hierarchy."); + public synchronized RemoteViews clone() { + Preconditions.checkState(mIsRoot, "RemoteView has been attached to another RemoteView. " + + "May only clone the root of a RemoteView hierarchy."); - Parcel p = Parcel.obtain(); + Parcel p = Parcel.obtain(); - // Do not parcel the Bitmap cache - doing so creates an expensive copy of all bitmaps. - // Instead pretend we're not owning the cache while parceling. - mIsRoot = false; - writeToParcel(p, PARCELABLE_ELIDE_DUPLICATES); - p.setDataPosition(0); - mIsRoot = true; + // Do not parcel the Bitmap cache - doing so creates an expensive copy of all bitmaps. + // Instead pretend we're not owning the cache while parceling. + mIsRoot = false; + writeToParcel(p, PARCELABLE_ELIDE_DUPLICATES); + p.setDataPosition(0); + mIsRoot = true; - RemoteViews rv = new RemoteViews(p, mBitmapCache.clone(), mApplication, 0); - rv.mIsRoot = true; + RemoteViews rv = new RemoteViews(p, mBitmapCache.clone(), mApplication, 0); + rv.mIsRoot = true; - p.recycle(); - return rv; - } + p.recycle(); + return rv; } public String getPackage() { |
