OSDN Git Service

Use System Resolver
[android-x86/packages-apps-CMFileManager.git] / src / com / cyanogenmod / filemanager / ui / widgets / NavigationView.java
index ac8f166..6d8ba67 100755 (executable)
@@ -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);
     }
 
     /**
@@ -1025,11 +1036,18 @@ BreadcrumbListener, OnSelectionChangedListener, OnSelectionListener, OnRequestRe
             final String newDir, final boolean addToHistory,
             final boolean reload, final boolean useCurrent,
             final SearchInfoParcelable searchInfo, final FileSystemObject scrollTo) {
+        if (mNavigationTask != null) {
+            this.mCurrentDir = this.mPreviousDir;
+            this.mPreviousDir = null;
+            mNavigationTask.cancel(true);
+            mNavigationTask = null;
+        }
+
         this.mPreviousDir = this.mCurrentDir;
         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);
     }
 
     /**
@@ -1198,7 +1216,7 @@ BreadcrumbListener, OnSelectionChangedListener, OnSelectionListener, OnRequestRe
             changeCurrentDir(fso.getFullPath(), searchInfo);
         } else {
             // Open the file with the preferred registered app
-            IntentsActionPolicy.openFileSystemObject(getContext(), fso, false, null, null);
+            IntentsActionPolicy.openFileSystemObject(getContext(), fso, false, null);
         }
     }
 
@@ -1230,7 +1248,7 @@ BreadcrumbListener, OnSelectionChangedListener, OnSelectionListener, OnRequestRe
             // Open the file (edit or pick)
             if (this.mNavigationMode.compareTo(NAVIGATION_MODE.BROWSABLE) == 0) {
                 // Open the file with the preferred registered app
-                IntentsActionPolicy.openFileSystemObject(getContext(), fso, false, null, null);
+                IntentsActionPolicy.openFileSystemObject(getContext(), fso, false, null);
             } else {
                 // Request a file pick selection
                 if (this.mOnFilePickedListener != null) {