Merge "Dialog box for networks without an Internet connection"
diff --git a/src/com/android/settings/FingerprintEnroll.java b/src/com/android/settings/FingerprintEnroll.java
index 61bebdf..e56ce08 100644
--- a/src/com/android/settings/FingerprintEnroll.java
+++ b/src/com/android/settings/FingerprintEnroll.java
@@ -254,8 +254,7 @@
case EnrollingStart:
mEnrollmentSteps = -1;
- // TODO: pass in mToken
- mFingerprintManager.enroll(0, mEnrollmentCancel, mEnrollmentCallback, 0);
+ mFingerprintManager.enroll(mToken, mEnrollmentCancel, mEnrollmentCallback, 0);
mProgressBar.setProgress(0);
mEnrolling = true;
startFingerprintAnimator(); // XXX hack - this should follow fingerprint detection
diff --git a/src/com/android/settings/deviceinfo/PrivateVolumeFormatConfirm.java b/src/com/android/settings/deviceinfo/PrivateVolumeFormatConfirm.java
index 1203cf3..666a918 100644
--- a/src/com/android/settings/deviceinfo/PrivateVolumeFormatConfirm.java
+++ b/src/com/android/settings/deviceinfo/PrivateVolumeFormatConfirm.java
@@ -48,7 +48,7 @@
final StorageManager storage = getActivity().getSystemService(StorageManager.class);
final String volumeId = getArguments().getString(VolumeInfo.EXTRA_VOLUME_ID);
mVolume = storage.findVolumeById(volumeId);
- mDisk = storage.findDiskById(mVolume.diskId);
+ mDisk = storage.findDiskById(mVolume.getDiskId());
final View view = inflater.inflate(R.layout.storage_internal_format, container, false);
final TextView body = (TextView) view.findViewById(R.id.body);
@@ -65,7 +65,7 @@
@Override
public void onClick(View v) {
final Intent intent = new Intent(getActivity(), StorageWizardFormatProgress.class);
- intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.id);
+ intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
intent.putExtra(StorageWizardFormatProgress.EXTRA_FORMAT_PUBLIC, true);
startActivity(intent);
getActivity().finish();
diff --git a/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java b/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
index 5674f43..dec259b 100644
--- a/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
+++ b/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
@@ -121,13 +121,13 @@
mVolume = mStorageManager.findVolumeById(mVolumeId);
Preconditions.checkNotNull(mVolume);
- Preconditions.checkState(mVolume.type == VolumeInfo.TYPE_PRIVATE);
+ Preconditions.checkState(mVolume.getType() == VolumeInfo.TYPE_PRIVATE);
addPreferencesFromResource(R.xml.device_info_storage_volume);
// Find the emulated shared storage layered above this private volume
mSharedVolume = mStorageManager.findVolumeById(
- mVolume.id.replace("private", "emulated"));
+ mVolume.getId().replace("private", "emulated"));
mMeasure = new StorageMeasurement(context, mVolume, mSharedVolume);
mMeasure.setReceiver(mReceiver);
@@ -168,7 +168,7 @@
screen.removeAll();
- if (mVolume.state != VolumeInfo.STATE_MOUNTED) {
+ if (mVolume.getState() != VolumeInfo.STATE_MOUNTED) {
return;
}
@@ -202,7 +202,7 @@
}
}
- final File file = new File(mVolume.path);
+ final File file = mVolume.getPath();
mTotalSize = file.getTotalSpace();
mAvailSize = file.getFreeSpace();
@@ -272,15 +272,15 @@
// Actions live in menu for non-internal private volumes; they're shown
// as preference items for public volumes.
- if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(mVolume.id)) {
+ if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(mVolume.getId())) {
rename.setVisible(false);
mount.setVisible(false);
unmount.setVisible(false);
format.setVisible(false);
} else {
- rename.setVisible(mVolume.type == VolumeInfo.TYPE_PRIVATE);
- mount.setVisible(mVolume.state == VolumeInfo.STATE_UNMOUNTED);
- unmount.setVisible(mVolume.state == VolumeInfo.STATE_MOUNTED);
+ rename.setVisible(mVolume.getType() == VolumeInfo.TYPE_PRIVATE);
+ mount.setVisible(mVolume.getState() == VolumeInfo.STATE_UNMOUNTED);
+ unmount.setVisible(mVolume.getState() == VolumeInfo.STATE_MOUNTED);
format.setVisible(true);
}
@@ -300,12 +300,12 @@
new MountTask(context, mVolume).execute();
return true;
case R.id.storage_unmount:
- args.putString(VolumeInfo.EXTRA_VOLUME_ID, mVolume.id);
+ args.putString(VolumeInfo.EXTRA_VOLUME_ID, mVolume.getId());
startFragment(this, PrivateVolumeUnmountConfirm.class.getCanonicalName(),
R.string.storage_menu_unmount, 0, args);
return true;
case R.id.storage_format:
- args.putString(VolumeInfo.EXTRA_VOLUME_ID, mVolume.id);
+ args.putString(VolumeInfo.EXTRA_VOLUME_ID, mVolume.getId());
startFragment(this, PrivateVolumeFormatConfirm.class.getCanonicalName(),
R.string.storage_menu_format, 0, args);
return true;
@@ -428,7 +428,15 @@
private final StorageEventListener mStorageListener = new StorageEventListener() {
@Override
public void onVolumeStateChanged(VolumeInfo vol, int oldState, int newState) {
- if (Objects.equals(mVolume.id, vol.id)) {
+ if (Objects.equals(mVolume.getId(), vol.getId())) {
+ mVolume = vol;
+ refresh();
+ }
+ }
+
+ @Override
+ public void onVolumeMetadataChanged(VolumeInfo vol) {
+ if (Objects.equals(mVolume.getId(), vol.getId())) {
mVolume = vol;
refresh();
}
@@ -462,8 +470,8 @@
final View view = dialogInflater.inflate(R.layout.dialog_edittext, null, false);
final EditText nickname = (EditText) view.findViewById(R.id.edittext);
- if (!TextUtils.isEmpty(vol.nickname)) {
- nickname.setText(vol.nickname);
+ if (!TextUtils.isEmpty(vol.getNickname())) {
+ nickname.setText(vol.getNickname());
} else {
nickname.setText(storageManager.getBestVolumeDescription(vol));
}
@@ -475,7 +483,8 @@
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- // TODO: persist the edited nickname!
+ // TODO: move to background thread
+ storageManager.setVolumeNickname(volId, nickname.getText().toString());
}
});
builder.setNegativeButton(R.string.cancel, null);
diff --git a/src/com/android/settings/deviceinfo/PrivateVolumeUnmountConfirm.java b/src/com/android/settings/deviceinfo/PrivateVolumeUnmountConfirm.java
index c592e9d..614b737 100644
--- a/src/com/android/settings/deviceinfo/PrivateVolumeUnmountConfirm.java
+++ b/src/com/android/settings/deviceinfo/PrivateVolumeUnmountConfirm.java
@@ -48,7 +48,7 @@
final StorageManager storage = getActivity().getSystemService(StorageManager.class);
final String volumeId = getArguments().getString(VolumeInfo.EXTRA_VOLUME_ID);
mVolume = storage.findVolumeById(volumeId);
- mDisk = storage.findDiskById(mVolume.id);
+ mDisk = storage.findDiskById(mVolume.getDiskId());
final View view = inflater.inflate(R.layout.storage_internal_unmount, container, false);
final TextView body = (TextView) view.findViewById(R.id.body);
diff --git a/src/com/android/settings/deviceinfo/PublicVolumeSettings.java b/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
index 75e040f..94a505b 100644
--- a/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
+++ b/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
@@ -91,12 +91,12 @@
}
Preconditions.checkNotNull(mVolume);
- Preconditions.checkState(mVolume.type == VolumeInfo.TYPE_PUBLIC);
+ Preconditions.checkState(mVolume.getType() == VolumeInfo.TYPE_PUBLIC);
- mDisk = mStorageManager.findDiskById(mVolume.diskId);
+ mDisk = mStorageManager.findDiskById(mVolume.getDiskId());
Preconditions.checkNotNull(mDisk);
- mVolumeId = mVolume.id;
+ mVolumeId = mVolume.getId();
addPreferencesFromResource(R.xml.device_info_storage_volume);
@@ -118,34 +118,34 @@
screen.removeAll();
- if (mVolume.state == VolumeInfo.STATE_MOUNTED) {
+ if (mVolume.getState() == VolumeInfo.STATE_MOUNTED) {
screen.addPreference(mGraph);
screen.addPreference(mTotal);
screen.addPreference(mAvailable);
+
+ final File file = mVolume.getPath();
+ mTotalSize = file.getTotalSpace();
+ mAvailSize = file.getFreeSpace();
+
+ mTotal.setSummary(Formatter.formatFileSize(context, mTotalSize));
+ mAvailable.setSummary(Formatter.formatFileSize(context, mAvailSize));
+
+ mGraph.clear();
+ mGraph.addEntry(0, (mTotalSize - mAvailSize) / (float) mTotalSize,
+ android.graphics.Color.GRAY);
+ mGraph.commit();
}
- if (mVolume.state == VolumeInfo.STATE_UNMOUNTED) {
+ if (mVolume.getState() == VolumeInfo.STATE_UNMOUNTED) {
screen.addPreference(mMount);
}
- if (mVolume.state == VolumeInfo.STATE_MOUNTED) {
+ if (mVolume.getState() == VolumeInfo.STATE_MOUNTED) {
screen.addPreference(mUnmount);
}
screen.addPreference(mFormat);
- if ((mDisk.flags & DiskInfo.FLAG_ADOPTABLE) != 0) {
+ if (mDisk.isAdoptable()) {
screen.addPreference(mFormatInternal);
}
-
- final File file = new File(mVolume.path);
- mTotalSize = file.getTotalSpace();
- mAvailSize = file.getFreeSpace();
-
- mTotal.setSummary(Formatter.formatFileSize(context, mTotalSize));
- mAvailable.setSummary(Formatter.formatFileSize(context, mAvailSize));
-
- mGraph.clear();
- mGraph.addEntry(0, (mTotalSize - mAvailSize) / (float) mTotalSize,
- android.graphics.Color.GRAY);
- mGraph.commit();
}
private UsageBarPreference buildGraph() {
@@ -200,7 +200,7 @@
new FormatTask(context, mVolume).execute();
} else if (pref == mFormatInternal) {
final Intent intent = new Intent(context, StorageWizardFormatConfirm.class);
- intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.id);
+ intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
startActivity(intent);
}
@@ -210,7 +210,15 @@
private final StorageEventListener mStorageListener = new StorageEventListener() {
@Override
public void onVolumeStateChanged(VolumeInfo vol, int oldState, int newState) {
- if (Objects.equals(mVolume.id, vol.id)) {
+ if (Objects.equals(mVolume.getId(), vol.getId())) {
+ mVolume = vol;
+ refresh();
+ }
+ }
+
+ @Override
+ public void onVolumeMetadataChanged(VolumeInfo vol) {
+ if (Objects.equals(mVolume.getId(), vol.getId())) {
mVolume = vol;
refresh();
}
diff --git a/src/com/android/settings/deviceinfo/StorageMeasurement.java b/src/com/android/settings/deviceinfo/StorageMeasurement.java
index db91fdb..a3c4aec 100644
--- a/src/com/android/settings/deviceinfo/StorageMeasurement.java
+++ b/src/com/android/settings/deviceinfo/StorageMeasurement.java
@@ -345,7 +345,7 @@
final Message finished = mMeasurementHandler.obtainMessage(MeasurementHandler.MSG_COMPLETED,
details);
- if (mSharedVolume != null && mSharedVolume.state == VolumeInfo.STATE_MOUNTED) {
+ if (mSharedVolume != null && mSharedVolume.getState() == VolumeInfo.STATE_MOUNTED) {
final File basePath = mSharedVolume.getPathForUser(currentUser);
// Measure media types for emulated storage, or for primary physical
@@ -359,7 +359,7 @@
// Measure misc files not counted under media
details.miscSize = measureMisc(imcs, basePath);
- if (mSharedVolume.type == VolumeInfo.TYPE_EMULATED) {
+ if (mSharedVolume.getType() == VolumeInfo.TYPE_EMULATED) {
// Measure total emulated storage of all users; internal apps data
// will be spliced in later
for (UserInfo user : users) {
@@ -371,14 +371,14 @@
}
// Measure all apps hosted on this volume for all users
- if (mVolume.type == VolumeInfo.TYPE_PRIVATE) {
+ if (mVolume.getType() == VolumeInfo.TYPE_PRIVATE) {
final List<ApplicationInfo> apps = packageManager.getInstalledApplications(
PackageManager.GET_UNINSTALLED_PACKAGES
| PackageManager.GET_DISABLED_COMPONENTS);
final List<ApplicationInfo> volumeApps = new ArrayList<>();
for (ApplicationInfo app : apps) {
- if (Objects.equals(app.volumeUuid, mVolume.fsUuid)) {
+ if (Objects.equals(app.volumeUuid, mVolume.getFsUuid())) {
volumeApps.add(app);
}
}
diff --git a/src/com/android/settings/deviceinfo/StorageSettings.java b/src/com/android/settings/deviceinfo/StorageSettings.java
index 255788d..1e33230d 100644
--- a/src/com/android/settings/deviceinfo/StorageSettings.java
+++ b/src/com/android/settings/deviceinfo/StorageSettings.java
@@ -94,10 +94,12 @@
private static final Comparator<VolumeInfo> sVolumeComparator = new Comparator<VolumeInfo>() {
@Override
public int compare(VolumeInfo lhs, VolumeInfo rhs) {
- if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(lhs.id)) {
+ if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(lhs.getId())) {
return -1;
} else if (lhs.getDescription() == null) {
return 1;
+ } else if (rhs.getDescription() == null) {
+ return -1;
} else {
return lhs.getDescription().compareTo(rhs.getDescription());
}
@@ -114,7 +116,13 @@
};
private static boolean isInteresting(VolumeInfo vol) {
- return vol.type == VolumeInfo.TYPE_PRIVATE || vol.type == VolumeInfo.TYPE_PUBLIC;
+ switch(vol.getType()) {
+ case VolumeInfo.TYPE_PRIVATE:
+ case VolumeInfo.TYPE_PUBLIC:
+ return true;
+ default:
+ return false;
+ }
}
private void refresh() {
@@ -128,9 +136,9 @@
Collections.sort(volumes, sVolumeComparator);
for (VolumeInfo vol : volumes) {
- if (vol.type == VolumeInfo.TYPE_PRIVATE) {
+ if (vol.getType() == VolumeInfo.TYPE_PRIVATE) {
mInternalCategory.addPreference(new StorageVolumePreference(context, vol));
- } else if (vol.type == VolumeInfo.TYPE_PUBLIC) {
+ } else if (vol.getType() == VolumeInfo.TYPE_PUBLIC) {
mExternalCategory.addPreference(new StorageVolumePreference(context, vol));
}
}
@@ -186,15 +194,15 @@
if (vol == null) {
return false;
- } else if (vol.type == VolumeInfo.TYPE_PRIVATE) {
+ } else if (vol.getType() == VolumeInfo.TYPE_PRIVATE) {
final Bundle args = new Bundle();
args.putString(VolumeInfo.EXTRA_VOLUME_ID, volId);
startFragment(this, PrivateVolumeSettings.class.getCanonicalName(),
-1, 0, args);
return true;
- } else if (vol.type == VolumeInfo.TYPE_PUBLIC) {
- if (vol.state == VolumeInfo.STATE_MOUNTED) {
+ } else if (vol.getType() == VolumeInfo.TYPE_PUBLIC) {
+ if (vol.getState() == VolumeInfo.STATE_MOUNTED) {
startActivity(vol.buildBrowseIntent());
return true;
} else {
@@ -218,7 +226,7 @@
public MountTask(Context context, VolumeInfo volume) {
mContext = context.getApplicationContext();
mStorageManager = mContext.getSystemService(StorageManager.class);
- mVolumeId = volume.id;
+ mVolumeId = volume.getId();
mDescription = mStorageManager.getBestVolumeDescription(volume);
}
@@ -254,7 +262,7 @@
public UnmountTask(Context context, VolumeInfo volume) {
mContext = context.getApplicationContext();
mStorageManager = mContext.getSystemService(StorageManager.class);
- mVolumeId = volume.id;
+ mVolumeId = volume.getId();
mDescription = mStorageManager.getBestVolumeDescription(volume);
}
@@ -290,7 +298,7 @@
public FormatTask(Context context, VolumeInfo volume) {
mContext = context.getApplicationContext();
mStorageManager = mContext.getSystemService(StorageManager.class);
- mVolumeId = volume.id;
+ mVolumeId = volume.getId();
mDescription = mStorageManager.getBestVolumeDescription(volume);
}
diff --git a/src/com/android/settings/deviceinfo/StorageVolumePreference.java b/src/com/android/settings/deviceinfo/StorageVolumePreference.java
index a2136bd..f127dfb 100644
--- a/src/com/android/settings/deviceinfo/StorageVolumePreference.java
+++ b/src/com/android/settings/deviceinfo/StorageVolumePreference.java
@@ -44,13 +44,13 @@
mStorageManager = context.getSystemService(StorageManager.class);
mVolume = volume;
- setKey(volume.id);
+ setKey(volume.getId());
setTitle(mStorageManager.getBestVolumeDescription(volume));
- switch (volume.state) {
+ switch (volume.getState()) {
case VolumeInfo.STATE_MOUNTED:
// TODO: move statfs() to background thread
- final File path = new File(volume.path);
+ final File path = volume.getPath();
final String free = Formatter.formatFileSize(context, path.getFreeSpace());
final String total = Formatter.formatFileSize(context, path.getTotalSpace());
setSummary(context.getString(R.string.storage_volume_summary, free, total));
@@ -58,13 +58,14 @@
}
// TODO: better icons
- if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(volume.id)) {
+ if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(volume.getId())) {
setIcon(context.getDrawable(R.drawable.ic_settings_storage));
} else {
setIcon(context.getDrawable(R.drawable.ic_sim_sd));
}
- if (volume.type == VolumeInfo.TYPE_PUBLIC && volume.state == VolumeInfo.STATE_MOUNTED) {
+ if (volume.getType() == VolumeInfo.TYPE_PUBLIC
+ && volume.getState() == VolumeInfo.STATE_MOUNTED) {
setWidgetLayoutResource(R.layout.preference_storage_action);
}
}
diff --git a/src/com/android/settings/deviceinfo/StorageWizardBase.java b/src/com/android/settings/deviceinfo/StorageWizardBase.java
index ceacff9..4cb48c5 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardBase.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardBase.java
@@ -57,7 +57,7 @@
if (!TextUtils.isEmpty(diskId)) {
mDisk = mStorage.findDiskById(diskId);
} else {
- mDisk = mStorage.findDiskById(mVolume.diskId);
+ mDisk = mStorage.findDiskById(mVolume.getDiskId());
}
setTheme(R.style.SuwThemeMaterial_Light);
diff --git a/src/com/android/settings/deviceinfo/StorageWizardFormatConfirm.java b/src/com/android/settings/deviceinfo/StorageWizardFormatConfirm.java
index b4c8426..f4f475f 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardFormatConfirm.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardFormatConfirm.java
@@ -42,7 +42,7 @@
@Override
public void onNavigateNext() {
final Intent intent = new Intent(this, StorageWizardFormatProgress.class);
- intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.id);
+ intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
startActivity(intent);
finishAffinity();
}
diff --git a/src/com/android/settings/deviceinfo/StorageWizardFormatProgress.java b/src/com/android/settings/deviceinfo/StorageWizardFormatProgress.java
index 7dd347f..2996d45 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardFormatProgress.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardFormatProgress.java
@@ -59,9 +59,9 @@
protected Exception doInBackground(Void... params) {
try {
if (mFormatPublic) {
- mStorage.partitionPublic(mDisk.id);
+ mStorage.partitionPublic(mDisk.getId());
} else {
- mStorage.partitionPrivate(mDisk.id);
+ mStorage.partitionPrivate(mDisk.getId());
}
return null;
} catch (Exception e) {
@@ -74,8 +74,12 @@
final Context context = StorageWizardFormatProgress.this;
if (e == null) {
if (!mFormatPublic) {
- final Intent intent = new Intent(context, StorageWizardMigrate.class);
- intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.id);
+ // TODO: bring back migration once implemented
+// final Intent intent = new Intent(context, StorageWizardMigrate.class);
+// intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
+// startActivity(intent);
+ final Intent intent = new Intent(context, StorageWizardReady.class);
+ intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
startActivity(intent);
}
finishAffinity();
diff --git a/src/com/android/settings/deviceinfo/StorageWizardInit.java b/src/com/android/settings/deviceinfo/StorageWizardInit.java
index b4d1a51..9d59231 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardInit.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardInit.java
@@ -72,12 +72,15 @@
@Override
public void onNavigateNext() {
if (mRadioExternal.isChecked()) {
+ // Remember that user made decision
+ mStorage.setVolumeInited(mVolume.getId(), true);
+
final Intent intent = new Intent(this, StorageWizardReady.class);
- intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.id);
+ intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
startActivity(intent);
} else if (mRadioInternal.isChecked()) {
final Intent intent = new Intent(this, StorageWizardFormatConfirm.class);
- intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.id);
+ intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
startActivity(intent);
}
}
diff --git a/src/com/android/settings/deviceinfo/StorageWizardMigrate.java b/src/com/android/settings/deviceinfo/StorageWizardMigrate.java
index 82e32ba..4d42613 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardMigrate.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardMigrate.java
@@ -71,11 +71,11 @@
public void onNavigateNext() {
if (mRadioNow.isChecked()) {
final Intent intent = new Intent(this, StorageWizardMigrateConfirm.class);
- intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.id);
+ intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
startActivity(intent);
} else if (mRadioLater.isChecked()) {
final Intent intent = new Intent(this, StorageWizardReady.class);
- intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.id);
+ intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
startActivity(intent);
}
}
diff --git a/src/com/android/settings/deviceinfo/StorageWizardMigrateConfirm.java b/src/com/android/settings/deviceinfo/StorageWizardMigrateConfirm.java
index 6972031..9aa1441 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardMigrateConfirm.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardMigrateConfirm.java
@@ -46,7 +46,7 @@
@Override
public void onNavigateNext() {
final Intent intent = new Intent(this, StorageWizardMigrateProgress.class);
- intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.id);
+ intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
startActivity(intent);
finishAffinity();
}
diff --git a/src/com/android/settings/deviceinfo/StorageWizardMigrateProgress.java b/src/com/android/settings/deviceinfo/StorageWizardMigrateProgress.java
index 9bf31f9..b53b250 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardMigrateProgress.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardMigrateProgress.java
@@ -62,7 +62,7 @@
final Context context = StorageWizardMigrateProgress.this;
if (e == null) {
final Intent intent = new Intent(context, StorageWizardReady.class);
- intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.id);
+ intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
startActivity(intent);
finishAffinity();
diff --git a/src/com/android/settings/deviceinfo/StorageWizardReady.java b/src/com/android/settings/deviceinfo/StorageWizardReady.java
index 76324a9..26038ce 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardReady.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardReady.java
@@ -22,6 +22,9 @@
import com.android.internal.util.Preconditions;
import com.android.settings.R;
+import java.util.List;
+import java.util.Objects;
+
public class StorageWizardReady extends StorageWizardBase {
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -34,15 +37,15 @@
// TODO: handle mixed partition cases instead of just guessing based on
// first volume type we encounter
- for (String volId : mDisk.volumeIds) {
- final VolumeInfo vol = mStorage.findVolumeById(volId);
- if (vol == null) continue;
+ final List<VolumeInfo> vols = mStorage.getVolumes();
+ for (VolumeInfo vol : vols) {
+ if (!Objects.equals(mDisk.getId(), vol.getDiskId())) continue;
- if (vol.type == VolumeInfo.TYPE_PUBLIC) {
+ if (vol.getType() == VolumeInfo.TYPE_PUBLIC) {
setBodyText(R.string.storage_wizard_ready_external_body,
mDisk.getDescription());
break;
- } else if (vol.type == VolumeInfo.TYPE_PRIVATE) {
+ } else if (vol.getType() == VolumeInfo.TYPE_PRIVATE) {
setBodyText(R.string.storage_wizard_ready_internal_body,
mDisk.getDescription());
break;