Many recent cars have a smart key system, where you never have to take the key out of your pocket. You enter the car by touching the door handle, which triggers the car to ping the key, and if the key is nearby, the doors are opened. Then when pushing the engine start button, engine is started, but only if the key is inside the car.
I have observed that in my car (a 2016 Toyota RAV4 hybrid), if I walk out of the car with the engine running, the car immediately warns that the key is not in the car, even if I'm very near the car but outside the car.
It seems as if the system knows exactly where the key is. How is this achieved?
I can see two ways this could be done. One way is signal strength. Signal from the key diminishes in power according to the second power of distance. However, this kind of system might have the drawback that poor battery condition could cause the signal to diminish as well, resulting in erroneous operation.
Another way is triangulation, similar to what is done in GPS. The signal is received at multiple points, and the time difference is compared. I think reflections from metal surfaces might fool this method, although there may be countermeasures that detect reflections.
Which of these options do typical smart key systems use?