diff options
| author | 2019-01-04 15:17:39 +0000 | |
|---|---|---|
| committer | 2019-01-04 15:18:46 +0000 | |
| commit | 7bcb2fa2dcebe9ce42736364b664b36e02d41f9c (patch) | |
| tree | 6d9c25f527dea507da597bc38d5c524c58f5b59e | |
| parent | 2b9930d0b74280db8bc43fd622b1e8c2ad1c45d6 (diff) | |
Map error code 51 to an incorrect OS error.
Error code 51 is given when trying to downgrade a device, so this is
required to fix our broken CTS test and give an accurate error code to
the admin.
Change-Id: I436fb7a605dc47dc5388c78c67d7db08ffcf867a
Fixes: 120896091
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.DeviceOwnerTest#testInstallUpdate
| -rw-r--r-- | api/system-current.txt | 1 | ||||
| -rw-r--r-- | core/java/android/os/UpdateEngine.java | 1 | ||||
| -rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/AbUpdateInstaller.java | 3 |
3 files changed, 5 insertions, 0 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index 01304a6ca79e..032793ae6e3d 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -4505,6 +4505,7 @@ package android.os { field public static final int PAYLOAD_HASH_MISMATCH_ERROR = 10; // 0xa field public static final int PAYLOAD_MISMATCHED_TYPE_ERROR = 6; // 0x6 field public static final int PAYLOAD_SIZE_MISMATCH_ERROR = 11; // 0xb + field public static final int PAYLOAD_TIMESTAMP_ERROR = 51; // 0x33 field public static final int POST_INSTALL_RUNNER_ERROR = 5; // 0x5 field public static final int SUCCESS = 0; // 0x0 field public static final int UPDATED_BUT_NOT_ACTIVE = 52; // 0x34 diff --git a/core/java/android/os/UpdateEngine.java b/core/java/android/os/UpdateEngine.java index 8f2826c16b63..1df3dad9530b 100644 --- a/core/java/android/os/UpdateEngine.java +++ b/core/java/android/os/UpdateEngine.java @@ -66,6 +66,7 @@ public class UpdateEngine { public static final int PAYLOAD_HASH_MISMATCH_ERROR = 10; public static final int PAYLOAD_SIZE_MISMATCH_ERROR = 11; public static final int DOWNLOAD_PAYLOAD_VERIFICATION_ERROR = 12; + public static final int PAYLOAD_TIMESTAMP_ERROR = 51; public static final int UPDATED_BUT_NOT_ACTIVE = 52; } diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/AbUpdateInstaller.java b/services/devicepolicy/java/com/android/server/devicepolicy/AbUpdateInstaller.java index 05912a5e3776..de5dd1749830 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/AbUpdateInstaller.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/AbUpdateInstaller.java @@ -66,6 +66,9 @@ class AbUpdateInstaller extends UpdateInstaller { map.put( DOWNLOAD_STATE_INITIALIZATION_ERROR, InstallUpdateCallback.UPDATE_ERROR_INCORRECT_OS_VERSION); + map.put( + UpdateEngine.ErrorCodeConstants.PAYLOAD_TIMESTAMP_ERROR, + InstallUpdateCallback.UPDATE_ERROR_INCORRECT_OS_VERSION); // Error constants corresponding to errors related to bad update file. map.put( |