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

Commit 90abf05c authored by Joel Galenson's avatar Joel Galenson
Browse files

Do not save/restore whether the dashboard has finished loading.

We store whether or not the dashboard has finished loading so we know
which progress bar to show.  If we save/restore this, then when we
restore the activity, we think we have finished loading when we have
not and crash trying to show something that has not been initialized.

Fixes: 130635760
Test: Change developer option to always clear activities, open
dashboard, click home, navigate back to it.

Change-Id: Ib0526407d5210222a542ff26d6d0ac883d7b68f3
parent c2aa5737
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -112,9 +112,6 @@ public class PermissionUsageFragment extends SettingsWithLargeHeader implements
    private static final String KEY_SORT = "_sort";
    private static final String SORT_KEY = PermissionUsageFragment.class.getName()
            + KEY_SORT;
    private static final String KEY_FINISHED_INITIAL_LOAD = "_finished_initial_load";
    private static final String FINISHED_INITIAL_LOAD_KEY = PermissionUsageFragment.class.getName()
            + KEY_FINISHED_INITIAL_LOAD;

    /**
     * The maximum number of columns shown in the bar chart.
@@ -167,6 +164,7 @@ public class PermissionUsageFragment extends SettingsWithLargeHeader implements
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mFinishedInitialLoad = false;
        mSort = SORT_RECENT_APPS;
        initializeTimeFilter();
        if (savedInstanceState != null) {
@@ -174,7 +172,6 @@ public class PermissionUsageFragment extends SettingsWithLargeHeader implements
            mSavedGroupName = savedInstanceState.getString(PERMS_INDEX_KEY);
            mFilterTimeIndex = savedInstanceState.getInt(TIME_INDEX_KEY);
            mSort = savedInstanceState.getInt(SORT_KEY);
            mFinishedInitialLoad = savedInstanceState.getBoolean(FINISHED_INITIAL_LOAD_KEY);
        }

        setLoading(true, false);
@@ -258,7 +255,6 @@ public class PermissionUsageFragment extends SettingsWithLargeHeader implements
        outState.putString(PERMS_INDEX_KEY, mFilterGroup);
        outState.putInt(TIME_INDEX_KEY, mFilterTimeIndex);
        outState.putInt(SORT_KEY, mSort);
        outState.putBoolean(FINISHED_INITIAL_LOAD_KEY, mFinishedInitialLoad);
    }

    @Override