summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJing (Mia) Wang <kaiyiz@codeaurora.org>2014-12-18 10:21:06 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2015-01-03 20:55:41 -0800
commit2fa1c956a30ac99b0f13f6b6f752c086e1898654 (patch)
tree524b5469e0bb0422b050f68d51d24bf499c1ec13 /src
parent8165fd7f2714fed319b00c09440e817f1d85b043 (diff)
downloadandroid_packages_apps_Gallery2-2fa1c956a30ac99b0f13f6b6f752c086e1898654.tar.gz
android_packages_apps_Gallery2-2fa1c956a30ac99b0f13f6b6f752c086e1898654.tar.bz2
android_packages_apps_Gallery2-2fa1c956a30ac99b0f13f6b6f752c086e1898654.zip
Gallery2: Add leave selection mode judgement
The method of isCancelled in thread pool is a nonsynchronous method, as a result, there is a possibility that the job is not cancelled after leave selection mode, and the getSelectedMediaObjects is still running. Finish getSelectedMediaObjects when selection mode is quit. CRs-Fixed: 769028 Change-Id: Icb7c3f9d1f3e14536f32a6401337e844481ad646
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/ui/ActionModeHandler.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/ui/ActionModeHandler.java b/src/com/android/gallery3d/ui/ActionModeHandler.java
index 6b4f10312..411c578a5 100644
--- a/src/com/android/gallery3d/ui/ActionModeHandler.java
+++ b/src/com/android/gallery3d/ui/ActionModeHandler.java
@@ -272,7 +272,7 @@ public class ActionModeHandler implements Callback, PopupList.OnPopupItemClickLi
ArrayList<MediaObject> selected = new ArrayList<MediaObject>();
DataManager manager = mActivity.getDataManager();
for (Path path : unexpandedPaths) {
- if (jc.isCancelled()) {
+ if (jc.isCancelled() || !mSelectionManager.inSelectionMode()) {
return null;
}
selected.add(manager.getMediaObject(path));