ANDROID: PM: hibernate: Encryption support with compression
Currently only the uncompressed hibernation snapshot image is encrypted before being written to the swap partition. Extend the encryption support for compression enabled scenarios as well. Bug: 335581841 Change-Id: Ida781b727f56b664a67e2887a4db3d6b355dafdb Signed-off-by: Nikhil V <quic_nprakash@quicinc.com>
This commit is contained in:
parent
3e99ae28ea
commit
503add1843
@ -596,7 +596,6 @@ static int save_image(struct swap_map_handle *handle,
|
||||
if (!ret)
|
||||
pr_info("Image saving done\n");
|
||||
swsusp_show_speed(start, stop, nr_to_write, "Wrote");
|
||||
trace_android_vh_post_image_save(root_swap);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -879,6 +878,7 @@ static int save_compressed_image(struct swap_map_handle *handle,
|
||||
off += PAGE_SIZE) {
|
||||
memcpy(page, data[thr].cmp + off, PAGE_SIZE);
|
||||
|
||||
trace_android_vh_encrypt_page(page);
|
||||
ret = swap_write_page(handle, page, &hb);
|
||||
if (ret)
|
||||
goto out_finish;
|
||||
@ -997,6 +997,9 @@ int swsusp_write(unsigned int flags)
|
||||
error = (flags & SF_NOCOMPRESS_MODE) ?
|
||||
save_image(&handle, &snapshot, pages - 1) :
|
||||
save_compressed_image(&handle, &snapshot, pages - 1);
|
||||
|
||||
if (!error)
|
||||
trace_android_vh_post_image_save(root_swap);
|
||||
}
|
||||
out_finish:
|
||||
error = swap_writer_finish(&handle, flags, error);
|
||||
|
Loading…
Reference in New Issue
Block a user