Use public APIs not internal APIs am: 59cc3bcdaf
am: 1b474f8bb7

Change-Id: Ie6b0c70fc70f87ba317542580466b4848e7a54cd