diff options
author | Jeff Sharkey <jsharkey@android.com> | 2015-06-16 20:54:11 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2015-06-16 20:54:14 -0700 |
commit | 8bb1245a48fd751991e4177351f38e4ce23a95ca (patch) | |
tree | 2cbc2abaa314a0f69c3f0dd58836c1526b001f2c /packages/DocumentsUI | |
parent | df27d3bf3049b8e0b0c8ce432468be380a6eaeeb (diff) | |
download | frameworks_base-8bb1245a48fd751991e4177351f38e4ce23a95ca.zip frameworks_base-8bb1245a48fd751991e4177351f38e4ce23a95ca.tar.gz frameworks_base-8bb1245a48fd751991e4177351f38e4ce23a95ca.tar.bz2 |
Finish when browsed root goes away.
If we're browsing a specific root, and that root went away, typically
due to formatting.
Bug: 21831184
Change-Id: Ie07607a81e32a7d82c88ad382658a471d47b905d
Diffstat (limited to 'packages/DocumentsUI')
-rw-r--r-- | packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java b/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java index bba33be..fc46716 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java +++ b/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java @@ -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; @@ -97,6 +96,22 @@ abstract class BaseActivity extends Activity { } @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); |