I have to activate android\'s system key lock (the one you get when you press the power off/hang up button). See here:
Looks like the screen lock function is performed using the method:
public void goToSleep(long time)
method in PowerManager.java. It's possible to get a reference to it in this fashion:
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
However this requires the permission
android.permission.DEVICE_POWER
which is a level 2 permission available to the system only.
So looks like this isn't doable. This is for version 1.1 only, I don't know for 1.5.