Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 28590959 authored by Kangping Dong's avatar Kangping Dong
Browse files

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
parent 2d2d98a8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment