diff options
| author | 2017-09-13 21:59:59 +0100 | |
|---|---|---|
| committer | 2017-09-19 13:31:12 +0000 | |
| commit | cd1a109b872f58f5baa0ce8438bf3ddd69eec9fc (patch) | |
| tree | 559b3784bd30e4824bd605a28fab087c916ecdb6 /services/java | |
| parent | bcd3f07cc2514f1304580e0a4cb7d140d7178018 (diff) | |
Fix reliability triggering
Fix reliability triggering in the time zone update
feature. The reliability triggering is there to
resume an update check when things go wrong. For
example, if the device is turned off after a
time zone data app is updated but before the time
zone update process has finished pulling the data
out and installing it in /data. The reliability
trigger happens when the device is idle and will
complete the work.
The idle triggering currently doesn't work as it
was implemented incorrectly.
The code has been changed to use the
JobScheduler to trigger on idle and scheduling
has been made explicit.
Unit tests run with:
make -j30 FrameworksServicesTests
adb install -r -g \
"out/target/product/marlin/data/app/FrameworksServicesTests/FrameworksServicesTests.apk"
adb shell am instrument -e package com.android.server.timezone -w \
com.android.frameworks.servicestests \
"com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"
Test: See above
Test: Manual testing: adb shell am idle-maintenance, adb logcat/adb shell dumpsys timezone
Test: PTS: run pts -m PtsTimeZoneTestCases
Bug: 65657543
Change-Id: Ibb2c537955d09a5d538c50490dae94a518522f19
Diffstat (limited to 'services/java')
| -rw-r--r-- | services/java/com/android/server/SystemServer.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 57271fa10950..99ee2f88c999 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -1209,18 +1209,6 @@ public final class SystemServer { traceEnd(); } - // timezone.RulesManagerService will prevent a device starting up if the chain of trust - // required for safe time zone updates might be broken. RuleManagerService cannot do - // this check when mOnlyCore == true, so we don't enable the service in this case. - final boolean startRulesManagerService = - !mOnlyCore && context.getResources().getBoolean( - R.bool.config_enableUpdateableTimeZoneRules); - if (startRulesManagerService) { - traceBeginAndSlog("StartTimeZoneRulesManagerService"); - mSystemServiceManager.startService(TIME_ZONE_RULES_MANAGER_SERVICE_CLASS); - traceEnd(); - } - traceBeginAndSlog("StartAudioService"); mSystemServiceManager.startService(AudioService.Lifecycle.class); traceEnd(); @@ -1361,6 +1349,19 @@ public final class SystemServer { } traceEnd(); + // timezone.RulesManagerService will prevent a device starting up if the chain of trust + // required for safe time zone updates might be broken. RuleManagerService cannot do + // this check when mOnlyCore == true, so we don't enable the service in this case. + // This service requires that JobSchedulerService is already started when it starts. + final boolean startRulesManagerService = + !mOnlyCore && context.getResources().getBoolean( + R.bool.config_enableUpdateableTimeZoneRules); + if (startRulesManagerService) { + traceBeginAndSlog("StartTimeZoneRulesManagerService"); + mSystemServiceManager.startService(TIME_ZONE_RULES_MANAGER_SERVICE_CLASS); + traceEnd(); + } + if (!disableNetwork && !disableNetworkTime) { traceBeginAndSlog("StartNetworkTimeUpdateService"); try { |