You are rigth about HEIF, but most electronic devices already pay for the license to encode/decode HEVC.
The camera sensor returns raw images, then there is post-processong and the last step is encoding. There are no technical limitations and it’s not hard to implement another image format. As other users commented, Google Pixel phones and some apps in Google Play already does. Btw I’m electronic + software engineer.
My conclusion is even if the new formats are better, JPEG is more compatible and good enough for most users. Some brands take care of power users and others don’t. I’m a bit disappointed with OnePlus camera software.
In Spain 6/10 citizens vote left or far-left parties. They don’t change the vote even if the goverment does a bad job. They just hate the right for different reasons. The only way the rigth can win the elections is if most people who votes left don’t go to vote.