Hook up the storage item preferences to actual data.

This uses the same storage query implementation as the previous
iteration of the Storage Settings. In b/32206268, a new API for
querying this information will be added for querying this info.

Once the new API has landed, a future patch will swap out the
impl, but this should work for today.

Bug: 33199077
Test: Settings Robo Tests
Change-Id: I58763e8ee38aabbea533bc614268288e854ff8d4
This commit is contained in:
Daniel Nishi
2017-01-09 14:49:04 -08:00
parent 8cc6f9f718
commit 884809199f
3 changed files with 203 additions and 12 deletions

View File

@@ -81,6 +81,8 @@ public class StorageDashboardFragment extends DashboardFragment {
final long usedBytes = mTotalSize - mVolume.getPath().getFreeSpace();
mSummaryController.updateBytes(usedBytes, mTotalSize);
mPreferenceController.setVolume(mVolume);
mPreferenceController.setSystemSize(systemSize);
mPreferenceController.startMeasurement();
// Initialize the footer preference to go to the smart storage management.
final FooterPreference pref = mFooterPreferenceMixin.createFooterPreference();
@@ -119,8 +121,8 @@ public class StorageDashboardFragment extends DashboardFragment {
controllers.add(mSummaryController);
StorageManager sm = context.getSystemService(StorageManager.class);
mPreferenceController = new StorageItemPreferenceController(context, this, mVolume,
new StorageManagerVolumeProvider(sm));
mPreferenceController = new StorageItemPreferenceController(context, getLifecycle(), this,
mVolume, new StorageManagerVolumeProvider(sm));
controllers.add(mPreferenceController);
controllers.add(new ManageStoragePreferenceController(context));
return controllers;