summaryrefslogtreecommitdiffstats
path: root/uncrypt/uncrypt.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Track rename from base/ to android-base/.Elliott Hughes2015-12-051-2/+2
| | | | Change-Id: I354a8c424d340a9abe21fd716a4ee0d3b177d86f
* We can use fclose directly in std::unique_ptr.Elliott Hughes2015-11-131-5/+5
| | | | | | | | It turns out the standard explicitly states that if the pointer is null, the deleter function won't be called. So it doesn't matter that fclose(3) doesn't accept null. Change-Id: I10e6e0d62209ec03ac60e673edd46f32ba279a04
* uncrypt: remove O_SYNC to avoid time-out failuresJaegeuk Kim2015-11-041-1/+1
| | | | | | | | | | | This patch removes costly O_SYNC flag for encrypted block device. After writing whole decrypted blocks, fsync should guarantee their consistency from further power failures. This patch reduces the elapsed time significantly consumed by upgrading packages on an encrypted partition, so that it could avoid another time-out failures too. Change-Id: I1fb9022c83ecc00bad09d107fc87a6a09babb0ec Signed-off-by: Jaegeuk Kim <jaegeuk@motorola.com>
* Use unique_ptr and unique_fd to manager FDs.Tao Bao2015-08-101-16/+16
| | | | | | | | Clean up leaky file descriptors in uncrypt/uncrypt.cpp. Add unique_fd for open() and unique_file for fopen() to close FDs on destruction. Bug: 21496020 Change-Id: I0174db0de9d5f59cd43b44757b8ef0f5912c91a2
* uncrypt: Support file level encryption.Tao Bao2015-07-241-1/+1
| | | | | | Bug: 22534003 Change-Id: I2bc22418c416491da573875dce78daed24f2c046 (cherry picked from commit 6e9dda70cb00dd1f1948e071d7df7ca6e2bd8332)
* uncrypt: Write status when it reboots to factory resetTao Bao2015-06-101-7/+10
| | | | | | | | | When it reboots into recovery for a factory reset, it still needs to write the uncrypt status (-1) to the pipe. Bug: 21511893 (cherry picked from commit 2c2cae8a4a18b85043bb6260a59ac7d1589016bf) Change-Id: Ia5a75c5edf3afbd916153da1b4de4db2f00d0209
* Separate uncrypt into two modesTao Bao2015-06-101-94/+91
| | | | | | | | | | | | | | | uncrypt needs to be triggered to prepare the OTA package before rebooting into the recovery. Separate uncrypt into two modes. In mode 1, it uncrypts the OTA package, but will not reboot the device. In mode 2, it wipes the /misc partition and reboots. Needs matching changes in frameworks/base, system/core and external/sepolicy to work properly. Bug: 20012567 Bug: 20949086 (cherry picked from commit 158e11d6738a751b754d09df7275add589c31191) Change-Id: I349f6d368a0d6f6ee4332831c4cd4075a47426ff
* Clean up the sleep()'s after poking init servicesTao Bao2015-05-271-4/+8
| | | | Change-Id: I77564fe5c59e604f1377b278681b7d1bff53a77a
* uncrypt: Switch to C++Tao Bao2015-05-061-0/+465
Also apply some trivial changes like int -> bool and clean-ups. Change-Id: Ic55fc8b82d7e91b321f69d10175be23d5c04eb92