Backport ExpandHelper from CM10.1