Move SystemService code to frameworks/base/core

Paves the way for building services without needing to see the
rest of frameworks/base/services.

Change-Id: I8ac4bc9d25471e96076cd888c1fc24b918d8911f
diff --git a/services/core/java/com/android/server/LocalServices.java b/core/java/com/android/server/LocalServices.java
similarity index 98%
rename from services/core/java/com/android/server/LocalServices.java
rename to core/java/com/android/server/LocalServices.java
index deff79dc..25dcb30 100644
--- a/services/core/java/com/android/server/LocalServices.java
+++ b/core/java/com/android/server/LocalServices.java
@@ -24,6 +24,8 @@
  *
  * Once all services are converted to the SystemService interface, this class can be absorbed
  * into SystemServiceManager.
+ *
+ * {@hide}
  */
 public final class LocalServices {
     private LocalServices() {}
diff --git a/services/core/java/com/android/server/SystemService.java b/core/java/com/android/server/SystemService.java
similarity index 83%
rename from services/core/java/com/android/server/SystemService.java
rename to core/java/com/android/server/SystemService.java
index b9d30ce..0356753 100644
--- a/services/core/java/com/android/server/SystemService.java
+++ b/core/java/com/android/server/SystemService.java
@@ -21,7 +21,28 @@
 import android.os.ServiceManager;
 
 /**
- * System services respond to lifecycle events that help the services know what
+ * The base class for services running in the system process. Override and implement
+ * the lifecycle event callback methods as needed.
+ *
+ * The lifecycle of a SystemService:
+ *
+ * {@link #onCreate(android.content.Context)} is called to initialize the
+ * service.
+ *
+ * {@link #onStart()} is called to get the service running. It is common
+ * for services to publish their Binder interface at this point. All required
+ * dependencies are also assumed to be ready to use.
+ *
+ * Then {@link #onBootPhase(int)} is called as many times as there are boot phases
+ * until {@link #PHASE_BOOT_COMPLETE} is sent, which is the last boot phase. Each phase
+ * is an opportunity to do special work, like acquiring optional service dependencies,
+ * waiting to see if SafeMode is enabled, or registering with a service that gets
+ * started after this one.
+ *
+ * NOTE: All lifecycle methods are called from the same thread that created the
+ * SystemService.
+ *
+ * {@hide}
  */
 public abstract class SystemService {
     /*
diff --git a/services/core/java/com/android/server/SystemServiceManager.java b/core/java/com/android/server/SystemServiceManager.java
similarity index 97%
rename from services/core/java/com/android/server/SystemServiceManager.java
rename to core/java/com/android/server/SystemServiceManager.java
index 59f7e92..e2a6063 100644
--- a/services/core/java/com/android/server/SystemServiceManager.java
+++ b/core/java/com/android/server/SystemServiceManager.java
@@ -23,7 +23,10 @@
 import java.util.ArrayList;
 
 /**
- * Manages creating, starting, and other lifecycle events of system services.
+ * Manages creating, starting, and other lifecycle events of
+ * {@link com.android.server.SystemService}s.
+ *
+ * {@hide}
  */
 public class SystemServiceManager {
     private static final String TAG = "SystemServiceManager";