Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bcb2fa2 authored by Alex Kershaw's avatar Alex Kershaw
Browse files

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
parent 2b9930d0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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;
    }

+3 −0
Original line number Diff line number Diff line
@@ -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(