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

am: f05d6cb4a7

Change-Id: Iba470383d090298b762a01427a1826beecf76786
This commit is contained in:
David Anderson 2018-09-05 15:33:29 -07:00 committed by android-build-merger
commit 14b7783f5e
2 changed files with 1 additions and 2 deletions

View file

@ -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;
}

View file

@ -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)