diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/os/IRecoverySystem.aidl | 1 | ||||
| -rw-r--r-- | core/java/android/os/RecoverySystem.java | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/os/IRecoverySystem.aidl b/core/java/android/os/IRecoverySystem.aidl index 9368b68a91c6..88bdb7f6f00b 100644 --- a/core/java/android/os/IRecoverySystem.aidl +++ b/core/java/android/os/IRecoverySystem.aidl @@ -23,6 +23,7 @@ import android.os.IRecoverySystemProgressListener; /** @hide */ interface IRecoverySystem { + boolean allocateSpaceForUpdate(in String packageFilePath); boolean uncrypt(in String packageFile, IRecoverySystemProgressListener listener); boolean setupBcb(in String command); boolean clearBcb(); diff --git a/core/java/android/os/RecoverySystem.java b/core/java/android/os/RecoverySystem.java index 051447f9219b..944b71700450 100644 --- a/core/java/android/os/RecoverySystem.java +++ b/core/java/android/os/RecoverySystem.java @@ -672,6 +672,14 @@ public class RecoverySystem { if (!rs.setupBcb(command)) { throw new IOException("Setup BCB failed"); } + try { + if (!rs.allocateSpaceForUpdate(packageFile)) { + throw new IOException("Failed to allocate space for update " + + packageFile.getAbsolutePath()); + } + } catch (RemoteException e) { + e.rethrowAsRuntimeException(); + } // Having set up the BCB (bootloader control block), go ahead and reboot PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); @@ -1392,6 +1400,13 @@ public class RecoverySystem { } /** + * Talks to RecoverySystemService via Binder to allocate space + */ + private boolean allocateSpaceForUpdate(File packageFile) throws RemoteException { + return mService.allocateSpaceForUpdate(packageFile.getAbsolutePath()); + } + + /** * Talks to RecoverySystemService via Binder to clear up the BCB. */ private boolean clearBcb() { |
