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 11:06:55 -0700
commita0e9719e30374e5a8a215c60466c313568109c5c (patch)
treef10d84ac7d395121f482f016c2d6f93bd86e9371
parent58688653758ac52c79bcca311751db30dda97f50 (diff)
downloadandroid_packages_apps_CMFileManager-a0e9719e30374e5a8a215c60466c313568109c5c.tar.gz
android_packages_apps_CMFileManager-a0e9719e30374e5a8a215c60466c313568109c5c.tar.bz2
android_packages_apps_CMFileManager-a0e9719e30374e5a8a215c60466c313568109c5c.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 (cherry picked from commit 95c92cbfbce8510657642030c6831db8cec6377b)
-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;
}