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

Commit 554e8291 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android Git Automerger
Browse files

am 3d00f7a1: Merge "Finish when browsed root goes away." into mnc-dev

* commit '3d00f7a1be6ff858a89e2220f33231ecb3570ef3':
  Finish when browsed root goes away.
parents 0bb5e4e2 28c03b3c
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.Executor;

@@ -96,6 +95,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);