Add the CommonTimeManagementService.

Add a small service to the high level core set of system services to
control the configuration of the native common time service.  This
service is responsible for controlling policy regarding when the
common time service should be allowed to run, which networks it is
allowed to run on, what priority it runs at in the master election
algorithm, and so on.

Change-Id: I1fcd834c0286aea0df9557520693a3f42de59d69
Signed-off-by: John Grossman <johngro@google.com>
This commit is contained in:
John Grossman
2012-02-01 15:23:33 -08:00
parent 37237839e8
commit c157673a59
2 changed files with 392 additions and 0 deletions

View File

@ -132,6 +132,7 @@ class ServerThread extends Thread {
RecognitionManagerService recognition = null;
ThrottleService throttle = null;
NetworkTimeUpdateService networkTimeUpdater = null;
CommonTimeManagementService commonTimeMgmtService = null;
// Critical services...
try {
@ -575,6 +576,14 @@ class ServerThread extends Thread {
} catch (Throwable e) {
reportWtf("starting NetworkTimeUpdate service", e);
}
try {
Slog.i(TAG, "CommonTimeManagementService");
commonTimeMgmtService = new CommonTimeManagementService(context);
ServiceManager.addService("commontime_management", commonTimeMgmtService);
} catch (Throwable e) {
reportWtf("starting CommonTimeManagementService service", e);
}
}
// Before things start rolling, be sure we have decided whether
@ -653,6 +662,7 @@ class ServerThread extends Thread {
final LocationManagerService locationF = location;
final CountryDetectorService countryDetectorF = countryDetector;
final NetworkTimeUpdateService networkTimeUpdaterF = networkTimeUpdater;
final CommonTimeManagementService commonTimeMgmtServiceF = commonTimeMgmtService;
final TextServicesManagerService textServiceManagerServiceF = tsms;
final StatusBarManagerService statusBarF = statusBar;
@ -751,6 +761,11 @@ class ServerThread extends Thread {
} catch (Throwable e) {
reportWtf("making Network Time Service ready", e);
}
try {
if (commonTimeMgmtServiceF != null) commonTimeMgmtServiceF.systemReady();
} catch (Throwable e) {
reportWtf("making Common time management service ready", e);
}
try {
if (textServiceManagerServiceF != null) textServiceManagerServiceF.systemReady();
} catch (Throwable e) {