OSDN Git Service

On low power turn off rather than rebooting to allow device to charge
authorPaul Lawrence <paullawrence@google.com>
Mon, 9 Jun 2014 21:10:09 +0000 (14:10 -0700)
committerPaul Lawrence <paullawrence@google.com>
Mon, 9 Jun 2014 22:15:32 +0000 (15:15 -0700)
commit73d7a02dc6e18b4c0a6f29e8f89b432c1b6cc808
tree7274cc76c921a1b6b8f2d0306dd3ba6ae0193bc4
parentcba4ab2aebe349ba1cb37fece111b902b14eea14
On low power turn off rather than rebooting to allow device to charge

The code was using encrypted_upto == 0 as an indicator that encryption
has succeeded. This meant that if no encryption happened, we would reboot
continually.

We now set encrypted_upto to fs_size when encryption is complete.

Also don't start to encrypt unless we are at 10% power. Stop when we
get to 5% power. This should lead to partial encryptions only very
rarely.

Bug: 15513202
Change-Id: I6214d78579d1fbbe2f63ee8862473d86a89d29b3
CheckBattery.cpp
CheckBattery.h
cryptfs.c