am 6bbf28da: (-s ours) am c004cfd8: am b843601a: am 77acfc4d: (-s ours) am 3c73fdaa: (-s ours) Reconcile with jb-mr1-release - do not merge

* commit '6bbf28da27dde1d3154456ab44a68ff62ee81c3c':
am c5771b5a: Merge "Vold: Add the fstrim subsystem to vold" into jb-mr2-dev

* commit 'c5771b5a4d66a0c7ca0e2cb1056e670f38b3834f':
  Vold: Add the fstrim subsystem to vold
am 741a1699: Add liblog

* commit '741a1699b15c628e36e5c26457bd703b11f1e515':
  Add liblog
am b55025bf: Merge "vold: set klog level so e2fsck output is logged" into jb-mr2-dev

* commit 'b55025bfa1039c8fa205727b49fe4a8dd1df7725':
  vold: set klog level so e2fsck output is logged
am 743a5ec9: vold: Perform fstrim work in a separate thread.

* commit '743a5ec96cd54bdc06234be15cdde65296357a6a':
  vold: Perform fstrim work in a separate thread.
vold: Add support for unencrypted persistent info

In order to display the correct language, timezone, airplane
mode and other settings on the decrypt screen, a copy of those
settings needs to be stored unencrypted so the framework can
query them.  This adds support to vold to store up to 32
property like key/value pairs that are not encrypted.

Change-Id: Id5c936d2c57d46ed5cff9325d92ba1e8d2ec8972
vold: Do not print fstrim amount if ioctl returns an error

Change-Id: I8620ea67a774ead51bd6bd9b6e737bf3d634470b
am e78cd4f3: Grab a partial wakelock when doing fstrim

* commit 'e78cd4f33d2b7969f1baca2b274740e1b53b3121':
  Grab a partial wakelock when doing fstrim
Grab a partial wakelock when doing fstrim

Fstrim can take a while, so grab a wakelock so it finishes now,
not when the user picks up the device and wakes it back up.

This change does not protect against multiple calls to fstrim
before the first one completes.  When the first one completes, it
will release the wakelock, and the device will go to sleep.
However, normal usage is this will not be invoked by the framework
more than once a day, so this should not be an issue.

Bug: 8781133

Change-Id: I8065d1380eaf52ca8a7ca308af66fb6e86d60a66
merge in jb-mr2-release history after reset to jb-mr2-dev
am bc7d5088: vold: Have the fstrim log start and finish times in the event log

* commit 'bc7d5088f7f7cbd097f99d2f6d015e2c0a73cacb':
  vold: Have the fstrim log start and finish times in the event log
Fix a typo in a comment

Change-Id: Ibb9667d762189849ebcbefef4ba70ffd34cf885e
am c587269c: vold: Increase timeout due to selinux changes

* commit 'c587269c5a34d4e7412ff42e53ed6312359a8505':
  vold: Increase timeout due to selinux changes
merge in jb-mr2-release history after reset to jb-mr2-dev
Reconcile with jb-mr2-release - do not merge

Change-Id: I58dee084939bd1b49432bfb4e460dddeb4f6e15a
am 9420c0b3: (-s ours) Reconcile with jb-mr2-release - do not merge

* commit '9420c0b338106eed246b362238b063ecdab3a710':
  Grab a partial wakelock when doing fstrim
vold: Add an optional wipe paramter to the volume format command

The new wipe option to the vold format command will invoke BLKDISCARD
on the partition before invoking newfs_msdos.  This will be used whenever
a full wipe of the device is wanted, as this is more secure than just
doing newfs_msdos.

Bug: 9392982
Change-Id: Ie106f1b9cc70abc61206006d1821641c27c7ccae
Change upgrade code to allow multiple versions

In the future, we'd like to have the ability to upgrade from any
supported version to any future version. Change the upgrade function
slightly to support this.

Change-Id: I3b20ccfff51c4c86f1e5e08690c263dc95ff5ce4
Extract some version constants to header

In order to make it easier to upgrade the crypto footer, extract some
constants to a header file instead. Then the header can control what the
current version is and the upgrade_crypto_ftr code should be the only
thing that needs to be updated.

Change-Id: I3ed5a7d3b640419cd8af91388d94a00de8cc09db
Change key derivation to scrypt

scrypt is a sequential memory-hard key derivation algorithm that makes
it more difficult for adversaries to brute force passwords using
specialized equipment. See http://www.tarsnap.com/scrypt/scrypt.pdf for
more details of the algorithm.

This adds support for initializing disk encryption using scrypt and
upgrading from the previous PBKDF2 algorithm.

Change-Id: I1d26db4eb9d27fea7310be3e49c8e6219e6d2c3b