releasetools: Support generating downgrade A/B OTAs.

We already support generating downgrade OTAs for non-A/B devices (with
mandatory data wipe), but we have missed the --downgrade flag in A/B OTA
path.

This CL factors out the function that writes the downgrade metadata, and
fixes the path for generating A/B OTAs.

Bug: 35094540
Test: Generate incrementals with --downgrade for A/B and non-A/B OTAs.
Change-Id: I30b9bf83e69e8aba3be666507681b555db6ab743
1 file changed