I found this...
Animal Sounds with toddler lock
Slightly different to toddler lock in you drag a key to a lock.
When lock is activated, start a service, and stop it when lock is deactivated
The service checks the top running app, and if it is not games activity, the service launches game activity
From what I understand there was an issue that when the user clicks "home", it takes about 6 seconds before activity is launched again. To bypass this, when the service detects that another app is visible, it adds a top view (as an alert window) that covers the home screen for the few seconds it takes the app to re-launch.
Anyways, here is the code : Was updated dec 2013