For one mobile phone, if f is changed, s varies immediately
f doesn't change unless you switch the lens, which implies a different phone or a different camera on the same phone.
Focal length is a property of the lens, it doesn't depend on the focus distance1. So in your formulas, everything except s is a constant. The formula assumes that the lens is focused at distance s, but it makes no difference whether you use autofocus or not.
If you have a zoom lens then you zoom first, this gives the focal length, and the focal length won't change until next time you zoom.
If we use the wide angle camera of the iPhone 7 (4mm f/1.8) as an example, focused at an object 20 cm away:
s = 0.2 m
f = 0.004 m
N = 1.8
c = 4e-6 m ## 6 mm sensor diagonal divided by 1500 = 4 um
The circle of confusion has several formulations. Which one you use depend on how you expect to use the picture as well as how critical you are. I've used
sensor_diagonal/1500 here, adjust to taste2.
The calculation for 20 cm focus distance then becomes:
Dnear = s*f^2 / (f^2 + N*c*(s - f))
Dnear = 0.2*0.004^2 / (0.004^2 + 1.8*4e-6*(0.2-0.004)) = 0.18 m = 18 cm
Dfar = 22 cm
So at 0.2 m focus distancee, the DoF goes from 0.18 to 0.22 m.
While at 2 m focus distance, the DoF goes from 1 m to 20 m.
Note that at normal distances (not macrophotography), when the distance to the subject is a lot more than the focal length of the lens, then
s - f is appromxiately the same as
s, so you can simplify the formula a bit.
1) Except for focus breathing, were the focal length does vary with the focus distance. But we tend to ignore this for DoF calculations; partly because the effect is small, partly because it's different for every lens and the numbers are rarely available unless you measure it yourself.
2) The image is in perfect focus only at one specific distance. The CoC specifies your tolerance for out-of-focus blurriness, so you can consider it a fudge factor of sorts. Blurriness that's invisible when you shrink say a 12 Mpx picture to fit a 2 Mpx screen may be visible if you show the picture at 100% to look at individual pixels.