diff options
| author | 2016-09-21 22:34:52 +0000 | |
|---|---|---|
| committer | 2016-09-21 22:34:54 +0000 | |
| commit | ba0ee69a15a6207858a72f5fe8ba86953b16641e (patch) | |
| tree | dc47165cf1047cde20f95887ee3e971282d5f35e | |
| parent | be2db1ef7213439ae6e08ac05c24ebb56fdf41e6 (diff) | |
| parent | 5e1e779098b4aa4bb6e8587f8b82651d84356a93 (diff) | |
Merge "DO NOT MERGE ANYWHERE" into nyc-mr1-dev
| -rw-r--r-- | packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java | 12 | ||||
| -rw-r--r-- | packages/DocumentsUI/src/com/android/documentsui/FilesActivity.java | 39 |
2 files changed, 1 insertions, 50 deletions
diff --git a/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java b/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java index 1922773c9cb8..46e7fe0b3053 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java +++ b/packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java @@ -612,23 +612,13 @@ public abstract class BaseActivity extends Activity return; } - if (!mState.hasLocationChanged()) { - super.onBackPressed(); - return; - } - - if (onBeforePopDir() || popDir()) { + if (popDir()) { return; } super.onBackPressed(); } - boolean onBeforePopDir() { - // Files app overrides this with some fancy logic. - return false; - } - public void onStackPicked(DocumentStack stack) { try { // Update the restored stack to ensure we have freshest data diff --git a/packages/DocumentsUI/src/com/android/documentsui/FilesActivity.java b/packages/DocumentsUI/src/com/android/documentsui/FilesActivity.java index 728d98f56e38..3b1ca77b680a 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/FilesActivity.java +++ b/packages/DocumentsUI/src/com/android/documentsui/FilesActivity.java @@ -60,12 +60,6 @@ public class FilesActivity extends BaseActivity { public static final String TAG = "FilesActivity"; - // See comments where this const is referenced for details. - private static final int DRAWER_NO_FIDDLE_DELAY = 1500; - - // Track the time we opened the drawer in response to back being pressed. - // We use the time gap to figure out whether to close app or reopen the drawer. - private long mDrawerLastFiddled; private DocumentClipper mClipper; public FilesActivity() { @@ -395,39 +389,6 @@ public class FilesActivity extends BaseActivity { } } - // Do some "do what a I want" drawer fiddling, but don't - // do it if user already hit back recently and we recently - // did some fiddling. - @Override - boolean onBeforePopDir() { - int size = mState.stack.size(); - - if (mDrawer.isPresent() - && (System.currentTimeMillis() - mDrawerLastFiddled) > DRAWER_NO_FIDDLE_DELAY) { - // Close drawer if it is open. - if (mDrawer.isOpen()) { - mDrawer.setOpen(false); - mDrawerLastFiddled = System.currentTimeMillis(); - return true; - } - - final Intent intent = getIntent(); - final boolean launchedExternally = intent != null && intent.getData() != null - && mState.action == State.ACTION_BROWSE; - - // Open the Close drawer if it is closed and we're at the top of a root, but only when - // not launched by another app. - if (size <= 1 && !launchedExternally) { - mDrawer.setOpen(true); - // Remember so we don't just close it again if back is pressed again. - mDrawerLastFiddled = System.currentTimeMillis(); - return true; - } - } - - return false; - } - // Turns out only DocumentsActivity was ever calling saveStackBlocking. // There may be a case where we want to contribute entries from // Behavior here in FilesActivity, but it isn't yet obvious. |