Arsalan Mosenia, Xiaoliang Dai, Prateek Mittal and Niraj Jha, in paper recently published, describe a new user-location mechanism that exploits non-sensory/sensory data stored on the smartphone to estimate the user's location when all location services are turned off.
The technique, tested on iPhone 6, iPhone 6S and Galaxy S4, is dubbed "PinMe".

The researchers show how the data from barometer, the altimeter, the gyroscope, the accelerometer, the magnetometer and the smartphone clock are sufficient to determine where a user is located, when aggregated and compared with publicly available data.

Unlike previously-proposed attacks, PinMe neither requires any prior knowledge about the user nor a training dataset on specific routes.
We demonstrate that PinMe can accurately estimate the user’s location during four activities (walking, traveling on a train, driving, and traveling on a plane).
We also suggest several defenses against the proposed attack.

For example, the accelerometer allows you to understand the type of movement: if it is slow and oscillating, the user is walking. If it is faster with 90 degrees turns, the user probably is going by car, motorbike or bicycle.
Higher speeds and large curves indicate the use of a train or an airplane (if the barometer indicates reduced pressure, it is an airplane).

Comparing the meteorological pressure data with the time zone detected by the mobile phone for a certain period of time, with the public altimetry data and with the compass orientation, you can quickly define the area in which the user can be localized.

For each turn, for example, the number of roads corresponding to the covered route is reduced: the researchers noted that twelve rounds are sufficient to know exactly where the car is located in which the user moves.


Apart from the drastic choice to stop using a smartphone and go back to a classic phone, you need to remove any apps that you no longer use and do not install app of dubious origin.
Researchers also advise manufacturers to impose limitations on the collection frequency of sensors data or add physical switches to devices, in order to safely disable unused sensors.