summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2015-04-14 21:42:46 -0700
committerJeff Sharkey <jsharkey@android.com>2015-04-14 21:53:28 -0700
commit4366b565e150f3744dad66685806c55459d56c46 (patch)
treeffa428632a08b2d2ef9597dd1a987fccfd14574d /src/com/android/settings/deviceinfo/PublicVolumeSettings.java
parent2949a4ab4d342a315420ccda07c02075edccd4f0 (diff)
downloadpackages_apps_Settings-4366b565e150f3744dad66685806c55459d56c46.tar.gz
packages_apps_Settings-4366b565e150f3744dad66685806c55459d56c46.tar.bz2
packages_apps_Settings-4366b565e150f3744dad66685806c55459d56c46.zip
Storage accessors; persist nickname, flags.
Move to using new public accessors on DiskInfo and VolumeInfo. Persist nickname changes, and remember when user has initialized a public volume. Also skip the migration part of storage wizard until it's implemented. Bug: 19993667 Change-Id: I642fb43afb95380fddd48a1dad438e87b06454da
Diffstat (limited to 'src/com/android/settings/deviceinfo/PublicVolumeSettings.java')
-rw-r--r--src/com/android/settings/deviceinfo/PublicVolumeSettings.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/com/android/settings/deviceinfo/PublicVolumeSettings.java b/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
index 75e040f80..71fe23dde 100644
--- a/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
+++ b/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
@@ -91,12 +91,12 @@ public class PublicVolumeSettings extends SettingsPreferenceFragment {
}
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,24 +118,24 @@ public class PublicVolumeSettings extends SettingsPreferenceFragment {
screen.removeAll();
- if (mVolume.state == VolumeInfo.STATE_MOUNTED) {
+ if (mVolume.getState() == VolumeInfo.STATE_MOUNTED) {
screen.addPreference(mGraph);
screen.addPreference(mTotal);
screen.addPreference(mAvailable);
}
- 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);
+ final File file = mVolume.getPath();
mTotalSize = file.getTotalSpace();
mAvailSize = file.getFreeSpace();
@@ -200,7 +200,7 @@ public class PublicVolumeSettings extends SettingsPreferenceFragment {
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,7 @@ public class PublicVolumeSettings extends SettingsPreferenceFragment {
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();
}