Add internal API to set preferred device id