Prevent writing to FRP partition during factory reset. am: a9437bd1ca am: 2ce5c4320d

am: 133ff4d611

Change-Id: I54b163f645f561243aac3df1a55c1023531997b3
This commit is contained in:
Charles He
2016-12-29 10:11:20 +00:00
committed by android-build-merger
2 changed files with 19 additions and 6 deletions

View File

@@ -54,6 +54,9 @@ public class PersistentDataBlockManager {
* Returns the number of bytes written or -1 on error. If the block is too big
* to fit on the partition, returns -MAX_BLOCK_SIZE.
*
* {@link #wipe} will block any further {@link #write} operation until reboot,
* in which case -1 will be returned.
*
* @param data the data to write
*/
public int write(byte[] data) {
@@ -108,6 +111,8 @@ public class PersistentDataBlockManager {
/**
* Zeroes the previously written block in its entirety. Calling this method
* will erase all data written to the persistent data partition.
* It will also prevent any further {@link #write} operation until reboot,
* in order to prevent a potential race condition. See b/30352311.
*/
public void wipe() {
try {