Import from agora commit 2caabaa010f596ccbd6d747afe92ba935fbbb04c