Écran verrouillé Android Studio

DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);  
dpm.lockNow();
Mohamed Boumlyk