Google has been accused in a lawsuit of illegally tracking the movements of millions of iPhone and Android phone users even when they use a privacy setting to prevent it.