History log of /frameworks/base/services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b144227742ada7fd693684a5bd2d53abd8e7c499 18-Dec-2017 Neil Fuller <nfuller@google.com> Add support for time zone notifications

Add support for time zone notifications to RulesManagerService.

This change adds new intents that are broadcast after
a time zone rules update is staged / unstaged. This will allow
another component on the device to handle notifications telling
the user to restart the device.

Bug: 69443060
Test: atest FrameworksServicesTests
Test: Manual install
Change-Id: I4fc4b5715380d84d87cdb43c05aee2f8f9c5d277
/frameworks/base/services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java
3582259c72476c55b60f49da1c7f1338b6683249 11-Dec-2017 Neil Fuller <nfuller@google.com> Avoid potential failure to boot with bad storage

Discovered by inspection: It is possible in the
event of file system issues to throw an exception
on boot.

This change moves logic previously done in the
PackageStatusStorage constructor to an initialize()
method that can be called on service start up and
handled more gracefully: if there is a storage problem
a warning will be logged and time zone updates
feature will just not be enabled.

Also:
Commit a7d21f8c321ae7149b68625a5c8502abe005ed7b
switched to FileUtils.createDir() but the mkdir()
(implied by createDir()) wasn't removed along with
it but was redundant.

Units tests run with:

atest FrameworksServiceTestsCases:PackageStatusStorageTest \
FrameworksServiceTestsCases:PackageTrackerTest

Test: See above
Test: PTS: run pts -m PtsTimeZoneTestCases
Test: Manual test: deleted /data/system/timezone and rebooted, dir
recreated
Change-Id: I84ab3152d0a9d6781e5665e8615b3ab92b6c7a40
/frameworks/base/services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java
a7d21f8c321ae7149b68625a5c8502abe005ed7b 05-Dec-2017 Neil Fuller <nfuller@google.com> Tidy up changes for timezone update code

Tidy up changes for timezone update code:
1) Remove some TODOs
2) Fix some logging
3) Remove ClockHelper in favor of java.time.Clock /
SystemClock.elapsedRealtimeClock()

No functional changes intended.

Bug: 31008728
Test: PTS: run pts -m PtsTimeZoneTestCases
Change-Id: Ib1ae04cbadfe71e4e340a0572e82f0bc3f68ef30
/frameworks/base/services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java
3accca05ddcad9d0b1b313eae49f273e39121d3c 20-Sep-2013 Dianne Hackborn <hackbod@google.com> Add major version code to platform.

It turns the version code into almost a 64-bit integer, with the
new major part being the upper 32 bits.

The only tricky part about this is the backup manager, since it
stored 32-bit version codes in its backup data sets. This is dealt
with by, when the major version code is not 0, writing MIN_INT as
the version code and following that by the full long version code,
which we can detect when reading. Note that this makes backup sets
containing apps with major version codes incompatible with older
versions of the platform.

Bug: 64459786
Test: Added in Change-Id: Iab8a682b62103babd6c16a56b8dc1e97d7078658
Change-Id: Ibfffe235bbfcf358b3741abd3f7197fdb063d3f3
/frameworks/base/services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java
cd1a109b872f58f5baa0ce8438bf3ddd69eec9fc 13-Sep-2017 Neil Fuller <nfuller@google.com> 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
/frameworks/base/services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java
29ff71baa481a687a71276d2683774a0281aff43 18-Jul-2017 Neil Fuller <nfuller@google.com> Re-enable some test cases

Re-enable some test cases now the case they test has been
renabled (by commit 3d7a4143d5a2b771a02777354c9a11c981c63c59).

Tested with:

make -j30 FrameworksServicesTests
adb install -r -g \
"out/target/product/angler/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"

Bug: 31008728
Test: See above
Change-Id: Ia26c4355e41d5b1010594a06bb8c4e8cef8528f7
/frameworks/base/services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java
87b1128ddc44afeafb946a32d63abef68d8b3dc1 23-Jun-2017 Neil Fuller <nfuller@google.com> Add dumpsys support to RulesManagerService

Override the dump method so RuleManagerService can dump its state
into logs. Crude argument support has been added for dumping
specific fields in an easy to process way (for test scripts to use).

Tested with:
make -j30 FrameworksServicesTests
adb install -r -g \
"out/target/product/angler/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; adb shell dumpsys timezone [-format_state piscotz]
Bug: 31008728
Change-Id: I0ad83aa245232ed0b983ceacd8accfb876824d6f
/frameworks/base/services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java
5f6750f9d16d579635f15c0edf507ba42c9d1118 17-May-2017 Neil Fuller <nfuller@google.com> Switch PackageStatusStorage to XML-based storage

Based on feedback from a framework developer: an XML file can be used
instead of a Sqlite DB.

To run tests:
make -j30 FrameworksServicesTests
adb install -r -g
"out/target/product/angler/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.
Bug: 31008728
Change-Id: I1e6614d26df0e37ccea4dff82867e0b6aba39ca6
/frameworks/base/services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java
68f666693a465eb8a66d9252b7b7ac035b9f0b7b 16-Mar-2017 Neil Fuller <nfuller@google.com> Add (disabled) time zone update system server impl

This commit builds on top of prior API commits. It
adds code to the system server, but in a disabled way.

The system server is responsible for monitoring two
(configured) package names: one for the "updater app"
(provided by the platform) and one for the "data app"
(provided by the OEM). When either package changes
the updater app is triggered via a privileged
intent.

The updater is then required to communicate with the
data app and report back to the system server.

Unit tests are included for the major components.

To run:
make -j30 FrameworksServicesTests
adb install -r -g "out/target/product/angler/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.
Bug: 31008728
Merged-In: I8f82cdcc2b574778a7e0d0184270f305b69ee17b
Change-Id: I8f82cdcc2b574778a7e0d0184270f305b69ee17b
/frameworks/base/services/tests/servicestests/src/com/android/server/timezone/PackageTrackerTest.java