Merge "Install symlinks when using shortcut phony targets"
diff --git a/core/clang/tidy.mk b/core/clang/tidy.mk
index ee6b6ed..3df0299 100644
--- a/core/clang/tidy.mk
+++ b/core/clang/tidy.mk
@@ -47,6 +47,7 @@
   external/:$(DEFAULT_EXTERNAL_VENDOR_TIDY_CHECKS) \
   external/google:$(DEFAULT_GLOBAL_TIDY_CHECKS) \
   external/webrtc:$(DEFAULT_GLOBAL_TIDY_CHECKS) \
+  frameworks/compile/mclinker/:$(DEFAULT_EXTERNAL_VENDOR_TIDY_CHECKS) \
   hardware/qcom:$(DEFAULT_EXTERNAL_VENDOR_TIDY_CHECKS) \
   vendor/:$(DEFAULT_EXTERNAL_VENDOR_TIDY_CHECKS) \
   vendor/google:$(DEFAULT_GLOBAL_TIDY_CHECKS) \
diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py
index c9a8038..5369c5b 100755
--- a/tools/releasetools/add_img_to_target_files.py
+++ b/tools/releasetools/add_img_to_target_files.py
@@ -19,7 +19,31 @@
 not have an IMAGES/ top-level subdirectory), produce the images and
 add them to the zipfile.
 
-Usage:  add_img_to_target_files target_files
+Usage:  add_img_to_target_files [flag] target_files
+
+  -a  (--add_missing)
+      Build and add missing images to "IMAGES/". If this option is
+      not specified, this script will simply exit when "IMAGES/"
+      directory exists in the target file.
+
+  -r  (--rebuild_recovery)
+      Rebuild the recovery patch and write it to the system image. Only
+      meaningful when system image needs to be rebuilt.
+
+  --replace_verity_private_key
+      Replace the private key used for verity signing. (same as the option
+      in sign_target_files_apks)
+
+  --replace_verity_public_key
+       Replace the certificate (public key) used for verity verification. (same
+       as the option in sign_target_files_apks)
+
+  --is_signing
+      Skip building & adding the images for "userdata" and "cache" if we
+      are signing the target files.
+
+  --verity_signer_path
+      Specify the signer path to build verity metadata.
 """
 
 import sys
@@ -46,6 +70,7 @@
 OPTIONS.rebuild_recovery = False
 OPTIONS.replace_verity_public_key = False
 OPTIONS.replace_verity_private_key = False
+OPTIONS.is_signing = False
 OPTIONS.verity_signer_path = None
 
 def AddSystem(output_zip, prefix="IMAGES/", recovery_img=None, boot_img=None):
@@ -386,10 +411,11 @@
   if has_vendor:
     banner("vendor")
     AddVendor(output_zip)
-  banner("userdata")
-  AddUserdata(output_zip)
-  banner("cache")
-  AddCache(output_zip)
+  if not OPTIONS.is_signing:
+    banner("userdata")
+    AddUserdata(output_zip)
+    banner("cache")
+    AddCache(output_zip)
   if OPTIONS.info_dict.get("board_bpt_enable", None) == "true":
     banner("partition-table")
     AddPartitionTable(output_zip)
@@ -438,6 +464,8 @@
       OPTIONS.replace_verity_private_key = (True, a)
     elif o == "--replace_verity_public_key":
       OPTIONS.replace_verity_public_key = (True, a)
+    elif o == "--is_signing":
+      OPTIONS.is_signing = True
     elif o == "--verity_signer_path":
       OPTIONS.verity_signer_path = a
     else:
@@ -449,6 +477,7 @@
       extra_long_opts=["add_missing", "rebuild_recovery",
                        "replace_verity_public_key=",
                        "replace_verity_private_key=",
+                       "is_signing",
                        "verity_signer_path="],
       extra_option_handler=option_handler)
 
diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py
index 0f20f82..6d68be1 100755
--- a/tools/releasetools/sign_target_files_apks.py
+++ b/tools/releasetools/sign_target_files_apks.py
@@ -713,7 +713,9 @@
   common.ZipClose(input_zip)
   common.ZipClose(output_zip)
 
-  add_img_to_target_files.AddImagesToTargetFiles(args[1])
+  # Skip building userdata.img and cache.img when signing the target files.
+  new_args = ["--is_signing", args[1]]
+  add_img_to_target_files.main(new_args)
 
   print "done."
 
diff --git a/tools/warn.py b/tools/warn.py
index f118263..3a8ae66 100755
--- a/tools/warn.py
+++ b/tools/warn.py
@@ -1508,7 +1508,7 @@
     { 'category':'C/C++',   'severity':severity.MEDIUM,   'members':[], 'option':'-Wconversion',
         'description':'Conversion may change value',
         'patterns':[r".*: warning: converting negative value '.+' to '.+'",
-                    r".*: warning: conversion to '.+' .+ may alter its value"] },
+                    r".*: warning: conversion to '.+' .+ may (alter|change)"] },
     { 'category':'C/C++',   'severity':severity.MEDIUM,   'members':[], 'option':'-Wconversion-null',
         'description':'Converting to non-pointer type from NULL',
         'patterns':[r".*: warning: converting to non-pointer type '.+' from NULL"] },
@@ -1552,9 +1552,6 @@
         'description':'Base should be explicitly initialized in copy constructor',
         'patterns':[r".*: warning: base class '.+' should be explicitly initialized in the copy constructor"] },
     { 'category':'C/C++',   'severity':severity.MEDIUM,     'members':[], 'option':'',
-        'description':'Converting from <type> to <other type>',
-        'patterns':[r".*: warning: converting to '.+' from '.+'"] },
-    { 'category':'C/C++',   'severity':severity.MEDIUM,     'members':[], 'option':'',
         'description':'VLA has zero or negative size',
         'patterns':[r".*: warning: Declared variable-length array \(VLA\) has .+ size"] },
     { 'category':'C/C++',   'severity':severity.MEDIUM,     'members':[], 'option':'',