Merge "add helpouts banner thing to recruit providers includes script to randomly change the URL and text of link as an A/B test it's a bad A/B test because it does not save the A/B per session" into lmp-dev
diff --git a/tools/droiddoc/templates-sac/assets/images/sac_logo.png b/tools/droiddoc/templates-sac/assets/images/sac_logo.png
index 6dc126a..4ad113c 100644
--- a/tools/droiddoc/templates-sac/assets/images/sac_logo.png
+++ b/tools/droiddoc/templates-sac/assets/images/sac_logo.png
Binary files differ
diff --git a/tools/droiddoc/templates-sac/assets/images/sac_logo@2x.png b/tools/droiddoc/templates-sac/assets/images/sac_logo@2x.png
new file mode 100644
index 0000000..4040f3f
--- /dev/null
+++ b/tools/droiddoc/templates-sac/assets/images/sac_logo@2x.png
Binary files differ
diff --git a/tools/droiddoc/templates-sac/components/masthead.cs b/tools/droiddoc/templates-sac/components/masthead.cs
index fb9b71d..a8618c0 100644
--- a/tools/droiddoc/templates-sac/components/masthead.cs
+++ b/tools/droiddoc/templates-sac/components/masthead.cs
@@ -253,7 +253,9 @@
         <div class="wrap" id="header-wrap">
           <div class="col-3 saclogo">
           <a href="<?cs var:toroot ?>index.html">
-            <img src="<?cs var:toroot ?>assets/images/sac_logo.png" width="114" height="16" alt="Android Developers" />
+            <img src="<?cs var:toroot ?>assets/images/sac_logo.png"
+                srcset="<?cs var:toroot ?>assets/images/sac_logo@2x.png 2x"
+                width="123" height="25" alt="Android Developers" />
           </a>
           </div>
             <ul class="nav-x col-9">
diff --git a/tools/releasetools/sign_target_files_apks b/tools/releasetools/sign_target_files_apks
index 98d2dc1..075c925 100755
--- a/tools/releasetools/sign_target_files_apks
+++ b/tools/releasetools/sign_target_files_apks
@@ -175,10 +175,10 @@
     out_info = copy.copy(info)
 
     if (info.filename == "META/misc_info.txt" and
-        OPTIONS.replace_verity_public_key):
+        OPTIONS.replace_verity_private_key):
       ReplaceVerityPrivateKey(input_tf_zip, output_tf_zip, misc_info, OPTIONS.replace_verity_private_key[1])
     elif (info.filename == "BOOT/RAMDISK/verity_key" and
-        OPTIONS.replace_verity_private_key):
+        OPTIONS.replace_verity_public_key):
       ReplaceVerityPublicKey(output_tf_zip, OPTIONS.replace_verity_public_key[1])
     elif (info.filename.startswith("BOOT/") or
         info.filename.startswith("RECOVERY/") or
@@ -216,10 +216,10 @@
                             "SYSTEM/etc/security/otacerts.zip")):
       # don't copy these files if we're regenerating them below
       pass
-    elif (OPTIONS.replace_verity_public_key and
+    elif (OPTIONS.replace_verity_private_key and
           info.filename == "META/misc_info.txt"):
       pass
-    elif (OPTIONS.replace_verity_private_key and
+    elif (OPTIONS.replace_verity_public_key and
           info.filename == "BOOT/RAMDISK/verity_key"):
       pass
     else:
diff --git a/tools/releasetools/sparse_img.py b/tools/releasetools/sparse_img.py
index 6b70fe1..7574747 100644
--- a/tools/releasetools/sparse_img.py
+++ b/tools/releasetools/sparse_img.py
@@ -77,12 +77,16 @@
         else:
           care_data.append(pos)
           care_data.append(pos + chunk_sz)
-          offset_map.append((pos, chunk_sz, f.tell()))
+          offset_map.append((pos, chunk_sz, f.tell(), None))
           pos += chunk_sz
           f.seek(data_sz, os.SEEK_CUR)
 
       elif chunk_type == 0xCAC2:
-        raise ValueError("Fill chunks are not supported")
+        fill_data = f.read(4)
+        care_data.append(pos)
+        care_data.append(pos + chunk_sz)
+        offset_map.append((pos, chunk_sz, None, fill_data))
+        pos += chunk_sz
 
       elif chunk_type == 0xCAC3:
         if data_sz != 0:
@@ -130,24 +134,29 @@
     for s, e in ranges:
       to_read = e-s
       idx = bisect.bisect_right(self.offset_index, s) - 1
-      chunk_start, chunk_len, filepos = self.offset_map[idx]
+      chunk_start, chunk_len, filepos, fill_data = self.offset_map[idx]
 
       # for the first chunk we may be starting partway through it.
-      p = filepos + ((s - chunk_start) * self.blocksize)
       remain = chunk_len - (s - chunk_start)
-
-      f.seek(p, os.SEEK_SET)
       this_read = min(remain, to_read)
-      yield f.read(this_read * self.blocksize)
+      if filepos is not None:
+        p = filepos + ((s - chunk_start) * self.blocksize)
+        f.seek(p, os.SEEK_SET)
+        yield f.read(this_read * self.blocksize)
+      else:
+        yield fill_data * (this_read * (self.blocksize >> 2))
       to_read -= this_read
 
       while to_read > 0:
         # continue with following chunks if this range spans multiple chunks.
         idx += 1
-        chunk_start, chunk_len, filepos = self.offset_map[idx]
-        f.seek(filepos, os.SEEK_SET)
+        chunk_start, chunk_len, filepos, fill_data = self.offset_map[idx]
         this_read = min(chunk_len, to_read)
-        yield f.read(this_read * self.blocksize)
+        if filepos is not None:
+          f.seek(filepos, os.SEEK_SET)
+          yield f.read(this_read * self.blocksize)
+        else:
+          yield fill_data * (this_read * (self.blocksize >> 2))
         to_read -= this_read
 
   def LoadFileBlockMap(self, fn):
@@ -177,10 +186,16 @@
     for s, e in remaining:
       for b in range(s, e):
         idx = bisect.bisect_right(self.offset_index, b) - 1
-        chunk_start, chunk_len, filepos = self.offset_map[idx]
-        filepos += (b-chunk_start) * self.blocksize
-        f.seek(filepos, os.SEEK_SET)
-        data = f.read(self.blocksize)
+        chunk_start, chunk_len, filepos, fill_data = self.offset_map[idx]
+        if filepos is not None:
+          filepos += (b-chunk_start) * self.blocksize
+          f.seek(filepos, os.SEEK_SET)
+          data = f.read(self.blocksize)
+        else:
+          if fill_data == reference[:4]:   # fill with all zeros
+            data = reference
+          else:
+            data = None
 
         if data == reference:
           zero_blocks.append(b)