Prevent writing to FRP partition during factory reset. am: a9437bd1ca am: 2ce5c4320d am: 133ff4d611 am: 00a581f882 am: e5156ec1e9 am: 9a47fa7fc0 am: 8bcdab7e6f am: dd7837c5ad am: 9bc2d6b446 am: 08ea823955
am: 065e387455
Change-Id: Ic6182836cbc0bf547bcd6c6621a410c1e6d0ce8f
This commit is contained in:
@@ -79,6 +79,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) {
|
||||
@@ -129,6 +132,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 {
|
||||
|
||||
Reference in New Issue
Block a user