Processing a raw file was always an artistic thing for me :)
Regarding the Samsung and Xiaomi issue you have mention:
The smartphones manufacturers get from the sensor vendors (like Sony, Aptina, Toshiba, Samsung and etc.) the whole module - which includes sensor, optics, IOs and so on...