One or more non-transitory machine-readable media embodying program instructions that, when executed by one or more machines, cause the one or more machines to implement a method for determining whether a mobile device is inside an environment experiencing adverse pressure variation conditions, the method comprising:
- detecting a change in pressure measured by a mobile device during an Nth predefined time period that meets or exceeds a threshold value of change;
- determining if one or more measurements of an inertial sensor of the mobile device indicate that the mobile device vertically moved at least a threshold amount of distance during the Nth predefined time period;
- if the one or more measurements of an inertial sensor of the mobile device do not indicate that the mobile device vertically moved during the Nth predefined time period at least the threshold amount of distance, determining an estimated position;
- determining if the estimated position is inside a building or within a threshold amount of distance error from the building;
- if the estimated position is inside the building or within the threshold amount of distance error from the building, determining that the mobile device is located in the building;
- and
- if the estimated position is not inside the building or not within the threshold amount of distance error from the building, determining that the mobile device is located in a vehicle.