I have to activate android\'s system key lock (the one you get when you press the power off/hang up button). See here:
Digging through the Android source found WindowManagerService which seems to have a public method (startAppFreezingScreenLocked
) for activating this. This may be a good place to start looking for your answer, as unfortunately it doesn't seem as though you can directly get a WindowManagerService object.