Loading core/java/android/os/image/DynamicSystemManager.java +13 −0 Original line number Original line Diff line number Diff line Loading @@ -154,6 +154,19 @@ public class DynamicSystemManager { throw new RuntimeException(e.toString()); throw new RuntimeException(e.toString()); } } } } /** * Complete the current partition installation. * * @return true if the partition installation completes without error. */ @RequiresPermission(android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM) public boolean closePartition() { try { return mService.closePartition(); } catch (RemoteException e) { throw new RuntimeException(e.toString()); } } /** /** * Finish a previously started installation. Installations without a cooresponding * Finish a previously started installation. Installations without a cooresponding * finishInstallation() will be cleaned up during device boot. * finishInstallation() will be cleaned up during device boot. Loading core/java/android/os/image/IDynamicSystemService.aidl +7 −0 Original line number Original line Diff line number Diff line Loading @@ -38,6 +38,13 @@ interface IDynamicSystemService */ */ boolean createPartition(@utf8InCpp String name, long size, boolean readOnly); boolean createPartition(@utf8InCpp String name, long size, boolean readOnly); /** * Complete the current partition installation. * * @return true if the partition installation completes without error. */ boolean closePartition(); /** /** * Finish a previously started installation. Installations without * Finish a previously started installation. Installations without * a cooresponding finishInstallation() will be cleaned up during device boot. * a cooresponding finishInstallation() will be cleaned up during device boot. Loading packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java +11 −0 Original line number Original line Diff line number Diff line Loading @@ -334,6 +334,11 @@ class InstallationAsyncTask extends AsyncTask<String, InstallationAsyncTask.Prog throw new IOException( throw new IOException( "Failed to start installation with requested size: " + mUserdataSize); "Failed to start installation with requested size: " + mUserdataSize); } } // Reset installation session and verify that installation completes successfully. mInstallationSession = null; if (!mDynSystem.closePartition()) { throw new IOException("Failed to complete partition installation: userdata"); } } } private void installImages() private void installImages() Loading Loading @@ -503,6 +508,12 @@ class InstallationAsyncTask extends AsyncTask<String, InstallationAsyncTask.Prog imageValidationThrowOrWarning(new KeyRevokedException(publicKey)); imageValidationThrowOrWarning(new KeyRevokedException(publicKey)); } } } } // Reset installation session and verify that installation completes successfully. mInstallationSession = null; if (!mDynSystem.closePartition()) { throw new IOException("Failed to complete partition installation: " + partitionName); } } } private static String toHexString(byte[] bytes) { private static String toHexString(byte[] bytes) { Loading services/core/java/com/android/server/DynamicSystemService.java +10 −0 Original line number Original line Diff line number Diff line Loading @@ -125,6 +125,16 @@ public class DynamicSystemService extends IDynamicSystemService.Stub { return true; return true; } } @Override public boolean closePartition() throws RemoteException { IGsiService service = getGsiService(); if (service.closePartition() != 0) { Slog.i(TAG, "Partition installation completes with error"); return false; } return true; } @Override @Override public boolean finishInstallation() throws RemoteException { public boolean finishInstallation() throws RemoteException { IGsiService service = getGsiService(); IGsiService service = getGsiService(); Loading Loading
core/java/android/os/image/DynamicSystemManager.java +13 −0 Original line number Original line Diff line number Diff line Loading @@ -154,6 +154,19 @@ public class DynamicSystemManager { throw new RuntimeException(e.toString()); throw new RuntimeException(e.toString()); } } } } /** * Complete the current partition installation. * * @return true if the partition installation completes without error. */ @RequiresPermission(android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM) public boolean closePartition() { try { return mService.closePartition(); } catch (RemoteException e) { throw new RuntimeException(e.toString()); } } /** /** * Finish a previously started installation. Installations without a cooresponding * Finish a previously started installation. Installations without a cooresponding * finishInstallation() will be cleaned up during device boot. * finishInstallation() will be cleaned up during device boot. Loading
core/java/android/os/image/IDynamicSystemService.aidl +7 −0 Original line number Original line Diff line number Diff line Loading @@ -38,6 +38,13 @@ interface IDynamicSystemService */ */ boolean createPartition(@utf8InCpp String name, long size, boolean readOnly); boolean createPartition(@utf8InCpp String name, long size, boolean readOnly); /** * Complete the current partition installation. * * @return true if the partition installation completes without error. */ boolean closePartition(); /** /** * Finish a previously started installation. Installations without * Finish a previously started installation. Installations without * a cooresponding finishInstallation() will be cleaned up during device boot. * a cooresponding finishInstallation() will be cleaned up during device boot. Loading
packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java +11 −0 Original line number Original line Diff line number Diff line Loading @@ -334,6 +334,11 @@ class InstallationAsyncTask extends AsyncTask<String, InstallationAsyncTask.Prog throw new IOException( throw new IOException( "Failed to start installation with requested size: " + mUserdataSize); "Failed to start installation with requested size: " + mUserdataSize); } } // Reset installation session and verify that installation completes successfully. mInstallationSession = null; if (!mDynSystem.closePartition()) { throw new IOException("Failed to complete partition installation: userdata"); } } } private void installImages() private void installImages() Loading Loading @@ -503,6 +508,12 @@ class InstallationAsyncTask extends AsyncTask<String, InstallationAsyncTask.Prog imageValidationThrowOrWarning(new KeyRevokedException(publicKey)); imageValidationThrowOrWarning(new KeyRevokedException(publicKey)); } } } } // Reset installation session and verify that installation completes successfully. mInstallationSession = null; if (!mDynSystem.closePartition()) { throw new IOException("Failed to complete partition installation: " + partitionName); } } } private static String toHexString(byte[] bytes) { private static String toHexString(byte[] bytes) { Loading
services/core/java/com/android/server/DynamicSystemService.java +10 −0 Original line number Original line Diff line number Diff line Loading @@ -125,6 +125,16 @@ public class DynamicSystemService extends IDynamicSystemService.Stub { return true; return true; } } @Override public boolean closePartition() throws RemoteException { IGsiService service = getGsiService(); if (service.closePartition() != 0) { Slog.i(TAG, "Partition installation completes with error"); return false; } return true; } @Override @Override public boolean finishInstallation() throws RemoteException { public boolean finishInstallation() throws RemoteException { IGsiService service = getGsiService(); IGsiService service = getGsiService(); Loading