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

Commit a4ac12c3 authored by Steven Moreland's avatar Steven Moreland Committed by android-build-merger
Browse files

Merge "Generic Mutable class for HIDL code."

am: 0f05ce94

Change-Id: I8ee4b650b96279efe26bdacb4d09a6a0317960e7
parents 37f987d7 0f05ce94
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -85,6 +85,25 @@ public class HidlSupport {
        return lft.equals(rgt);
    }

    /**
     * Class which can be used to fetch an object out of a lambda. Fetching an object
     * out of a local scope with HIDL is a common operation (although usually it can
     * and should be avoided).
     *
     * @param <E> Inner object type.
     */
    public static final class Mutable<E> {
        public E value;

        public Mutable() {
            value = null;
        }

        public Mutable(E value) {
            this.value = value;
        }
    }

    /**
     * Similar to Arrays.deepHashCode, but also take care of lists.
     */