I have to check whether system lock was enabled or not in settings.
I used below line code
boolean b = android.provider.Settings.System.getInt(
This can also be achieved using Device Admin Policies http://developer.android.com/guide/topics/admin/device-admin.html