summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2014-01-07 20:58:16 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-01-07 20:58:16 +0000
commitdfc73e9c243092d395913737af622c89ad1830be (patch)
treeac008d727dc8126432d8d95f720c6867484a9460
parent58a8a678bd72da68e6a21852926084fefbb3e02a (diff)
parent66e9b1e1178813037daf3798b8fe23467c4b91ab (diff)
downloadframeworks_base-dfc73e9c243092d395913737af622c89ad1830be.zip
frameworks_base-dfc73e9c243092d395913737af622c89ad1830be.tar.gz
frameworks_base-dfc73e9c243092d395913737af622c89ad1830be.tar.bz2
am 66e9b1e1: Merge "Move SystemService code to frameworks/base/core" into klp-modular-dev
* commit '66e9b1e1178813037daf3798b8fe23467c4b91ab': Move SystemService code to frameworks/base/core
-rw-r--r--core/java/com/android/server/LocalServices.java (renamed from services/core/java/com/android/server/LocalServices.java)2
-rw-r--r--core/java/com/android/server/SystemService.java (renamed from services/core/java/com/android/server/SystemService.java)23
-rw-r--r--core/java/com/android/server/SystemServiceManager.java (renamed from services/core/java/com/android/server/SystemServiceManager.java)5
3 files changed, 28 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/LocalServices.java b/core/java/com/android/server/LocalServices.java
index deff79d..25dcb30 100644
--- a/services/core/java/com/android/server/LocalServices.java
+++ b/core/java/com/android/server/LocalServices.java
@@ -24,6 +24,8 @@ import android.util.ArrayMap;
*
* 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
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.IBinder;
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
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 android.util.Slog;
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";