Kalman filter continues to update position even though speed is zero
First, you err in using the square root of accuracy in your covariance matrices.  These should be squared.  If your positional accuracy is $\sigma_h$ and your velocity accuracy is $\sigma_s$, then your measurement matrix should be
$$\mathbf R = \begin{bmatrix}
\sigma_h^2 &amp; 0 &amp; 0 &amp; 0 \\
0 &amp; \sigma_h^2 &amp; 0 &amp; 0 \\
0 &amp; 0 &amp; \sigma_v^2 &amp; 0 \\
0 &amp; 0 &amp; 0 &amp; \sigma_v^2 \\
\end{bmatrix}$$
Second, your $\mathbf Q$ matrix is telling the Kalman filter that the position moves a distance with a deviation of $\sigma_h$ each step, and its velocity changes with a deviation of $\sigma_v$ each step.
So you're telling the filter &quot;hey, this phone is moving around in this huge and unpredictable way every single time step&quot;.  As a consequence, at each time step the filter is going to put as much or more credence in the measurement as it does in its filtered position and velocity.
If you want the filter to track when you're moving and settle when you put it on a table, you either need GPS/IMU fusion, or you need to &quot;tell&quot; it (by setting the $\mathbf Q$ matrix very small) that it's sitting still when its on the table, and (by setting the $\mathbf Q$ matrix high) that it's moving when it's not on the table.
Figuring out how to do that, absent of full GPS/IMU fusion, I leave to you.