This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getVersionName = { -> | |
try { | |
def stdout = new ByteArrayOutputStream() | |
exec { | |
commandLine 'git', 'describe', '--dirty' | |
standardOutput = stdout | |
} | |
return stdout.toString().trim() | |
} | |
catch (ignored) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
courtesy: cmpxchg aka tim murray | |
suspend is the big hammer. in suspend, you turn off all peripherals, turn off the CPUs entirely, | |
put the DRAM into self-refresh. power consumption is very low. if you've ever put a tablet on | |
a table and come back a month later to find that it's still on, that's because it's been suspend | |
99.9% of the time, and it's drawing a tiny amount the whole time. | |
problem with suspend is that it takes a nontrivial amount of time to enter/exit, so you can't | |
do it when somebody has to interact with the phone soon. on Android, suspend never happens while | |
the screen is on. if you ever wondered what a wakelock actually does, it prevents suspend. that's it. |
OlderNewer