WASHINGTON - Uber will end a controversial policy of tracking some riders for five minutes after their trip ends, the ride-hailing company said Tuesday as it tries to repair its privacy reputation.

Uber was criticized by users and privacy advocates when it announced last year that it would collect location data from riders through its app from the time the trip was requested through five minutes after it ended. Uber said it was doing so "to improve pickups, drop-offs, customer service, and to enhance safety."

Users who didn't want to be tracked after their ride ended could opt out by turning off the app's location services. But that required users to manually enter their pickup location.

Uber is "rolling back the decision to collect post-trip location for all riders," company spokeswoman Melanie Ensign said. The change was first reported by Reuters.

Uber asked all its app users for permission to collect the post-trip location data but it actually collected that data only from those with Android devices, Ensign said. Uber has "paused" that data collection, she said.

The company never started collecting the information from users with iPhones and other iOS devices, Ensign said.

The app's settings currently allow users to choose between "never" allowing the app to collect location information and "always" allowing it to collect that information anytime the app is running, even if it's in the background. The "always" option will soon change to specify that data collection will stop once a trip ends or is canceled, Uber said.