Guard Context Hub Service on Context Hub feature

Also adds annotation to require the feature.

Bug: 147677675
Test: Compile and flash, verify Context Hub Service is not found if the
feature flag is not defined
Change-Id: Ia718c76ec4308274dc66cfe975e762997e3539ca
This commit is contained in:
Arthur Ishiguro
2020-01-23 13:06:37 -08:00
parent 351e3b3627
commit c88b3ce7c4
2 changed files with 8 additions and 3 deletions

View File

@@ -1724,9 +1724,11 @@ public final class SystemServer {
mSystemServiceManager.startService(SensorNotificationService.class);
t.traceEnd();
t.traceBegin("StartContextHubSystemService");
mSystemServiceManager.startService(ContextHubSystemService.class);
t.traceEnd();
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_CONTEXTHUB)) {
t.traceBegin("StartContextHubSystemService");
mSystemServiceManager.startService(ContextHubSystemService.class);
t.traceEnd();
}
t.traceBegin("StartDiskStatsService");
try {