OSDN Git Service

Improve copy/move performance with nio and reintroduce cancel.
authorMatt Garnes <matt@cyngn.com>
Wed, 12 Aug 2015 18:32:31 +0000 (11:32 -0700)
committerMatt Garnes <matt@cyngn.com>
Thu, 13 Aug 2015 00:39:54 +0000 (17:39 -0700)
commitbd79d582be84824e3a5cc519ef6d9cc8d4518aa9
tree1cf6053cfdef2f037808d5a7dd0b3254835fdb69
parentb5c78a630e782ccf3ceb7692d1df56e6f2d42ae3
Improve copy/move performance with nio and reintroduce cancel.

Utilize FileChannel.transferFrom to copy files faster. Chunk the file
transfer so that we can check between each chunk if the user has
cancelled the copy.

In my tests copying a large file (650MB), this improved performance by 45%.

Also, bring the cancel feature back for non secure storage.

Fixes QRDL-976.

Change-Id: I112cee7b9dfe682a438516f7f938dfd7538f1efb
src/com/cyanogenmod/filemanager/commands/java/CopyCommand.java
src/com/cyanogenmod/filemanager/commands/java/MoveCommand.java
src/com/cyanogenmod/filemanager/ui/policy/CopyMoveActionPolicy.java
src/com/cyanogenmod/filemanager/util/FileHelper.java