I've got an external micro SD card that I am connecting via USB to my phone for dashcam recording. However, I have noticed an annoying issue - if I start recording before I start the car, sometimes the recording winds up going to internal flash, which is not what I want.
Obviously I have to use a wireless charger since I have a storage connected to the USB. The wireless charger is connected to the vehicle's USB power. What I see happen is that after starting the car, it takes a few seconds until USB power turns on. At that point, if I have the screen on and my notifications pulled down, I see the USB drive being ejected - the "do not remove" message shows briefly, and then the USB notification disappears. Then after a couple second, the USB re-appears and gets re-mounted. But due to the USB being ejected, the app I am using as the dashcam apparently detects that the drive is not available, and so starts recording to internal flash instead.
It's rather a hassle to have to start the car, then wait 15 seconds or so, then fiddle around with my phone to make sure the app still knows the correct location to record to. This wastes at least a minute of idling. I would rather figure out why Android thinks it should eject the drive when power is applied, and fix that instead. I have been able to reproduce the issue on my desk (wireless) charger as well, and it seems is always happens on the first power event after the USB drive is plugged in; subsequent power events have no effect.
Why is Android ejecting my USB flash drive (despite remounting a few seconds later) when I connect to power, and how can I make it stop doing this?