Merge "Change the location mode before applying restrictions" into lmp-dev