I forget which generation it was now, but many years ago I had a Samsung Galaxy phone that had a sensor that could measure your heart rate if you put your finger over it
The problem is, it was basically useless. The main use case for heart rate monitoring is continuously throughout the day/night, or during exercise. A watch is very good at this. An optical sensor on the back of your phone is not.
Periodically checking your heart rate by holding your phone in a specific way is not a useful feature for that many people.
Turns out, when you have a known luminance, white balance, and frame-rate... the DSP to grab heart rate from a finger is trivial.
But on the Galaxy S7 that I think is being alluded to here, it was definitely a separate sensor -- a MAX86902, IIRC.