aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Mertz <scott@cyngn.com>2016-06-27 09:22:49 -0700
committerScott Mertz <scott@cyngn.com>2016-06-27 10:04:31 -0700
commit95c92cbfbce8510657642030c6831db8cec6377b (patch)
tree9e27d40cddbe9f14ccdee7316a08faba710d2d15
parent70addacba1dfc3d89c6094bf1a942dafdcaff0da (diff)
downloadandroid_packages_apps_CMFileManager-95c92cbfbce8510657642030c6831db8cec6377b.tar.gz
android_packages_apps_CMFileManager-95c92cbfbce8510657642030c6831db8cec6377b.tar.bz2
android_packages_apps_CMFileManager-95c92cbfbce8510657642030c6831db8cec6377b.zip
Fix crash when long press directory
When long pressing a directory, the actions dialog will build an FSO send intent to query if it can be handled by any application. In this case, the list of URIs to share will be 0, causing the crash. FEIJ-1439 Change-Id: I3f500916774af4bde939bd42060d92070971663a
-rwxr-xr-xsrc/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java b/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java
index 022de6c9..9f99c7ce 100755
--- a/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java
+++ b/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java
@@ -192,7 +192,6 @@ public final class IntentsActionPolicy extends ActionsPolicy {
private static Intent getFsoSendIntent(final Context ctx, final List<FileSystemObject> fsos) {
Intent intent = new Intent();
- intent.setAction(fsos.size() > 1 ? Intent.ACTION_SEND_MULTIPLE : Intent.ACTION_SEND);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
// Create an array list of the uris to send
@@ -229,10 +228,12 @@ public final class IntentsActionPolicy extends ActionsPolicy {
intent.setType(MimeTypeHelper.ALL_MIME_TYPES);
}
}
- if (uris.size() > 1) {
- intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
- } else {
+ if (uris.size() == 1) {
+ intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_STREAM, uris.get(0));
+ } else {
+ intent.setAction(Intent.ACTION_SEND_MULTIPLE);
+ intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
}
return intent;
}