diff options
-rw-r--r-- | src/com/android/settings/deviceinfo/StorageWizardFormatProgress.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/settings/deviceinfo/StorageWizardFormatProgress.java b/src/com/android/settings/deviceinfo/StorageWizardFormatProgress.java index 9ab714a..e2e6dbe 100644 --- a/src/com/android/settings/deviceinfo/StorageWizardFormatProgress.java +++ b/src/com/android/settings/deviceinfo/StorageWizardFormatProgress.java @@ -55,12 +55,23 @@ public class StorageWizardFormatProgress extends StorageWizardBase { new PartitionTask().execute(); } - public class PartitionTask extends AsyncTask<Void, Void, Exception> { + public class PartitionTask extends AsyncTask<Void, Integer, Exception> { @Override protected Exception doInBackground(Void... params) { try { if (mFormatPrivate) { mStorage.partitionPrivate(mDisk.getId()); + publishProgress(40); + + final long internalBench = mStorage.benchmark(null); + publishProgress(60); + + final VolumeInfo privateVol = findFirstVolume(VolumeInfo.TYPE_PRIVATE); + final long privateBench = mStorage.benchmark(privateVol.id); + + // TODO: plumb through to user when below threshold + final float pct = (float) internalBench / (float) privateBench; + Log.d(TAG, "New volume is " + pct + "x the speed of internal"); } else { mStorage.partitionPublic(mDisk.getId()); } @@ -71,6 +82,11 @@ public class StorageWizardFormatProgress extends StorageWizardBase { } @Override + protected void onProgressUpdate(Integer... progress) { + setCurrentProgress(progress[0]); + } + + @Override protected void onPostExecute(Exception e) { final Context context = StorageWizardFormatProgress.this; if (e == null) { |