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

Commit f05d6cb4 authored by David Anderson's avatar David Anderson Committed by android-build-merger
Browse files

Merge "fastbootd: Perform CRC check when flashing sparse images."

am: 950ec1a0

Change-Id: I426a059ff1a628ad09ae7f77815be6a51fd7e06f
parents 2f479092 950ec1a0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ int WriteCallback(void* priv, const void* data, size_t len) {
}

int FlashSparseData(int fd, std::vector<char>& downloaded_data) {
    struct sparse_file* file = sparse_file_import_buf(downloaded_data.data(), true, false);
    struct sparse_file* file = sparse_file_import_buf(downloaded_data.data(), true, true);
    if (!file) {
        return -ENOENT;
    }
+0 −1
Original line number Diff line number Diff line
@@ -570,7 +570,6 @@ TEST_F(Conformance, SparseCRCCheck) {
    buf.back() = buf.back() ^ 0x01;
    ASSERT_EQ(DownloadCommand(buf.size()), SUCCESS) << "Device rejected download command";
    ASSERT_EQ(SendBuffer(buf), SUCCESS) << "Downloading payload failed";
    printf("%02x\n", (unsigned char)buf.back());
    // It can either reject this download or reject it during flash
    if (HandleResponse() != DEVICE_FAIL) {
        EXPECT_EQ(fb->Flash("userdata"), DEVICE_FAIL)