OSDN Git Service

resolve merge conflicts of 2ad8b97577 to nyc-dev
authorTao Bao <tbao@google.com>
Wed, 9 Mar 2016 05:39:13 +0000 (21:39 -0800)
committerTao Bao <tbao@google.com>
Wed, 9 Mar 2016 05:39:13 +0000 (21:39 -0800)
Change-Id: Ifa7501e58dd25e73ed760b1383a1873e4d449885

1  2 
tools/releasetools/ota_from_target_files.py

@@@ -1056,8 -1018,12 +1057,13 @@@ endif
  """ % bcb_dev)
  
    script.SetProgress(1)
-   script.AddToZip(target_zip, output_zip, input_path=OPTIONS.updater_binary)
+   # For downgrade OTAs, we prefer to use the update-binary in the source
+   # build that is actually newer than the one in the target build.
+   if OPTIONS.downgrade:
+     script.AddToZip(source_zip, output_zip, input_path=OPTIONS.updater_binary)
+   else:
+     script.AddToZip(target_zip, output_zip, input_path=OPTIONS.updater_binary)
 +  metadata["ota-required-cache"] = str(script.required_cache)
    WriteMetadata(metadata, output_zip)
  
  
@@@ -1801,11 -1557,16 +1807,17 @@@ endif
    if OPTIONS.verify and vendor_diff:
      script.Print("Remounting and verifying vendor partition files...")
      script.Unmount("/vendor")
 -    script.Mount("/vendor")
 +    script.Mount("/vendor", recovery_mount_options)
      vendor_diff.EmitExplicitTargetVerification(script)
-   script.AddToZip(target_zip, output_zip, input_path=OPTIONS.updater_binary)
+   # For downgrade OTAs, we prefer to use the update-binary in the source
+   # build that is actually newer than the one in the target build.
+   if OPTIONS.downgrade:
+     script.AddToZip(source_zip, output_zip, input_path=OPTIONS.updater_binary)
+   else:
+     script.AddToZip(target_zip, output_zip, input_path=OPTIONS.updater_binary)
  
 +  metadata["ota-required-cache"] = str(script.required_cache)
    WriteMetadata(metadata, output_zip)