I think I have a solution. If the app delegate's applicationWillResignActive is called, but not its applicationDidEnterBackground method, and the app supports multitasking, then the device is locked.
Note: This solution only works if the user locks the device from the app.
Note: This solution only works if the user locks the device from the app.