summaryrefslogtreecommitdiff
path: root/api/api.go
diff options
context:
space:
mode:
author Kangping Dong <wgtdkp@google.com> 2023-09-02 00:51:00 +0800
committer Kangping Dong <wgtdkp@google.com> 2023-11-14 06:38:40 +0000
commit2859095947b23732196ed7b78723954ec15d81bc (patch)
tree28b40ec5dbc16be91715c4e23fa53e0c90d434f9 /api/api.go
parent2d2d98a810be043275bc5a7cbb28140cb3b082e5 (diff)
Fix getting CONTEXTHUB_SERVICE throws ServiceNotFoundException
The CONTEXTHUB_SERVICE may not be published if the FEATURE_CONTEXT_HUB feature is not present. So getting the ContextHub serivce with "context.getSystemService(ContextHubManager.class)" will throw ServiceNotFoundException. This commit fixes this issue by checking the CONTEXTHUB_SERVICE before creating the ContextHubManager instance. Test: verified with cuttlefish that it won't throw from NearbyService Bug: 299388818 Change-Id: Icd51a0f88c10259f4a912f5dd82bad49b70562e3
Diffstat (limited to 'api/api.go')
0 files changed, 0 insertions, 0 deletions