Erase SD Card fixed in Settings/Storage.

Adding the StorageVolume to the format intent.

Change-Id: If1a50a2d5c5154e9f00116db536c62324c447e7c
This commit is contained in:
Gilles Debunne
2011-05-25 18:34:59 -07:00
parent e9f5a2975b
commit 6d36fd3a03
4 changed files with 41 additions and 52 deletions

View File

@@ -19,6 +19,7 @@ package com.android.settings;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.storage.StorageVolume;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
@@ -57,6 +58,10 @@ public class MediaFormat extends Activity {
}
Intent intent = new Intent(ExternalStorageFormatter.FORMAT_ONLY);
intent.setComponent(ExternalStorageFormatter.COMPONENT_NAME);
// Transfer the storage volume to the new intent
final StorageVolume storageVolume = getIntent().getParcelableExtra(
StorageVolume.EXTRA_STORAGE_VOLUME);
intent.putExtra(StorageVolume.EXTRA_STORAGE_VOLUME, storageVolume);
startService(intent);
finish();
}