Skip to content
Commit 4bfa2ebb authored by Steven Moreland's avatar Steven Moreland
Browse files

Generic Mutable class for HIDL code.

In general, using Mutable inside of structures
or as API arguments is a code smell. However, it
is the most syntactically clean way of fetching
something out of a lambda or inner class.

Using this, one can do:
Mutable<Result> res = new Mutable<>();
hidlObject.foo((...) -> {
    res.value = ...;
});

There is an alternative:
Result a[] = new Result[1];
hidlObject.foo((...) -> {
    a[0] = ...;
});

However, this alternative syntax is relatively messy.

Bug: N/A
Test: boot, use w/ wifi
Change-Id: Ibff13c653cc17bd25ddbb0534ba21ef485bff7aa
parent ae81e15c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment