diff options
author | Jing (Mia) Wang <kaiyiz@codeaurora.org> | 2014-12-18 10:21:06 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-01-03 20:55:41 -0800 |
commit | 2fa1c956a30ac99b0f13f6b6f752c086e1898654 (patch) | |
tree | 524b5469e0bb0422b050f68d51d24bf499c1ec13 | |
parent | 8165fd7f2714fed319b00c09440e817f1d85b043 (diff) | |
download | android_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
-rw-r--r-- | src/com/android/gallery3d/ui/ActionModeHandler.java | 2 |
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)); |