Merge cherrypicks of [1816840] into ndk-release-r23.

Change-Id: I49056c5ecc099d5a4342d5f54b17793c1c7798d5