The US Supreme Court has ruled that police need a warrant before they can gain access to location information, stored by mobile phone companies, for an extended period.