In older versions of Android, when connected via USB the default behaviour was "Charge Only". This allowed the device to charge via USB without exposing its file system to the device providing power, often a computer.
In newer versions, this security feature seems to be missing, introducing a vulnerability whereby the file system is now exposed to the powering device.
Is there a way to re-implement this "Charge Only" security feature so that the Android's file system remains hidden or encrypted even when connected to a computer via USB for power?