Remove HardwareService and move vibrator support to VibratorService.

The lights support is only needed by PowerManagerService and NotificationManagerService, so we do not need a Binder API for it.
Move backlight and notification light support to new LightsService class.
The camera flash is now handled directly by the camera HAL, so the flash Hardware service flash support is obsolete.

Change-Id: I086d681f54668e7f7de3e8b90df3de19d59833c5
Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 3cfd1a9..a0a9a93 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -84,7 +84,7 @@
         int factoryTest = "".equals(factoryTestStr) ? SystemServer.FACTORY_TEST_OFF
                 : Integer.parseInt(factoryTestStr);
 
-        HardwareService hardware = null;
+        LightsService lights = null;
         PowerManagerService power = null;
         BatteryService battery = null;
         ConnectivityService connectivity = null;
@@ -141,13 +141,15 @@
             battery = new BatteryService(context);
             ServiceManager.addService("battery", battery);
 
-            Log.i(TAG, "Hardware Service");
-            hardware = new HardwareService(context);
-            ServiceManager.addService("hardware", hardware);
+            Log.i(TAG, "Lights Service");
+            lights = new LightsService(context);
+
+            Log.i(TAG, "Vibrator Service");
+            ServiceManager.addService("vibrator", new VibratorService(context));
 
             // only initialize the power service after we have started the
-            // hardware service, content providers and the battery service.
-            power.init(context, hardware, ActivityManagerService.getDefault(), battery);
+            // lights service, content providers and the battery service.
+            power.init(context, lights, ActivityManagerService.getDefault(), battery);
 
             Log.i(TAG, "Alarm Manager");
             AlarmManagerService alarm = new AlarmManagerService(context);
@@ -253,7 +255,7 @@
 
             try {
                 Log.i(TAG, "Notification Manager");
-                notification = new NotificationManagerService(context, statusBar, hardware);
+                notification = new NotificationManagerService(context, statusBar, lights);
                 ServiceManager.addService(Context.NOTIFICATION_SERVICE, notification);
             } catch (Throwable e) {
                 Log.e(TAG, "Failure starting Notification Manager", e);