The change which removed the IllegalArgumentException was released in O (API level 26) (8143fa57ad), so the exception is thrown till API level 25, NOT 23 as the documentation currently states.
Bug: 124593220
Change-Id: Ia4c094cd7ae68f978bd5f49a9b294286dbe5bb61