Returning to wizard, enable migration.

Bring primary storage migration back into the adoption flow, and
provide a path for long-lived notifications to re-launch into the
Settings app.  Also provide option to initiate migration if skipped
during wizard.  For now, estmiate migration size and time based on
a Class 10 card.

Follow other callback refactoring.

Bug: 19993667
Change-Id: Ia0c28eb114bc6c8066c17b3142ed74f962140c91
This commit is contained in:
Jeff Sharkey
2015-04-29 11:24:57 -07:00
parent a03f330af3
commit e77f0687dd
17 changed files with 295 additions and 80 deletions

View File

@@ -35,6 +35,8 @@ import com.android.setupwizardlib.view.NavigationBar;
import com.android.setupwizardlib.view.NavigationBar.NavigationBarListener;
import java.text.NumberFormat;
import java.util.List;
import java.util.Objects;
public abstract class StorageWizardBase extends Activity implements NavigationBarListener {
protected StorageManager mStorage;
@@ -56,7 +58,7 @@ public abstract class StorageWizardBase extends Activity implements NavigationBa
final String diskId = getIntent().getStringExtra(DiskInfo.EXTRA_DISK_ID);
if (!TextUtils.isEmpty(diskId)) {
mDisk = mStorage.findDiskById(diskId);
} else {
} else if (mVolume != null) {
mDisk = mVolume.getDisk();
}
@@ -130,4 +132,14 @@ public abstract class StorageWizardBase extends Activity implements NavigationBa
public void onNavigateNext() {
throw new UnsupportedOperationException();
}
protected VolumeInfo findFirstVolume(int type) {
final List<VolumeInfo> vols = mStorage.getVolumes();
for (VolumeInfo vol : vols) {
if (Objects.equals(mDisk.getId(), vol.getDiskId()) && (vol.getType() == type)) {
return vol;
}
}
return null;
}
}