OSDN Git Service

Validate restore of NetworkPolicy settings
authorAnnie Meng <anniemeng@google.com>
Tue, 27 Feb 2018 14:48:21 +0000 (14:48 +0000)
committerAnnie Meng <anniemeng@google.com>
Thu, 1 Mar 2018 14:39:09 +0000 (14:39 +0000)
commit853097ca2c29d9bb708b6f600a7d46f2a2a77289
tree590ee5786fedfb47debf2fd8939fc119de26cd9e
parent6611f83f5ce645954ca9a41d579d147be2178813
Validate restore of NetworkPolicy settings

We want to catch potential exceptions that occur when restoring
NetworkPolicy settings. Here, a DateTimeException can be thrown when
we try to read the recurrence rule from the backup data and cannot
parse a timezone.

We also add GTS tests to validate that these catches persist and that
we don't crash when given unexpected backup data to restore.

Bug: 73942796
Test: gts-tradefed run gts -m GtsBackupHostTestCases -t com.google.android.gts.backup.NetworkPolicyRestoreHostSideTest
Change-Id: I6f6ea09d2fff60b8d704c6160234e6f032321103
core/java/android/net/NetworkPolicy.java
core/java/android/util/RecurrenceRule.java
packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java