forked from https://android.googlesource.com/platform/libcore