Question
How can I prevent a factory reset triggered by hardware buttons (Power + Volume) on an Android device?
I like to prevent my device from factory rest with hardware button (Power + Volume).
I put two restriction for user not to reset device, those are not able to prevent the user from hardware reset.
private val dpm: DevicePolicyManager by lazy {
context.getSystemService(DevicePolicyManager::class.java)
}
dpm.addUserRestriction(adminComponentName, UserManager.DISALLOW_SAFE_BOOT)
dpm.addUserRestriction(adminComponentName, UserManager.DISALLOW_FACTORY_RESET)How can I achieve this hardware reset restriction ?