Uber plans to buy up to 24,000 self-driving cars from Volvo, marking the transition of the U.S. firm from an app used to summon a taxi to the owner and operator of a fleet of cars.

The nonbinding framework deal could offer San Francisco-based Uber a way to overcome setbacks at its autonomous driving division in Silicon Valley's race to perfect self-driving systems.

Combining Volvo's cars with Uber's self-driving system builds on their nearly three-year relationship and comes as Uber's autonomous driving unit has been hit by a lawsuit over trade secrets and the departure of top talent.