Replace switches on resources with if-else

This is necessary for the project to build as an Android library which
is planned for Google3.

Test: ran GoogleContactsTests

Bug 33782320

Change-Id: I62f15486b7e976bb20a6e9c631dc8404a4170dbb
11 files changed