diff options
author | Yo Chiang <yochiang@google.com> | 2020-08-20 19:43:28 +0800 |
---|---|---|
committer | Yo Chiang <yochiang@google.com> | 2020-08-25 07:48:16 +0000 |
commit | 55668c1a49fdb34b2ffee071da9d9ac7dd1a5a9e (patch) | |
tree | 3fc1d20230e717ce8d49d68ee1e96352e12ebfde /packages/DynamicSystemInstallationService/src | |
parent | f288999050900de6f640b4fd10a7211e644b494c (diff) |
Check error status after installing each DSU partition
Add DynamicSystemManager.closePartition() that closes a partition
installation and returns its error status.
InstallationAsyncTask may call this method to do error checking.
Bug: 165471299
Test: Observe the logcat of a failed DSU installation
Change-Id: I9d155c70c6e490899a4acfd35c8096549af005d4
Diffstat (limited to 'packages/DynamicSystemInstallationService/src')
-rw-r--r-- | packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java index f8952ace3cb3..4d31ce97e8b7 100644 --- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java +++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java @@ -334,6 +334,11 @@ class InstallationAsyncTask extends AsyncTask<String, InstallationAsyncTask.Prog throw new IOException( "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() @@ -503,6 +508,12 @@ class InstallationAsyncTask extends AsyncTask<String, InstallationAsyncTask.Prog 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) { |