android_system_core/libutils/include/utils
Jiyong Park 705abe2d30 OR_RETURN supports status_t
This change provide a specialization of android::base::OkOrFail for
status_t. As a result, a statement whose type is status_t can be used
with OR_RETURN.

The specialization also provides conversion operators to Result<T,
StatusT> where StatusT is a wrapper type for status_t. This allows
OR_RETURN macro to be used in newer functions that returns Result<T,
StatusT>.

Example usage:

\#include <utils/ErrorsMacros.h>

status_t legacy_inner();

status_t legacy_outer() {
  OR_RETURN(legacy_inner());
  return OK;
}

Result<T, StatusT> new_outer() {
  OR_RETURN(legacy_inner()); // the same macro
  return T{...};
}

Bug: 209929099
Test: atest libutils_test
Change-Id: I0def0e84ce3f0c4ff6d508c202bd51902dfc9618
2022-01-12 09:20:27 +09:00
..
AndroidThreads.h Revert "Add choice for changing sched policy when setting thread priority" 2020-09-27 11:21:11 +08:00
Atomic.h
BitSet.h Soften BitSet class comment. 2020-07-16 00:04:20 +00:00
ByteOrder.h
CallStack.h
Compat.h
Condition.h
Debug.h Deprecate <utils/Debug.h>. 2020-08-17 10:07:29 -07:00
Endian.h
Errors.h
ErrorsMacros.h OR_RETURN supports status_t 2022-01-12 09:20:27 +09:00
FastStrcmp.h
FileMap.h
Flattenable.h Don't #include <utils/Debug.h> from <utils/Flattenable.h>. 2020-08-17 10:14:16 -07:00
Functor.h
JenkinsHash.h
KeyedVector.h Fix implicit cast from ssize_t to size_t in KeyedVector.h 2021-05-21 16:45:46 +00:00
LightRefBase.h libutils: LightRefBase: incStrongRequireStrong 2021-05-04 21:42:26 +00:00
List.h
Log.h
Looper.h Looper: Use sequence numbers in epoll_event to track requests 2021-09-01 14:52:52 +00:00
LruCache.h
Mutex.h
NativeHandle.h
Printer.h
ProcessCallStack.h
RWLock.h
RefBase.h libutils: group deprecated RefBase functions 2021-04-12 23:56:07 +00:00
Singleton.h
SortedVector.h
StopWatch.h libutils: remove the unused StopWatch lap functionality. 2021-05-11 16:33:47 -07:00
String8.h Revert "Revert "Remove unused String8::setPathName."" 2021-07-19 20:19:44 +00:00
String16.h libutil: no special copy from StaticString16 2021-06-30 09:04:29 +09:00
StrongPointer.h libutils: group deprecated RefBase functions 2021-04-12 23:56:07 +00:00
SystemClock.h Add docs to SystemClock.h 2021-02-23 12:14:57 -08:00
Thread.h
ThreadDefs.h
Timers.h
Tokenizer.h
Trace.h
TypeHelpers.h
Unicode.h Remove move dead code. 2021-04-15 15:18:54 -07:00
Vector.h Update language to comply with Android's inclusive language guidance 2020-07-28 15:58:25 -07:00
VectorImpl.h
misc.h
threads.h