Public transit systems suffering revenue losses as riders migrate to Uber and Lyft may be able to turn to another tech giant for salvation.

Amazon last week received a patent for transforming public buses into mobile delivery stations.

Customers would simply meet the bus at a convenient stop, and pick up their items from a removable delivery module attached to the vehicle.

Not all customers of the e-commerce giant led by CEO Jeff Bezos can take advantage of automated delivery boxes the firm has set up at various locations, including outside grocery stores, according to the patent.

Amazon also has been pushing for more investment in public transit.

Over the summer, the company said it would invest $1.5 million to increase bus frequency in Seattle.

It also made public transportation a priority in its selection of its HQ2 project.

“Some customers may not live or work near pickup locations, or may otherwise not want to take the time to travel to one,” the patent said.

“In addition, some customers may live and work in regions where there are few or no carriers for delivering packages, thus complicating the delivery of items to any destinations near the customer.”

Enter the public transportation system, which according to a recent report is losing ridership to ride-hailing companies.

Amazon’s patent does not specify any financial arrangements that might be associated with fastening its delivery modules to buses, but it would clearly have to pay to do so.

Here’s how the system would work, according to the patent: “A user may begin by entering an address or area, in response to which the system may present a list of bus stops near the address or area,” the patent said.

“Once the user selects a bus stop,” the patent said, “the system may present a list of time windows during which different buses carrying mobile pickup locations are scheduled to be at the stop.”

A customer could also pick up items from a bus they use regularly, the patent application added.