Code cleanup.

Avoid repetetive boilerplate code by using helper methods.

Change-Id: Id3ce8d07d35d59c08cbc67fa35bbf6daa67c9608
Automatic translation import

Change-Id: If226d8f4684929f5515fafdc67b4013729206046
Merge "Code cleanup." into cm-11.0
Merge branch 'cm-11.0' of https://github.com/CyanogenMod/android_packages_apps_Dialer into cm-11.0_HAZE