Introduce SystemVibratorManager

Add default system implementation of vibrator manager service that uses
IVibratorManagerService to access the device vibrators.

Change implementation of SystemVibrator to use VibratorManagerService
and delete local service VibratorService.

Introduce missing public APIs for VibratorManager and Vibrator.getId.

Bug: 167946816
Test: VibratorManagerServiceTest, VibratorTest, VibrationEffectTest
Change-Id: I55cdeb72c7ca39ccf0c7b2fda60b16de1031801e
This commit is contained in:
Lais Andrade
2020-12-11 19:45:42 +00:00
parent c4f27f3020
commit 55a0aebe7f
24 changed files with 1105 additions and 2309 deletions

View File

@@ -1292,7 +1292,6 @@ public final class SystemServer implements Dumpable {
t.traceBegin("startOtherServices");
final Context context = mSystemContext;
VibratorService vibrator = null;
DynamicSystemService dynamicSystem = null;
IStorageManager storageManager = null;
NetworkManagementService networkManagement = null;
@@ -1418,11 +1417,6 @@ public final class SystemServer implements Dumpable {
mSystemServiceManager.startService(VibratorManagerService.Lifecycle.class);
t.traceEnd();
t.traceBegin("StartVibratorService");
vibrator = new VibratorService(context);
ServiceManager.addService("vibrator", vibrator);
t.traceEnd();
t.traceBegin("StartDynamicSystemService");
dynamicSystem = new DynamicSystemService(context);
ServiceManager.addService("dynamic_system", dynamicSystem);
@@ -2491,14 +2485,6 @@ public final class SystemServer implements Dumpable {
// It is now time to start up the app processes...
t.traceBegin("MakeVibratorServiceReady");
try {
vibrator.systemReady();
} catch (Throwable e) {
reportWtf("making Vibrator Service ready", e);
}
t.traceEnd();
t.traceBegin("MakeLockSettingsServiceReady");
if (lockSettings != null) {
try {