This is an API break since 1.16-rc1. Similar to previous commit. (cherry picked from commit 8ae9aa24)