OSDN Git Service

Fix reliability triggering
authorNeil Fuller <nfuller@google.com>
Wed, 13 Sep 2017 20:59:59 +0000 (21:59 +0100)
committerNeil Fuller <nfuller@google.com>
Tue, 19 Sep 2017 16:10:46 +0000 (17:10 +0100)
commit782a79f47aea44c0f3124ec3ddce0744c5462ffe
treec24413678ac6881a2ba96a1279f7d7da28238de4
parent46af70cad993d4b7d334ecebe3951ee764357334
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
Merged-In: Ibb2c537955d09a5d538c50490dae94a518522f19
(cherry picked from commit cd1a109b872f58f5baa0ce8438bf3ddd69eec9fc)
core/res/AndroidManifest.xml
services/core/java/com/android/server/timezone/IntentHelper.java
services/core/java/com/android/server/timezone/IntentHelperImpl.java
services/core/java/com/android/server/timezone/PackageTracker.java
services/core/java/com/android/server/timezone/RulesManagerService.java
services/core/java/com/android/server/timezone/TimeZoneUpdateIdler.java [new file with mode: 0644]
services/java/com/android/server/SystemServer.java
services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java