Code example for DevicePolicyManager

Methods: isAdminActiveresetPassword

	public static void unlockIfEnabled(Context context) {
		if(PreferenceManager.getDefaultSharedPreferences(context).getBoolean("key_enable_locker", false)) {		
			DevicePolicyManager dpm = ((DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE));
			if (dpm.isAdminActive(new ComponentName(context, CustomDeviceAdminReceiver.class)))
				dpm.resetPassword("", DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY);
	 * Copied from PebbleKit 
     * Synchronously query the Pebble application to see if an active Bluetooth connection to a watch currently exists. 
     * @param context 
     *         The Android context used to perform the query. 
     *         <p/> 
     *         <em>Protip:</em> You probably want to use your ApplicationContext here. 
Contextual code suggestions in your IDE  Get Codota for Java