Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a14ba56 authored by Alan Viverette's avatar Alan Viverette
Browse files

Manually merge 23bb5bf2 to fix APIs

Also updates documentation for RemoteViews clone to reflect the ISE;
however, the implementation is still incorrect and the method should be
deprecated and replaced with a copy constructor.

Bug: 62576297
Test: make -j32
Change-Id: I72dea99fa45a838d22eb54190a0f26a15e8ba766
parent 01762d4f
Loading
Loading
Loading
Loading
+24 −15
Original line number Diff line number Diff line
@@ -2417,8 +2417,16 @@ public class RemoteViews implements Parcelable, Filter {
        recalculateMemoryUsage();
    }


    public synchronized RemoteViews clone() {
    /**
     * Returns a deep copy of the RemoteViews object. The RemoteView may not be
     * attached to another RemoteView -- it must be the root of a hierarchy.
     *
     * @throws IllegalStateException if this is not the root of a RemoteView
     *         hierarchy
     */
    @Override
    public RemoteViews clone() {
        synchronized (this) {
            Preconditions.checkState(mIsRoot, "RemoteView has been attached to another RemoteView. "
                    + "May only clone the root of a RemoteView hierarchy.");

@@ -2437,6 +2445,7 @@ public class RemoteViews implements Parcelable, Filter {
            p.recycle();
            return rv;
        }
    }

    public String getPackage() {
        return (mApplication != null) ? mApplication.packageName : null;