diff options
author | herriojr <jherriott@cyngn.com> | 2015-08-17 17:37:15 -0700 |
---|---|---|
committer | herriojr <jherriott@cyngn.com> | 2015-08-18 11:34:57 -0700 |
commit | 2bb6f04a2a6d7f23d8ec40ddc285d71072de0796 (patch) | |
tree | 56e578d2800d89ba958bfb8f94e164853529a47a | |
parent | ecc71592fcd6b138b666bbc09b64ebbba03c7864 (diff) | |
download | android_packages_apps_CMFileManager-2bb6f04a2a6d7f23d8ec40ddc285d71072de0796.tar.gz android_packages_apps_CMFileManager-2bb6f04a2a6d7f23d8ec40ddc285d71072de0796.tar.bz2 android_packages_apps_CMFileManager-2bb6f04a2a6d7f23d8ec40ddc285d71072de0796.zip |
Fix Navigation back from Search
When entering a search result and then backing out all the way, a
history item wasn't being added for the directory the search was
happening in. This fixes it.
Change-Id: I28d5b290a18076f1156f699426420ca78fb3eee6
Cherry-Pick: b4fc75077143de0ff9e26d8d2644d879ccdc0e84
-rwxr-xr-x | src/com/cyanogenmod/filemanager/activities/NavigationActivity.java | 6 | ||||
-rwxr-xr-x | src/com/cyanogenmod/filemanager/ui/widgets/NavigationView.java | 23 |
2 files changed, 17 insertions, 12 deletions
diff --git a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java index 716f9175..358549bf 100755 --- a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java +++ b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java @@ -642,7 +642,6 @@ public class NavigationActivity extends Activity if (curDir != null) { VirtualMountPointConsole vc = VirtualMountPointConsole.getVirtualConsoleForPath( mNavigationViews[mCurrentNavigationView].getCurrentDir()); - getCurrentNavigationView().refresh(true); if (vc != null && !vc.isMounted()) { onRequestBookmarksRefresh(); removeUnmountedHistory(); @@ -652,11 +651,6 @@ public class NavigationActivity extends Activity if (mDisplayingSearchResults) { mDisplayingSearchResults = false; closeSearch(); - } else { - getCurrentNavigationView().refresh(true); - Intent intent = new Intent(); - intent.putExtra(EXTRA_ADD_TO_HISTORY, false); - initNavigation(NavigationActivity.this.mCurrentNavigationView, false, intent); } getCurrentNavigationView().refresh(true); } diff --git a/src/com/cyanogenmod/filemanager/ui/widgets/NavigationView.java b/src/com/cyanogenmod/filemanager/ui/widgets/NavigationView.java index ac8f1662..a0812469 100755 --- a/src/com/cyanogenmod/filemanager/ui/widgets/NavigationView.java +++ b/src/com/cyanogenmod/filemanager/ui/widgets/NavigationView.java @@ -245,10 +245,9 @@ BreadcrumbListener, OnSelectionChangedListener, OnSelectionListener, OnRequestRe // is created) mNewDirChecked = checkChRootedNavigation(params[0]); - //Check that it is really necessary change the directory - mHasChanged = !(NavigationView.this.mCurrentDir != null && - NavigationView.this.mCurrentDir.compareTo(mNewDirChecked) == 0); - mIsNewHistory = (NavigationView.this.mCurrentDir != null); + mHasChanged = !(NavigationView.this.mPreviousDir != null && + NavigationView.this.mPreviousDir.compareTo(mNewDirChecked) == 0); + mIsNewHistory = (NavigationView.this.mPreviousDir != null); try { //Reset the custom title view and returns to breadcrumb @@ -814,13 +813,25 @@ BreadcrumbListener, OnSelectionChangedListener, OnSelectionListener, OnRequestRe return; } + boolean addToHistory = false; + boolean reload = true; + boolean useCurrent = false; + SearchInfoParcelable searchInfo = null; + + String newDir = this.mCurrentDir; if (this.mNavigationTask != null) { + addToHistory = this.mNavigationTask.mAddToHistory; + reload = this.mNavigationTask.mReload; + useCurrent = this.mNavigationTask.mUseCurrent; + searchInfo = this.mNavigationTask.mSearchInfo; this.mNavigationTask.cancel(true); this.mNavigationTask = null; + this.mCurrentDir = this.mPreviousDir; + this.mPreviousDir = null; } //Reload data - changeCurrentDir(this.mCurrentDir, false, true, false, null, scrollTo); + changeCurrentDir(newDir, addToHistory, reload, useCurrent, searchInfo, scrollTo); } /** @@ -1029,7 +1040,7 @@ BreadcrumbListener, OnSelectionChangedListener, OnSelectionListener, OnRequestRe this.mCurrentDir = newDir; mNavigationTask = new NavigationTask(useCurrent, addToHistory, reload, searchInfo, scrollTo, mRestrictions, mChRooted); - mNavigationTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, newDir); + mNavigationTask.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, newDir); } /** |