Update StorageSettings to use StorageDashbordFragment.
It previously was set to use the PrivateVolumeSettings. By
swapping it with the new view, we can retain the existing
behavior for external storage (PublicVolumeSettings).
This also restores the summary text to the main Settings
screen.
Bug: 34197071, 34195303
Test: Verified locally that StorageDashboardFragment is started
instead of the PrivateVolumeSettings.
Change-Id: I5de0ea8de799d758272a1406856ae7de9b6fcc8e
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 776c4ec..f529deb 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -3092,7 +3092,7 @@
</activity-alias>
<activity android:name=".Settings$StorageDashboardActivity"
- android:label="@string/storage_settings_2"
+ android:label="@string/storage_settings"
android:icon="@drawable/ic_settings_storage">
<intent-filter android:priority="5">
<action android:name="com.android.settings.action.SETTINGS" />
@@ -3100,7 +3100,7 @@
<meta-data android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.homepage" />
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.deviceinfo.StorageDashboardFragment" />
+ android:value="com.android.settings.deviceinfo.StorageSettings" />
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
android:value="true" />
</activity>
diff --git a/src/com/android/settings/deviceinfo/StorageDashboardFragment.java b/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
index 5d1ac4a..98659d7 100644
--- a/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
+++ b/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
@@ -61,7 +61,8 @@
// Initialize the storage sizes that we can quickly calc.
StorageManager sm = context.getSystemService(StorageManager.class);
- mVolume = sm.findVolumeById(VolumeInfo.ID_PRIVATE_INTERNAL);
+ String volumeId = getArguments().getString(VolumeInfo.EXTRA_VOLUME_ID);
+ mVolume = sm.findVolumeById(volumeId);
if (!isVolumeValid()) {
getActivity().finish();
return;
diff --git a/src/com/android/settings/deviceinfo/StorageSettings.java b/src/com/android/settings/deviceinfo/StorageSettings.java
index 5ee3983..53d4c85 100644
--- a/src/com/android/settings/deviceinfo/StorageSettings.java
+++ b/src/com/android/settings/deviceinfo/StorageSettings.java
@@ -235,9 +235,8 @@
// Only showing primary internal storage, so just shortcut
final Bundle args = new Bundle();
args.putString(VolumeInfo.EXTRA_VOLUME_ID, VolumeInfo.ID_PRIVATE_INTERNAL);
- PrivateVolumeSettings.setVolumeSize(args, sTotalInternalStorage);
Intent intent = Utils.onBuildStartFragmentIntent(getActivity(),
- PrivateVolumeSettings.class.getName(), args, null, R.string.apps_storage, null,
+ StorageDashboardFragment.class.getName(), args, null, R.string.apps_storage, null,
false);
intent.putExtra(SettingsDrawerActivity.EXTRA_SHOW_MENU, true);
getActivity().startActivity(intent);
@@ -280,9 +279,7 @@
if (vol.getType() == VolumeInfo.TYPE_PRIVATE) {
final Bundle args = new Bundle();
args.putString(VolumeInfo.EXTRA_VOLUME_ID, vol.getId());
- PrivateVolumeSettings.setVolumeSize(args, PrivateStorageInfo.getTotalSize(vol,
- sTotalInternalStorage));
- startFragment(this, PrivateVolumeSettings.class.getCanonicalName(),
+ startFragment(this, StorageDashboardFragment.class.getCanonicalName(),
-1, 0, args);
return true;