diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java index 59ea9f0150bfa..f18d4269c3ef7 100644 --- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java +++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java @@ -320,20 +320,21 @@ class InstallationAsyncTask extends AsyncTask { - mInstallationSession = mDynSystem.createPartition("userdata", mUserdataSize, false); - }); - - Log.d(TAG, "Creating partition: userdata, size = " + mUserdataSize); - thread.start(); - - Progress progress = new Progress("userdata", mUserdataSize, mNumInstalledPartitions++); - - while (thread.isAlive()) { - if (isCancelled()) { - return; - } - - final long installedSize = mDynSystem.getInstallationProgress().bytes_processed; - - if (installedSize > progress.installedSize + MIN_PROGRESS_TO_PUBLISH) { - progress.installedSize = installedSize; - publishProgress(progress); - } - - try { - Thread.sleep(100); - } catch (InterruptedException e) { - // Ignore the error. - } - } - - if (mInstallationSession == null) { - 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"); - } + installWritablePartition("userdata", mUserdataSize); } private void installImages() throws IOException, ImageValidationException {