diff options
author | kai.cao <kai.cao@ck-telecom.com> | 2015-04-16 10:15:45 +0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2015-05-20 22:11:58 +0000 |
commit | 0c06f5c179fe530730d20067cb83726741bc429d (patch) | |
tree | 1be60c4465191cf649a74d313dd095affeb10e1e | |
parent | 835447a2ac938f1a8a68e2539f63cd004acb5a6a (diff) | |
download | android_packages_apps_CMFileManager-0c06f5c179fe530730d20067cb83726741bc429d.tar.gz android_packages_apps_CMFileManager-0c06f5c179fe530730d20067cb83726741bc429d.tar.bz2 android_packages_apps_CMFileManager-0c06f5c179fe530730d20067cb83726741bc429d.zip |
[CMFileManager] The remember selection don't work when open a file
Preconditions
the system have two Activity have the same package name and the two activity receive the same action(Such as MediaPlaybackActivity and AudioPreview in "om.android.music"
Procedures
1.Go into Music directory,open a mp3 file.
2.select remember selection in music(this is MediaPlaybackActivity).
3.back to filemanager,and open the file again.
The file open as AudioPreview,it should open as MediaPlaybackActivity.
Change-Id: I58469b0bf5bece221fdec8be8f2368c8c157a0fb
-rwxr-xr-x[-rw-r--r--] | src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java b/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java index aeeb4c9f..043a3621 100644..100755 --- a/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java +++ b/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java @@ -686,11 +686,15 @@ public final class IntentsActionPolicy extends ActionsPolicy { intentList.add(filter); packageManager.getPreferredActivities( intentList, prefActList, ri.activityInfo.packageName); - if (prefActList.size() > 0) { - pref.add(ri); + int count = prefActList.size(); + String activityName = ri.activityInfo.name; + for (int index = 0;index < count; index++) { + if (prefActList.get(index).getClassName().equals(activityName)) { + pref.add(ri); + break; + } } } - // No preferred activity is selected if (pref.size() == 0) { return null; |