Merge "Derestrict some APIs used by tests." am: 8149880e34 am: 3d29934b33 am: 6dea5d8102

Original change: https://android-review.googlesource.com/c/platform/libcore/+/1485856

Change-Id: Ifec32d0e756f0f28c27c0f0d550062c6f6e5d323