The try/catch allows using a stub NearbyService on branches that do not support it yet. Also update Context.NEARBY_SERVICE to ConstantsShim to be compatible with all branches. Bug: 189355156 Test: boots Change-Id: I7db0035b0d9ada79f00d6ef1ac5b54b2e98489d0