Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aab74b24 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE at Storage Settings configuration change" into sc-dev

parents 90c29cf0 07f2086e
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ public class StorageCategoryFragment extends DashboardFragment
        LoaderManager.LoaderCallbacks<SparseArray<StorageAsyncLoader.StorageResult>>,
        Preference.OnPreferenceClickListener {
    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 FREE_UP_SPACE_PREF_KEY = "free_up_space";
    private static final int STORAGE_JOB_ID = 0;
@@ -127,6 +128,10 @@ public class StorageCategoryFragment extends DashboardFragment

        mStorageManager = getActivity().getSystemService(StorageManager.class);

        if (icicle != null) {
            mSelectedStorageEntry = icicle.getParcelable(SELECTED_STORAGE_ENTRY_KEY);
        }

        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() {
        boolean stopLoading = false;
        if (mStorageInfo != null) {