diff options
| author | Steven Moreland <smoreland@google.com> | 2018-01-08 20:44:51 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2018-01-08 20:44:51 +0000 |
| commit | 09d9ac5819a37d397cfedbb185695992d85f8454 (patch) | |
| tree | 1c7e4425cf0e66d5248bd0fabba0bd48b99438d7 /core/java/android | |
| parent | 2ff9e7697f0dc95aa73d35b9b7238f78bbb8511e (diff) | |
| parent | 98fa8b7eb01a0d75283efdbd2e53970ca3a26832 (diff) | |
Merge "Generic Mutable class for HIDL code." am: 0f05ce94c3 am: a4ac12c3ac
am: 98fa8b7eb0
Change-Id: I0062c37e0fe119ee31b8c72396e2be706a6469a5
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/os/HidlSupport.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/java/android/os/HidlSupport.java b/core/java/android/os/HidlSupport.java index a080c8dcbcc5..4d7d9319c94e 100644 --- a/core/java/android/os/HidlSupport.java +++ b/core/java/android/os/HidlSupport.java @@ -86,6 +86,25 @@ public class HidlSupport { } /** + * 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. */ public static int deepHashCode(Object o) { |
