This app was mentioned in 2 comments, with an average of 3.00 upvotes
The ACLU has a series of state-specific apps that will automatically upload video if there is a wireless connection. For example, here's the Android ACLU Mobile Justice app. Check your app store for one specific to your area.
One more tip - under no circumstances should you resist in any way. Now, this is highly unlikely, we're talking "my brain makes up fiction because I saw it on Fox news" stuff, but if they do force their way in, you should offer no resistance. If the cop tells you to do something, comply. Stop talking, other than to agree with the cop, and to say that this is being done under duress. They less you say, the easier it will be to remember what happened
You should also take notes of everything that happens - if anything happens. Get it saved into the cloud, using something like Google Keep or EverNote, or whatever your favorite auto-backup tool is.
If you really think things are going to get out of hand, the ACLU has an app that records, and then immediately uploads the recording. They don't have one for your state (who knows why) so I picked this one ...
https://play.google.com/store/apps/details?id=org.aclu.mobile.justice.dc
Basically, even if the cops get your phone, the video cannot be deleted.
Now, take a deep breath. That is highly unlikely to happen. Mostly fiction and fantasy. Just remember to be calm, polite, and take notes of everything that happens. Every date, time, name, place, what they said (as best as you can remember), what you said (which should be little to nothing), and "hold your cards close". The less you tell them, the less they can use against you.