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

Commit 1842bb2d authored by James Laskey's avatar James Laskey
Browse files

Fix crash when changing customized list setting

Bug: 31838582
Test: Manual testing on nexus 6p following repro steps observing no
crash.

Change-Id: I5b9785a759bd4513237e859862ae0fb711173feb
parent f5f2fd4c
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -899,10 +899,12 @@ public class PeopleActivity extends ContactsDrawerActivity {
    }

    private void handleFilterChangeForFragment(ContactListFilter filter) {
        if (mAllFragment.canSetActionBar()) {
            mAllFragment.setFilterAndUpdateTitle(filter);
            // Scroll to top after filter is changed.
            mAllFragment.scrollToTop();
        }
    }

    private void handleFilterChangeForActivity(ContactListFilter filter) {
        // Set mShouldSwitchToAllContacts to true, so that we can switch to all contacts later.
+7 −0
Original line number Diff line number Diff line
@@ -128,6 +128,8 @@ public class DefaultContactBrowseListFragment extends ContactBrowseListFragment
    private boolean mIsRecreatedInstance;
    private boolean mOptionsMenuContactsAvailable;

    private boolean mCanSetActionBar = false;

    /**
     * If {@link #configureFragment()} is already called. Used to avoid calling it twice
     * in {@link #onResume()}.
@@ -649,6 +651,7 @@ public class DefaultContactBrowseListFragment extends ContactBrowseListFragment
        }

        setDirectorySearchMode();
        mCanSetActionBar = true;
    }

    public void initializeActionBarAdapter(Bundle savedInstanceState) {
@@ -1205,4 +1208,8 @@ public class DefaultContactBrowseListFragment extends ContactBrowseListFragment

        return false;
    }

    public boolean canSetActionBar() {
        return mCanSetActionBar;
    }
}