Add GnssTimeUpdateService.
GnssTimeUpdateService listens for location updates. Once an update is received, it reads the time provided by GPS and suggests it to TimeDetectorService. TimeDetectorService can then use it to set the SystemClock based on included time sources and priority. Bug: 157265008 Test: Presubmits + atest + Manual - atest frameworks/base/services/tests/servicestests/src/com/android/server/timedetector/GnssTimeUpdateServiceTest.java - For manual testing, the Location Shell Commands can be used to add / enable a gps test provider to set gps locations with a specified time. The time detector dumpsys can then be used to verify that a GNSS suggestion has been made. Change-Id: Ife27ecd6d122f33b7cc93d7832e3085acc33c160
This commit is contained in:
@@ -323,6 +323,8 @@ public final class SystemServer implements Dumpable {
|
||||
"com.android.server.timezonedetector.TimeZoneDetectorService$Lifecycle";
|
||||
private static final String LOCATION_TIME_ZONE_MANAGER_SERVICE_CLASS =
|
||||
"com.android.server.location.timezone.LocationTimeZoneManagerService$Lifecycle";
|
||||
private static final String GNSS_TIME_UPDATE_SERVICE_CLASS =
|
||||
"com.android.server.timedetector.GnssTimeUpdateService$Lifecycle";
|
||||
private static final String ACCESSIBILITY_MANAGER_SERVICE_CLASS =
|
||||
"com.android.server.accessibility.AccessibilityManagerService$Lifecycle";
|
||||
private static final String ADB_SERVICE_CLASS =
|
||||
@@ -1874,6 +1876,16 @@ public final class SystemServer implements Dumpable {
|
||||
}
|
||||
t.traceEnd();
|
||||
|
||||
if (context.getResources().getBoolean(R.bool.config_enableGnssTimeUpdateService)) {
|
||||
t.traceBegin("StartGnssTimeUpdateService");
|
||||
try {
|
||||
mSystemServiceManager.startService(GNSS_TIME_UPDATE_SERVICE_CLASS);
|
||||
} catch (Throwable e) {
|
||||
reportWtf("starting GnssTimeUpdateService service", e);
|
||||
}
|
||||
t.traceEnd();
|
||||
}
|
||||
|
||||
if (!isWatch) {
|
||||
t.traceBegin("StartSearchManagerService");
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user