Do not forget that if the police say "Because you've been arrested we are going to search your phone." And you believe them, agreeing to let them search your phone, even if you just say "Okay, whatever" then they can bypass the search warrant. Never ever, EVER, talk to the police unless you are with a lawyer. They know how to manipulate you to get what they want. Simply say, "I have nothing to say." Wait for a lawyer, and go from there.
Think about it this way, you meet a professional boxer and he starts to pressure you into sparring. Would you do it? No, even professional boxers wouldn't fight outside of a ring because things can go wrong in a million ways. Even if you were a professional, you'd be stupid to accept the challenge because you don't know what might happen.
That is exactly like talking to a cop. You are untrained and you have no idea what might happen.
tl;dr Even though this is a law, there are still ways for cops to trick you into letting them access your information. Politely refuse all police requests even if you feel you have nothing to hide.
4th Amendment States: "The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized."
I am no lawyer or anything, so just based on the above situation you gave: If the "phone's on the table next to me they can search it, but if it's in my pocket.." I am going to assume that you are in some sort of house, building or whatever. So the warrant would have to state, based only on the above wording, the place you are in AND state it can search any of its occupants.
However if you are just on the street or something and the police detain you and/or later arrest you then they clearly have to obtain the a warrant for you phone. The difference being; that in one case the police already obtained a search warrant prior to any action in which case the exact wording of the warrant would have to be looked at, the other case being that the police do not or did not get a warrant before hand.
The Supreme Court case of this articles seems to only address the searching of a persons cell without a warrant being issued prior to any action taken by the police.