Format as public/private; follow refactoring.
Offer to format an empty disk as public/private. Bug: 19993667 Change-Id: I69fafaed524f3ef5e65d04a9e3a94789fcfc3087
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.settings.deviceinfo;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.storage.DiskInfo;
|
||||
import android.os.storage.VolumeInfo;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||
import android.widget.RadioButton;
|
||||
@@ -72,15 +73,26 @@ public class StorageWizardInit extends StorageWizardBase {
|
||||
@Override
|
||||
public void onNavigateNext() {
|
||||
if (mRadioExternal.isChecked()) {
|
||||
// Remember that user made decision
|
||||
mStorage.setVolumeInited(mVolume.getId(), true);
|
||||
if (mVolume != null && mVolume.getType() == VolumeInfo.TYPE_PUBLIC) {
|
||||
// Remember that user made decision
|
||||
mStorage.setVolumeInited(mVolume.getFsUuid(), true);
|
||||
|
||||
final Intent intent = new Intent(this, StorageWizardReady.class);
|
||||
intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
|
||||
startActivity(intent);
|
||||
|
||||
} else {
|
||||
// Gotta format to get there
|
||||
final Intent intent = new Intent(this, StorageWizardFormatConfirm.class);
|
||||
intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
|
||||
intent.putExtra(StorageWizardFormatConfirm.EXTRA_FORMAT_PRIVATE, false);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
final Intent intent = new Intent(this, StorageWizardReady.class);
|
||||
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.getId());
|
||||
intent.putExtra(StorageWizardFormatConfirm.EXTRA_FORMAT_PRIVATE, true);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user