Loading src/com/android/settings/deviceinfo/StorageSettings.java +13 −9 Original line number Original line Diff line number Diff line Loading @@ -93,6 +93,8 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index private StorageSummaryPreference mInternalSummary; private StorageSummaryPreference mInternalSummary; private static long sTotalInternalStorage; private static long sTotalInternalStorage; private boolean mHasLaunchedPrivateVolumeSettings = false; @Override @Override public int getMetricsCategory() { public int getMetricsCategory() { return MetricsEvent.DEVICEINFO_STORAGE; return MetricsEvent.DEVICEINFO_STORAGE; Loading @@ -110,7 +112,6 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index final Context context = getActivity(); final Context context = getActivity(); mStorageManager = context.getSystemService(StorageManager.class); mStorageManager = context.getSystemService(StorageManager.class); mStorageManager.registerListener(mStorageListener); if (sTotalInternalStorage <= 0) { if (sTotalInternalStorage <= 0) { sTotalInternalStorage = mStorageManager.getPrimaryStorageSize(); sTotalInternalStorage = mStorageManager.getPrimaryStorageSize(); Loading Loading @@ -231,6 +232,8 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index if (mInternalCategory.getPreferenceCount() == 2 if (mInternalCategory.getPreferenceCount() == 2 && mExternalCategory.getPreferenceCount() == 0) { && mExternalCategory.getPreferenceCount() == 0) { // Only showing primary internal storage, so just shortcut // Only showing primary internal storage, so just shortcut if (!mHasLaunchedPrivateVolumeSettings) { mHasLaunchedPrivateVolumeSettings = true; final Bundle args = new Bundle(); final Bundle args = new Bundle(); args.putString(VolumeInfo.EXTRA_VOLUME_ID, VolumeInfo.ID_PRIVATE_INTERNAL); args.putString(VolumeInfo.EXTRA_VOLUME_ID, VolumeInfo.ID_PRIVATE_INTERNAL); Intent intent = Utils.onBuildStartFragmentIntent(getActivity(), Intent intent = Utils.onBuildStartFragmentIntent(getActivity(), Loading @@ -241,6 +244,7 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index finish(); finish(); } } } } } @Override @Override public void onResume() { public void onResume() { Loading Loading
src/com/android/settings/deviceinfo/StorageSettings.java +13 −9 Original line number Original line Diff line number Diff line Loading @@ -93,6 +93,8 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index private StorageSummaryPreference mInternalSummary; private StorageSummaryPreference mInternalSummary; private static long sTotalInternalStorage; private static long sTotalInternalStorage; private boolean mHasLaunchedPrivateVolumeSettings = false; @Override @Override public int getMetricsCategory() { public int getMetricsCategory() { return MetricsEvent.DEVICEINFO_STORAGE; return MetricsEvent.DEVICEINFO_STORAGE; Loading @@ -110,7 +112,6 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index final Context context = getActivity(); final Context context = getActivity(); mStorageManager = context.getSystemService(StorageManager.class); mStorageManager = context.getSystemService(StorageManager.class); mStorageManager.registerListener(mStorageListener); if (sTotalInternalStorage <= 0) { if (sTotalInternalStorage <= 0) { sTotalInternalStorage = mStorageManager.getPrimaryStorageSize(); sTotalInternalStorage = mStorageManager.getPrimaryStorageSize(); Loading Loading @@ -231,6 +232,8 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index if (mInternalCategory.getPreferenceCount() == 2 if (mInternalCategory.getPreferenceCount() == 2 && mExternalCategory.getPreferenceCount() == 0) { && mExternalCategory.getPreferenceCount() == 0) { // Only showing primary internal storage, so just shortcut // Only showing primary internal storage, so just shortcut if (!mHasLaunchedPrivateVolumeSettings) { mHasLaunchedPrivateVolumeSettings = true; final Bundle args = new Bundle(); final Bundle args = new Bundle(); args.putString(VolumeInfo.EXTRA_VOLUME_ID, VolumeInfo.ID_PRIVATE_INTERNAL); args.putString(VolumeInfo.EXTRA_VOLUME_ID, VolumeInfo.ID_PRIVATE_INTERNAL); Intent intent = Utils.onBuildStartFragmentIntent(getActivity(), Intent intent = Utils.onBuildStartFragmentIntent(getActivity(), Loading @@ -241,6 +244,7 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index finish(); finish(); } } } } } @Override @Override public void onResume() { public void onResume() { Loading