That’s when governments comes in. In france every new building has to be built with planning for charging equipment to be installed by anyone requesting it. For older buildings you have the right to ask for a full installation (it will obviously cost more)
In my opinion, those warnings are not used to help users but to shame developpers for not trully sandboxing and verifying their apps. Developpers know that having this warning will decrease the number of users downloading it. The goal in the long run is to improve app sandboxing and security.