Good luck on plausible deniability when they have your device, enter the password that you told them, and see the device factory reset. The fun part is, regardless of whether or not the device held incriminating evidence, the act of clearing it is still illegal.
Even if you cleared the device before it was taken into custody, they could still have a case if they can reasonably show that you cleared it with suspicion that it would be taken into custody. Obviously, that can be difficult to show, depending on the burden of proof required.