Adapt for API changes.

Adapts for changes made in http://review.cyanogenmod.org/#/c/51499/

Change-Id: I2b8c067870bea54d9794e92c9de1db45d77c4753