If with autolock you mean that the phone does not turn off the screen due to a period of inactivity, you can do the following:
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "DoNotDimScreen");
To stop the screen from "locking":
wl.acquire();
so that it blocks again:
wl.release();
source
share