Register new AIDL SensorManager

For now we can register both HIDL and AIDL sensorservice, and the vendor
can choose which one to use.

Test: atest VtsHalSensorManagerTargetTest
Bug: 205764765

Change-Id: I26ee176baea59f86281ae3a46ea580443064b5ef
This commit is contained in:
Devin Moore
2022-11-04 19:06:50 +00:00
parent 691bfb642a
commit 5b187ec931
3 changed files with 75 additions and 36 deletions

View File

@@ -466,6 +466,7 @@ public final class SystemServer implements Dumpable {
private final long mRuntimeStartUptime;
private static final String START_HIDL_SERVICES = "StartHidlServices";
private static final String START_SENSOR_MANAGER_SERVICE = "StartISensorManagerService";
private static final String START_BLOB_STORE_SERVICE = "startBlobStoreManagerService";
private static final String SYSPROP_START_COUNT = "sys.system_server.start_count";
@@ -484,6 +485,9 @@ public final class SystemServer implements Dumpable {
/** Start the IStats services. This is a blocking call and can take time. */
private static native void startIStatsService();
/** Start the ISensorManager service. This is a blocking call and can take time. */
private static native void startISensorManagerService();
/**
* Start the memtrack proxy service.
*/
@@ -1597,9 +1601,16 @@ public final class SystemServer implements Dumpable {
wm.onInitReady();
t.traceEnd();
// Start receiving calls from HIDL services. Start in in a separate thread
// Start receiving calls from SensorManager services. Start in a separate thread
// because it need to connect to SensorManager. This has to start
// after PHASE_WAIT_FOR_SENSOR_SERVICE is done.
SystemServerInitThreadPool.submit(() -> {
TimingsTraceAndSlog traceLog = TimingsTraceAndSlog.newAsyncLog();
traceLog.traceBegin(START_SENSOR_MANAGER_SERVICE);
startISensorManagerService();
traceLog.traceEnd();
}, START_SENSOR_MANAGER_SERVICE);
SystemServerInitThreadPool.submit(() -> {
TimingsTraceAndSlog traceLog = TimingsTraceAndSlog.newAsyncLog();
traceLog.traceBegin(START_HIDL_SERVICES);