OSDN Git Service

Grab a partial wakelock when doing fstrim
authorKen Sumrall <ksumrall@android.com>
Thu, 2 May 2013 06:34:57 +0000 (23:34 -0700)
committerKen Sumrall <ksumrall@android.com>
Thu, 2 May 2013 06:37:45 +0000 (23:37 -0700)
commite78cd4f33d2b7969f1baca2b274740e1b53b3121
tree1dafb356a60eb374fadd87758db189948b8c349d
parent743a5ec96cd54bdc06234be15cdde65296357a6a
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
fstrim.c