Merge "Fix NPE at Storage Settings configuration change" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
aab74b24c0
@@ -73,6 +73,7 @@ public class StorageCategoryFragment extends DashboardFragment
|
|||||||
LoaderManager.LoaderCallbacks<SparseArray<StorageAsyncLoader.StorageResult>>,
|
LoaderManager.LoaderCallbacks<SparseArray<StorageAsyncLoader.StorageResult>>,
|
||||||
Preference.OnPreferenceClickListener {
|
Preference.OnPreferenceClickListener {
|
||||||
private static final String TAG = "StorageCategoryFrag";
|
private static final String TAG = "StorageCategoryFrag";
|
||||||
|
private static final String SELECTED_STORAGE_ENTRY_KEY = "selected_storage_entry_key";
|
||||||
private static final String SUMMARY_PREF_KEY = "storage_summary";
|
private static final String SUMMARY_PREF_KEY = "storage_summary";
|
||||||
private static final String FREE_UP_SPACE_PREF_KEY = "free_up_space";
|
private static final String FREE_UP_SPACE_PREF_KEY = "free_up_space";
|
||||||
private static final int STORAGE_JOB_ID = 0;
|
private static final int STORAGE_JOB_ID = 0;
|
||||||
@@ -127,6 +128,10 @@ public class StorageCategoryFragment extends DashboardFragment
|
|||||||
|
|
||||||
mStorageManager = getActivity().getSystemService(StorageManager.class);
|
mStorageManager = getActivity().getSystemService(StorageManager.class);
|
||||||
|
|
||||||
|
if (icicle != null) {
|
||||||
|
mSelectedStorageEntry = icicle.getParcelable(SELECTED_STORAGE_ENTRY_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
initializePreference();
|
initializePreference();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,6 +172,12 @@ public class StorageCategoryFragment extends DashboardFragment
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSaveInstanceState(Bundle outState) {
|
||||||
|
outState.putParcelable(SELECTED_STORAGE_ENTRY_KEY, mSelectedStorageEntry);
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
}
|
||||||
|
|
||||||
private void onReceivedSizes() {
|
private void onReceivedSizes() {
|
||||||
boolean stopLoading = false;
|
boolean stopLoading = false;
|
||||||
if (mStorageInfo != null) {
|
if (mStorageInfo != null) {
|
||||||
|
Reference in New Issue
Block a user