I’m pretty sure that immigration in the US can just confiscate your devices if you are not a citizen .
CBP can and does "detain" travelers' devices at (or near) the border, without a warrant or any stated cause, even if they are US citizens.
Here is part of the notice they give people when they do:
