Code example for DevicePolicyManager

Methods: removeActiveAdmin

0
	public boolean isAdminActive(){ 
		return policyManager.isAdminActive(deviceAdmin);
	} 
	 
	public void removeAdminPrivileges(){ 
		policyManager.removeActiveAdmin(deviceAdmin);
	} 
	 
	 
	 
	public Intent getAskForAdminPrivilegesIntent(){
		PreyConfig.getPreyConfig(ctx).setSecurityPrivilegesAlreadyPrompted(true);
		Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
		intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN,deviceAdmin);
		intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
		//intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION, getText(R.string.device_admin_prompt)); 
		return intent;
	} 
	 
} 
Experience pair programming with AI  Get Codota for Java