Don't run device restart code if the device is not enabled.