configure progress bar during block OTA script generation

Emit script commands to produce a more accurate progress bar (for full
block OTAs) and a working progress bar (for incremental block OTAs) --
ones that are driven by the progress callback from the thing actually
writing the system image.

Change-Id: Ifca10be68cfdaab7135d23515bd0ae5be2f98a16
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files
index 7019c46..9c10b68 100755
--- a/tools/releasetools/ota_from_target_files
+++ b/tools/releasetools/ota_from_target_files
@@ -493,7 +493,7 @@
   if "selinux_fc" in OPTIONS.info_dict:
     WritePolicyConfig(OPTIONS.info_dict["selinux_fc"], output_zip)
 
-  script.ShowProgress(system_progress, 30)
+  script.ShowProgress(system_progress, 0)
   if block_based:
     mapdata, data = img_from_target_files.BuildSystem(
         OPTIONS.input_tmp, OPTIONS.info_dict,
@@ -775,6 +775,7 @@
   device_specific.IncrementalOTA_InstallBegin()
 
   script.Print("Patching system image...")
+  script.ShowProgress(0.9, 0)
   script.Syspatch(system_device,
                   tgt_mapfilename, tgt_sys_sha1,
                   src_mapfilename, src_sys_sha1,
@@ -791,6 +792,7 @@
       # contents of the boot partition, and write it back to the
       # partition.
       script.Print("Patching boot image...")
+      script.ShowProgress(0.1, 10)
       script.ApplyPatch("%s:%s:%d:%s:%d:%s"
                         % (boot_type, boot_device,
                            source_boot.size, source_boot.sha1,