It is BEFORE you are accepted in the US. Unless you’re one of those open borders people ;-)
No, surrendering your phone may be a condition of entry but if you choose to return home we can’t confiscate anything you legally own.
Once you enter and are under our jurisdiction you have full protection regardless of immigration status.