Whenever I'm connecting my Samsung Galaxy A40 running Android 9.0 to a laptop or PC, I'm getting an annoying prompt to allow data transfer, and the following setting which I had set to "Charging phone only" gets reset to "Transferring files":
However, I only want to charge the phone and absolutely never allow data transfer for security reasons as I frequently have to connect my phone to public or workplace PCs for charging. The service which throws the notification/prompt is called Android System and the icon looks a bit like this (only with filled font):
I activated developer options and explicitly configured the USB connection settings to not allow data transfer. Why does Android System keep changing my settings and prompting for data transfer? Is this normal behaviour? Is there a way to regain control without having to root the device?