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

Commit f4b8bb58 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Bart Sears
Browse files

Finish when browsed root goes away.

If we're browsing a specific root, and that root went away, typically
due to formatting.

Skipped auto-merging this CL to master last night as it was causing
a merge conflict.  Cherry-picking it to master today (with the conflict
resolved).

Bug: 21831184
Change-Id: Ie07607a81e32a7d82c88ad382658a471d47b905d
parent ac134dc4
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -97,6 +97,22 @@ abstract class BaseActivity extends Activity {
        mSearchManager = new SearchManager();
    }

    @Override
    public void onResume() {
        super.onResume();

        final State state = getDisplayState();
        final RootInfo root = getCurrentRoot();

        // If we're browsing a specific root, and that root went away, then we
        // have no reason to hang around
        if (state.action == State.ACTION_BROWSE && root != null) {
            if (mRoots.getRootBlocking(root.authority, root.rootId) == null) {
                finish();
            }
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        boolean showMenu = super.onCreateOptionsMenu(menu);