Merge "Add newly created Sensors HAL 2.1 to VNDK list"
diff --git a/Deprecation.md b/Deprecation.md
index 7046a74..5e26492 100644
--- a/Deprecation.md
+++ b/Deprecation.md
@@ -17,6 +17,7 @@
| `BUILD_AUX_EXECUTABLE` | Error |
| `BUILD_AUX_STATIC_LIBRARY` | Error |
| `BUILD_COPY_HEADERS` | Warning |
+| `BUILD_HOST_EXECUTABLE` | Warning |
| `BUILD_HOST_FUZZ_TEST` | Error |
| `BUILD_HOST_NATIVE_TEST` | Error |
| `BUILD_HOST_SHARED_LIBRARY` | Warning |
diff --git a/core/Makefile b/core/Makefile
index 0aa06d9..c48ea03 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -16,7 +16,28 @@
define check-product-copy-files
$(if $(filter-out $(TARGET_COPY_OUT_SYSTEM_OTHER)/%,$(2)), \
$(if $(filter %.apk, $(2)),$(error \
- Prebuilt apk found in PRODUCT_COPY_FILES: $(1), use BUILD_PREBUILT instead!)))
+ Prebuilt apk found in PRODUCT_COPY_FILES: $(1), use BUILD_PREBUILT instead!))) \
+$(if $(filter true,$(BUILD_BROKEN_VINTF_PRODUCT_COPY_FILES)),, \
+ $(if $(filter $(TARGET_COPY_OUT_SYSTEM)/etc/vintf/% \
+ $(TARGET_COPY_OUT_SYSTEM)/manifest.xml \
+ $(TARGET_COPY_OUT_SYSTEM)/compatibility_matrix.xml,$(2)), \
+ $(error VINTF metadata found in PRODUCT_COPY_FILES: $(1), use vintf_fragments instead!)) \
+ $(if $(filter $(TARGET_COPY_OUT_PRODUCT)/etc/vintf/%,$(2)), \
+ $(error VINTF metadata found in PRODUCT_COPY_FILES: $(1), \
+ use PRODUCT_MANIFEST_FILES / DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE / vintf_compatibility_matrix / vintf_fragments instead!)) \
+ $(if $(filter $(TARGET_COPY_OUT_SYSTEM_EXT)/etc/vintf/%,$(2)), \
+ $(error VINTF metadata found in PRODUCT_COPY_FILES: $(1), \
+ use vintf_compatibility_matrix / vintf_fragments instead!)) \
+ $(if $(filter $(TARGET_COPY_OUT_VENDOR)/etc/vintf/% \
+ $(TARGET_COPY_OUT_VENDOR)/manifest.xml \
+ $(TARGET_COPY_OUT_VENDOR)/compatibility_matrix.xml,$(2)), \
+ $(error VINTF metadata found in PRODUCT_COPY_FILES: $(1), \
+ use DEVICE_MANIFEST_FILE / DEVICE_MATRIX_FILE / vintf_compatibility_matrix / vintf_fragments instead!)) \
+ $(if $(filter $(TARGET_COPY_OUT_ODM)/etc/vintf/% \
+ $(TARGET_COPY_OUT_ODM)/etc/manifest%,$(2)), \
+ $(error VINTF metadata found in PRODUCT_COPY_FILES: $(1), \
+ use ODM_MANIFEST_FILES / vintf_fragments instead!)) \
+)
endef
# filter out the duplicate <source file>:<dest file> pairs.
unique_product_copy_files_pairs :=
@@ -220,6 +241,7 @@
BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \
DATE="$(DATE_FROM_FILE)" \
PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \
+ PLATFORM_VERSION_LAST_STABLE="$(PLATFORM_VERSION_LAST_STABLE)" \
PLATFORM_VERSION="$(PLATFORM_VERSION)" \
TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \
bash $(BUILDINFO_COMMON_SH) "$(1)" >> $(2)
@@ -425,6 +447,7 @@
BUILD_NUMBER="$(BUILD_NUMBER_FROM_FILE)" \
BOARD_BUILD_SYSTEM_ROOT_IMAGE="$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)" \
PLATFORM_VERSION="$(PLATFORM_VERSION)" \
+ PLATFORM_VERSION_LAST_STABLE="$(PLATFORM_VERSION_LAST_STABLE)" \
PLATFORM_SECURITY_PATCH="$(PLATFORM_SECURITY_PATCH)" \
PLATFORM_BASE_OS="$(PLATFORM_BASE_OS)" \
PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \
@@ -480,6 +503,12 @@
INSTALLED_VENDOR_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR)/build.prop
ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_VENDOR_BUILD_PROP_TARGET)
+ifdef TARGET_VENDOR_PROP
+vendor_prop_files := $(TARGET_VENDOR_PROP)
+else
+vendor_prop_files := $(wildcard $(TARGET_DEVICE_DIR)/vendor.prop)
+endif
+
ifdef property_overrides_split_enabled
FINAL_VENDOR_BUILD_PROPERTIES += \
$(call collapse-pairs, $(PRODUCT_PROPERTY_OVERRIDES))
@@ -487,7 +516,7 @@
$(FINAL_VENDOR_BUILD_PROPERTIES),=)
endif # property_overrides_split_enabled
-$(INSTALLED_VENDOR_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) $(intermediate_system_build_prop)
+$(INSTALLED_VENDOR_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) $(intermediate_system_build_prop) $(vendor_prop_files)
@echo Target vendor buildinfo: $@
@mkdir -p $(dir $@)
$(hide) echo > $@
@@ -523,6 +552,16 @@
echo "#" >> $@;
$(hide) cat $(INSTALLED_ANDROID_INFO_TXT_TARGET) | grep 'require version-' | sed -e 's/require version-/ro.build.expect./g' >> $@
ifdef property_overrides_split_enabled
+ $(hide) $(foreach file,$(vendor_prop_files), \
+ if [ -f "$(file)" ]; then \
+ echo Target vendor properties from: "$(file)"; \
+ echo "" >> $@; \
+ echo "#" >> $@; \
+ echo "# from $(file)" >> $@; \
+ echo "#" >> $@; \
+ cat $(file) >> $@; \
+ echo "# end of $(file)" >> $@; \
+ fi;)
$(hide) $(foreach line,$(FINAL_VENDOR_BUILD_PROPERTIES), \
echo "$(line)" >> $@;)
endif # property_overrides_split_enabled
@@ -574,12 +613,18 @@
INSTALLED_ODM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM)/etc/build.prop
ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_ODM_BUILD_PROP_TARGET)
+ifdef TARGET_ODM_PROP
+odm_prop_files := $(TARGET_ODM_PROP)
+else
+odm_prop_files := $(wildcard $(TARGET_DEVICE_DIR)/odm.prop)
+endif
+
FINAL_ODM_BUILD_PROPERTIES += \
$(call collapse-pairs, $(PRODUCT_ODM_PROPERTIES))
FINAL_ODM_BUILD_PROPERTIES := $(call uniq-pairs-by-first-component, \
$(FINAL_ODM_BUILD_PROPERTIES),=)
-$(INSTALLED_ODM_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS)
+$(INSTALLED_ODM_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) $(odm_prop_files)
@echo Target odm buildinfo: $@
@mkdir -p $(dir $@)
$(hide) echo > $@
@@ -587,6 +632,16 @@
$(hide) echo ro.odm.product.cpu.abilist32="$(TARGET_CPU_ABI_LIST_32_BIT)">>$@
$(hide) echo ro.odm.product.cpu.abilist64="$(TARGET_CPU_ABI_LIST_64_BIT)">>$@
$(hide) $(call generate-common-build-props,odm,$@)
+ $(hide) $(foreach file,$(odm_prop_files), \
+ if [ -f "$(file)" ]; then \
+ echo Target odm properties from: "$(file)"; \
+ echo "" >> $@; \
+ echo "#" >> $@; \
+ echo "# from $(file)" >> $@; \
+ echo "#" >> $@; \
+ cat $(file) >> $@; \
+ echo "# end of $(file)" >> $@; \
+ fi;)
$(hide) echo "#" >> $@; \
echo "# ADDITIONAL ODM BUILD PROPERTIES" >> $@; \
echo "#" >> $@;
@@ -1098,7 +1153,7 @@
endif
INTERNAL_MKBOOTIMG_VERSION_ARGS := \
- --os_version $(PLATFORM_VERSION) \
+ --os_version $(PLATFORM_VERSION_LAST_STABLE) \
--os_patch_level $(PLATFORM_SECURITY_PATCH)
# Define these only if we are building boot
@@ -1693,7 +1748,8 @@
$(if $(filter true,$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)),\
$(hide) echo "system_root_image=true" >> $(1))
$(hide) echo "root_dir=$(TARGET_ROOT_OUT)" >> $(1)
-$(if $(PRODUCT_USE_DYNAMIC_PARTITION_SIZE),$(hide) echo "use_dynamic_partition_size=true" >> $(1))
+$(if $(filter true,$(PRODUCT_USE_DYNAMIC_PARTITION_SIZE)),\
+ $(hide) echo "use_dynamic_partition_size=true" >> $(1))
$(if $(3),$(hide) $(foreach kv,$(3),echo "$(kv)" >> $(1);))
endef
@@ -3194,22 +3250,22 @@
BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS += \
--prop com.android.build.system.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) \
- --prop com.android.build.system.os_version:$(PLATFORM_VERSION) \
+ --prop com.android.build.system.os_version:$(PLATFORM_VERSION_LAST_STABLE) \
--prop com.android.build.system.security_patch:$(PLATFORM_SECURITY_PATCH)
BOARD_AVB_PRODUCT_ADD_HASHTREE_FOOTER_ARGS += \
--prop com.android.build.product.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) \
- --prop com.android.build.product.os_version:$(PLATFORM_VERSION) \
+ --prop com.android.build.product.os_version:$(PLATFORM_VERSION_LAST_STABLE) \
--prop com.android.build.product.security_patch:$(PLATFORM_SECURITY_PATCH)
BOARD_AVB_SYSTEM_EXT_ADD_HASHTREE_FOOTER_ARGS += \
--prop com.android.build.system_ext.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) \
- --prop com.android.build.system_ext.os_version:$(PLATFORM_VERSION) \
+ --prop com.android.build.system_ext.os_version:$(PLATFORM_VERSION_LAST_STABLE) \
--prop com.android.build.system_ext.security_patch:$(PLATFORM_SECURITY_PATCH)
BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS += \
--prop com.android.build.boot.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) \
- --prop com.android.build.boot.os_version:$(PLATFORM_VERSION)
+ --prop com.android.build.boot.os_version:$(PLATFORM_VERSION_LAST_STABLE)
BOARD_AVB_VENDOR_BOOT_ADD_HASH_FOOTER_ARGS += \
--prop com.android.build.vendor_boot.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) \
@@ -3219,11 +3275,11 @@
BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS += \
--prop com.android.build.vendor.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) \
- --prop com.android.build.vendor.os_version:$(PLATFORM_VERSION)
+ --prop com.android.build.vendor.os_version:$(PLATFORM_VERSION_LAST_STABLE)
BOARD_AVB_ODM_ADD_HASHTREE_FOOTER_ARGS += \
--prop com.android.build.odm.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE) \
- --prop com.android.build.odm.os_version:$(PLATFORM_VERSION)
+ --prop com.android.build.odm.os_version:$(PLATFORM_VERSION_LAST_STABLE)
BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS += \
--prop com.android.build.dtbo.fingerprint:$(BUILD_FINGERPRINT_FROM_FILE)
@@ -3809,6 +3865,7 @@
mkbootfs \
mkbootimg \
mke2fs \
+ mke2fs.conf \
mkf2fsuserimg.sh \
mksquashfs \
mksquashfsimage.sh \
diff --git a/core/binary.mk b/core/binary.mk
index a62f76c..38ff9d6 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -90,32 +90,6 @@
my_cflags += -DDO_NOT_CHECK_MANUAL_BINDER_INTERFACES
endif
-ifneq ($(strip $(ENABLE_XOM)),false)
- ifndef LOCAL_IS_HOST_MODULE
- my_xom := true
- # Disable XOM in excluded paths.
- combined_xom_exclude_paths := $(XOM_EXCLUDE_PATHS) \
- $(PRODUCT_XOM_EXCLUDE_PATHS)
- ifneq ($(strip $(foreach dir,$(subst $(comma),$(space),$(combined_xom_exclude_paths)),\
- $(filter $(dir)%,$(LOCAL_PATH)))),)
- my_xom := false
- endif
-
- # Allow LOCAL_XOM to override the above
- ifdef LOCAL_XOM
- my_xom := $(LOCAL_XOM)
- endif
-
- ifeq ($(strip $(my_xom)),true)
- ifeq (arm64,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH))
- ifeq ($(my_use_clang_lld),true)
- my_ldflags += -Wl,--execute-only -Wl,-z,separate-code
- endif
- endif
- endif
- endif
-endif
-
my_allow_undefined_symbols := $(strip $(LOCAL_ALLOW_UNDEFINED_SYMBOLS))
ifdef SANITIZE_HOST
ifdef LOCAL_IS_HOST_MODULE
@@ -299,6 +273,9 @@
# If PLATFORM_VNDK_VERSION has a CODENAME, it will return
# __ANDROID_API_FUTURE__.
my_api_level := $(call codename-or-sdk-to-sdk,$(PLATFORM_VNDK_VERSION))
+ else
+ # Build with current BOARD_VNDK_VERSION.
+ my_api_level := $(call codename-or-sdk-to-sdk,$(BOARD_VNDK_VERSION))
endif
my_cflags += -D__ANDROID_VNDK__
endif
diff --git a/core/board_config.mk b/core/board_config.mk
index 63d7e07..91d4fd6 100644
--- a/core/board_config.mk
+++ b/core/board_config.mk
@@ -87,10 +87,11 @@
_build_broken_var_list := \
BUILD_BROKEN_DUP_RULES \
+ BUILD_BROKEN_OUTSIDE_INCLUDE_DIRS \
BUILD_BROKEN_PREBUILT_ELF_FILES \
BUILD_BROKEN_TREBLE_SYSPROP_NEVERALLOW \
BUILD_BROKEN_USES_NETWORK \
- BUILD_BROKEN_OUTSIDE_INCLUDE_DIRS \
+ BUILD_BROKEN_VINTF_PRODUCT_COPY_FILES \
_build_broken_var_list += \
$(foreach m,$(AVAILABLE_BUILD_MODULE_TYPES) \
@@ -581,9 +582,8 @@
ifdef BOARD_VNDK_VERSION
ifneq ($(BOARD_VNDK_VERSION),current)
- $(error BOARD_VNDK_VERSION: Only "current" is implemented)
+ $(call check_vndk_version,$(BOARD_VNDK_VERSION))
endif
-
TARGET_VENDOR_TEST_SUFFIX := /vendor
else
TARGET_VENDOR_TEST_SUFFIX :=
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index bbc117f..e27d91c 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -314,7 +314,6 @@
LOCAL_VTS_MODE:=
LOCAL_WARNINGS_ENABLE:=
LOCAL_WHOLE_STATIC_LIBRARIES:=
-LOCAL_XOM:=
LOCAL_YACCFLAGS:=
LOCAL_CHECK_ELF_FILES:=
# TODO: deprecate, it does nothing
diff --git a/core/config.mk b/core/config.mk
index c5f54de..844d7d6 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -228,6 +228,36 @@
# Initialize SOONG_CONFIG_NAMESPACES so that it isn't recursive.
SOONG_CONFIG_NAMESPACES :=
+# The add_soong_config_namespace function adds a namespace and initializes it
+# to be empty.
+# $1 is the namespace.
+# Ex: $(call add_soong_config_namespace,acme)
+
+define add_soong_config_namespace
+$(eval SOONG_CONFIG_NAMESPACES += $1) \
+$(eval SOONG_CONFIG_$1 :=)
+endef
+
+# The add_soong_config_var function adds a a list of soong config variables to
+# SOONG_CONFIG_*. The variables and their values are then available to a
+# soong_config_module_type in an Android.bp file.
+# $1 is the namespace. $2 is the list of variables.
+# Ex: $(call add_soong_config_var,acme,COOL_FEATURE_A COOL_FEATURE_B)
+define add_soong_config_var
+$(eval SOONG_CONFIG_$1 += $2) \
+$(foreach v,$2,$(eval SOONG_CONFIG_$1_$v := $($v)))
+endef
+
+# The add_soong_config_var_value function defines a make variable and also adds
+# the variable to SOONG_CONFIG_*.
+# $1 is the namespace. $2 is the variable name. $3 is the variable value.
+# Ex: $(call add_soong_config_var_value,acme,COOL_FEATURE,true)
+
+define add_soong_config_var_value
+$(eval $2 := $3) \
+$(call add_soong_config_var,$1,$2)
+endef
+
# Set the extensions used for various packages
COMMON_PACKAGE_SUFFIX := .zip
COMMON_JAVA_PACKAGE_SUFFIX := .jar
diff --git a/core/definitions.mk b/core/definitions.mk
index fd785b8..fb11ab6 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2197,17 +2197,19 @@
define transform-classes.jar-to-dex
@echo "target Dex: $(PRIVATE_MODULE)"
-@mkdir -p $(dir $@)
+@mkdir -p $(dir $@)tmp
$(hide) rm -f $(dir $@)classes*.dex $(dir $@)d8_input.jar
$(hide) $(ZIP2ZIP) -j -i $< -o $(dir $@)d8_input.jar "**/*.class"
$(hide) $(D8_WRAPPER) $(DX_COMMAND) $(DEX_FLAGS) \
- --output $(dir $@) \
+ --output $(dir $@)tmp \
$(addprefix --lib ,$(PRIVATE_D8_LIBS)) \
--min-api $(PRIVATE_MIN_SDK_VERSION) \
$(subst --main-dex-list=, --main-dex-list , \
$(filter-out --core-library --multi-dex --minimal-main-dex,$(PRIVATE_DX_FLAGS))) \
$(dir $@)d8_input.jar
+$(hide) mv $(dir $@)tmp/* $(dir $@)
$(hide) rm -f $(dir $@)d8_input.jar
+$(hide) rm -rf $(dir $@)tmp
endef
# We need the extra blank line, so that the command will be on a separate line.
diff --git a/core/deprecation.mk b/core/deprecation.mk
index dac7e4b..cc620a3 100644
--- a/core/deprecation.mk
+++ b/core/deprecation.mk
@@ -5,7 +5,6 @@
BUILD_HEADER_LIBRARY \
BUILD_HOST_DALVIK_JAVA_LIBRARY \
BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY \
- BUILD_HOST_EXECUTABLE \
BUILD_HOST_JAVA_LIBRARY \
BUILD_HOST_PREBUILT \
BUILD_JAVA_LIBRARY \
@@ -26,6 +25,7 @@
# DEFAULT_ERROR_BUILD_MODULE_TYPES.
DEFAULT_WARNING_BUILD_MODULE_TYPES :=$= \
BUILD_COPY_HEADERS \
+ BUILD_HOST_EXECUTABLE \
BUILD_HOST_SHARED_LIBRARY \
BUILD_HOST_STATIC_LIBRARY \
diff --git a/core/dex_preopt_config.mk b/core/dex_preopt_config.mk
index 5dd5505..ccf53f5 100644
--- a/core/dex_preopt_config.mk
+++ b/core/dex_preopt_config.mk
@@ -73,8 +73,7 @@
$(call add_json_bool, DisablePreopt, $(call invert_bool,$(and $(filter true,$(PRODUCT_USES_DEFAULT_ART_CONFIG)),$(filter true,$(WITH_DEXPREOPT)))))
$(call add_json_list, DisablePreoptModules, $(DEXPREOPT_DISABLED_MODULES))
$(call add_json_bool, OnlyPreoptBootImageAndSystemServer, $(filter true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY)))
- $(call add_json_bool, GenerateApexImage, $(filter true,$(DEXPREOPT_GENERATE_APEX_IMAGE)))
- $(call add_json_bool, UseApexImage, $(filter true,$(DEXPREOPT_USE_APEX_IMAGE)))
+ $(call add_json_bool, UseArtImage, $(filter true,$(DEXPREOPT_USE_ART_IMAGE)))
$(call add_json_bool, DontUncompressPrivAppsDex, $(filter true,$(DONT_UNCOMPRESS_PRIV_APPS_DEXS)))
$(call add_json_list, ModulesLoadedByPrivilegedModules, $(PRODUCT_LOADED_BY_PRIVILEGED_MODULES))
$(call add_json_bool, HasSystemOther, $(BOARD_USES_SYSTEM_OTHER_ODEX))
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 0fb2dd2..a33b2b4 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -113,8 +113,8 @@
my_dexpreopt_images_deps :=
my_dexpreopt_image_locations :=
my_dexpreopt_infix := boot
-ifeq (true, $(DEXPREOPT_USE_APEX_IMAGE))
- my_dexpreopt_infix := jitzygote-boot
+ifeq (true, $(DEXPREOPT_USE_ART_IMAGE))
+ my_dexpreopt_infix := art
endif
ifdef LOCAL_DEX_PREOPT
diff --git a/core/executable.mk b/core/executable.mk
index c8d9272..db8dcc6 100644
--- a/core/executable.mk
+++ b/core/executable.mk
@@ -6,6 +6,10 @@
# LOCAL_MODULE_PATH_32 and LOCAL_MODULE_PATH_64 or LOCAL_MODULE_STEM_32 and
# LOCAL_MODULE_STEM_64
+ifdef LOCAL_IS_HOST_MODULE
+ $(call pretty-error,BUILD_EXECUTABLE is incompatible with LOCAL_IS_HOST_MODULE. Use BUILD_HOST_EXECUTABLE instead.)
+endif
+
my_skip_this_target :=
ifneq ($(filter address,$(SANITIZE_TARGET)),)
ifeq (true,$(LOCAL_FORCE_STATIC_EXECUTABLE))
diff --git a/core/product.mk b/core/product.mk
index 55cbc5e..25a9c44 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -350,8 +350,6 @@
# system.img), so devices need to install the package in a system-only OTA manner.
_product_single_value_vars += PRODUCT_BUILD_GENERIC_OTA_PACKAGE
-# Whether any paths are excluded from being set XOM when ENABLE_XOM=true
-_product_list_vars += PRODUCT_XOM_EXCLUDE_PATHS
_product_list_vars += PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES
_product_list_vars += PRODUCT_PACKAGE_NAME_OVERRIDES
_product_list_vars += PRODUCT_CERTIFICATE_OVERRIDES
diff --git a/core/product_config.mk b/core/product_config.mk
index 1890599..c4361d0 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -265,9 +265,9 @@
endif
$(foreach pair,$(PRODUCT_UPDATABLE_BOOT_JARS), \
- $(if $(findstring $(call word-colon,2,$(pair)),$(PRODUCT_BOOT_JARS)),, \
- $(error Every jar in PRODUCT_UPDATABLE_BOOT_JARS must also be in PRODUCT_BOOT_JARS, \
- $(call word-colon,2,$(pair)) is not) \
+ $(if $(findstring $(call word-colon,2,$(pair)),$(PRODUCT_BOOT_JARS)), \
+ $(error A jar in PRODUCT_UPDATABLE_BOOT_JARS must not be in PRODUCT_BOOT_JARS, \
+ but $(call word-colon,2,$(pair)) is) \
) \
)
@@ -335,6 +335,12 @@
endif
endif
+ifdef PRODUCT_SHIPPING_API_LEVEL
+ ifneq (,$(call math_gt_or_eq,29,$(PRODUCT_SHIPPING_API_LEVEL)))
+ PRODUCT_PACKAGES += $(PRODUCT_PACKAGES_SHIPPING_API_LEVEL_29)
+ endif
+endif
+
# If build command defines OVERRIDE_PRODUCT_EXTRA_VNDK_VERSIONS,
# override PRODUCT_EXTRA_VNDK_VERSIONS with it.
ifdef OVERRIDE_PRODUCT_EXTRA_VNDK_VERSIONS
@@ -345,7 +351,11 @@
,Use PRODUCT_EXTRA_VNDK_VERSIONS instead)
ifdef OVERRIDE_PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE
- PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE := $(OVERRIDE_PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE)
+ ifeq (false,$(OVERRIDE_PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE))
+ PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE :=
+ else
+ PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE := $(OVERRIDE_PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE)
+ endif
else ifeq ($(PRODUCT_SHIPPING_API_LEVEL),)
# No shipping level defined
else ifeq ($(call math_gt,$(PRODUCT_SHIPPING_API_LEVEL),29),true)
diff --git a/core/rbe.mk b/core/rbe.mk
index 6a92366..7886e1a 100644
--- a/core/rbe.mk
+++ b/core/rbe.mk
@@ -21,8 +21,33 @@
else
rbe_dir := $(HOME)/rbe
endif
+
+ ifdef RBE_CXX_EXEC_STRATEGY
+ cxx_rbe_exec_strategy := $(RBE_CXX_EXEC_STRATEGY)
+ else
+ cxx_rbe_exec_strategy := "local"
+ endif
+
+ ifdef RBE_JAVAC_EXEC_STRATEGY
+ javac_exec_strategy := $(RBE_JAVAC_EXEC_STRATEGY)
+ else
+ javac_exec_strategy := "local"
+ endif
+
+ ifdef RBE_R8_EXEC_STRATEGY
+ r8_exec_strategy := $(RBE_R8_EXEC_STRATEGY)
+ else
+ r8_exec_strategy := "local"
+ endif
+
+ ifdef RBE_D8_EXEC_STRATEGY
+ d8_exec_strategy := $(RBE_D8_EXEC_STRATEGY)
+ else
+ d8_exec_strategy := "local"
+ endif
+
RBE_WRAPPER := $(rbe_dir)/rewrapper
- RBE_CXX := --labels=type=compile,lang=cpp,compiler=clang --env_var_whitelist=PWD
+ RBE_CXX := --labels=type=compile,lang=cpp,compiler=clang --env_var_whitelist=PWD --exec_strategy=$(cxx_rbe_exec_strategy)
# Append rewrapper to existing *_WRAPPER variables so it's possible to
# use both ccache and rewrapper.
@@ -30,15 +55,15 @@
CXX_WRAPPER := $(strip $(CXX_WRAPPER) $(RBE_WRAPPER) $(RBE_CXX))
ifdef RBE_JAVAC
- JAVAC_WRAPPER := $(strip $(JAVAC_WRAPPER) $(RBE_WRAPPER) --labels=type=compile,lang=java,compiler=javac,shallow=true)
+ JAVAC_WRAPPER := $(strip $(JAVAC_WRAPPER) $(RBE_WRAPPER) --labels=type=compile,lang=java,compiler=javac,shallow=true --exec_strategy=$(javac_exec_strategy))
endif
ifdef RBE_R8
- R8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=r8,shallow=true)
+ R8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=r8,shallow=true --exec_strategy=$(r8_exec_strategy))
endif
ifdef RBE_D8
- D8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=d8,shallow=true)
+ D8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=d8,shallow=true --exec_strategy=$(d8_exec_strategy))
endif
rbe_dir :=
diff --git a/core/sdk_font.mk b/core/sdk_font.mk
index 0259a9c..1742925 100644
--- a/core/sdk_font.mk
+++ b/core/sdk_font.mk
@@ -19,9 +19,9 @@
# The font configuration files - system_fonts.xml, fallback_fonts.xml etc.
sdk_font_config := $(sort $(wildcard frameworks/base/data/fonts/*.xml))
-sdk_font_config := $(addprefix $(SDK_FONT_TEMP)/, $(notdir $(sdk_font_config)))
+sdk_font_config := $(addprefix $(SDK_FONT_TEMP)/standard/, $(notdir $(sdk_font_config)))
-$(sdk_font_config): $(SDK_FONT_TEMP)/%.xml: \
+$(sdk_font_config): $(SDK_FONT_TEMP)/standard/%.xml: \
frameworks/base/data/fonts/%.xml
$(hide) mkdir -p $(dir $@)
$(hide) cp -vf $< $@
diff --git a/core/soong_app_prebuilt.mk b/core/soong_app_prebuilt.mk
index ebb22c5..0a5ba9d 100644
--- a/core/soong_app_prebuilt.mk
+++ b/core/soong_app_prebuilt.mk
@@ -139,6 +139,9 @@
my_2nd_arch_prefix :=
PACKAGES := $(PACKAGES) $(LOCAL_MODULE)
+ifndef LOCAL_CERTIFICATE
+ $(call pretty-error,LOCAL_CERTIFICATE must be set for soong_app_prebuilt.mk)
+endif
ifeq ($(LOCAL_CERTIFICATE),PRESIGNED)
# The magic string "PRESIGNED" means this package is already checked
# signed with its release key.
diff --git a/core/soong_config.mk b/core/soong_config.mk
index 95ff5ef..f31c9a0 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -101,8 +101,6 @@
$(call add_json_bool, EnableCFI, $(call invert_bool,$(filter false,$(ENABLE_CFI))))
$(call add_json_list, CFIExcludePaths, $(CFI_EXCLUDE_PATHS) $(PRODUCT_CFI_EXCLUDE_PATHS))
$(call add_json_list, CFIIncludePaths, $(CFI_INCLUDE_PATHS) $(PRODUCT_CFI_INCLUDE_PATHS))
-$(call add_json_bool, EnableXOM, $(call invert_bool,$(filter false,$(ENABLE_XOM))))
-$(call add_json_list, XOMExcludePaths, $(XOM_EXCLUDE_PATHS) $(PRODUCT_XOM_EXCLUDE_PATHS))
$(call add_json_list, IntegerOverflowExcludePaths, $(INTEGER_OVERFLOW_EXCLUDE_PATHS) $(PRODUCT_INTEGER_OVERFLOW_EXCLUDE_PATHS))
$(call add_json_bool, Experimental_mte, $(filter true,$(TARGET_EXPERIMENTAL_MTE)))
@@ -112,7 +110,8 @@
$(call add_json_bool, ClangTidy, $(filter 1 true,$(WITH_TIDY)))
$(call add_json_str, TidyChecks, $(WITH_TIDY_CHECKS))
-$(call add_json_bool, NativeCoverage, $(filter true,$(NATIVE_COVERAGE)))
+$(call add_json_bool, NativeLineCoverage, $(filter true,$(NATIVE_LINE_COVERAGE)))
+$(call add_json_bool, Native_coverage, $(filter true,$(NATIVE_COVERAGE)))
$(call add_json_bool, ClangCoverage, $(filter true,$(CLANG_COVERAGE)))
$(call add_json_list, CoveragePaths, $(COVERAGE_PATHS))
$(call add_json_list, CoverageExcludePaths, $(COVERAGE_EXCLUDE_PATHS))
@@ -137,6 +136,7 @@
$(call add_json_list, ModulesLoadedByPrivilegedModules, $(PRODUCT_LOADED_BY_PRIVILEGED_MODULES))
$(call add_json_list, BootJars, $(PRODUCT_BOOT_JARS))
+$(call add_json_list, UpdatableBootJars, $(PRODUCT_UPDATABLE_BOOT_JARS))
$(call add_json_bool, VndkUseCoreVariant, $(TARGET_VNDK_USE_CORE_VARIANT))
$(call add_json_bool, VndkSnapshotBuildArtifacts, $(VNDK_SNAPSHOT_BUILD_ARTIFACTS))
diff --git a/core/tasks/boot_jars_package_check.mk b/core/tasks/boot_jars_package_check.mk
index ceaff54..05243e5 100644
--- a/core/tasks/boot_jars_package_check.mk
+++ b/core/tasks/boot_jars_package_check.mk
@@ -32,11 +32,7 @@
#TODO(jiyong) merge art_boot_jars into updatable_boot_jars
art_boot_jars := $(addsuffix .com.android.art.release,$(filter $(ART_APEX_JARS),$(PRODUCT_BOOT_JARS)))
-platform_boot_jars := $(filter-out \
- $(ART_APEX_JARS)\
- $(foreach pair,$(PRODUCT_UPDATABLE_BOOT_JARS),$(call word-colon,2,$(pair))),\
- $(PRODUCT_BOOT_JARS)\
-)
+platform_boot_jars := $(filter-out $(ART_APEX_JARS),$(PRODUCT_BOOT_JARS))
built_boot_jars := $(foreach j, $(updatable_boot_jars) $(art_boot_jars) $(platform_boot_jars), \
$(call intermediates-dir-for, JAVA_LIBRARIES, $(j),,COMMON)/classes.jar)
diff --git a/core/tasks/tools/package-modules.mk b/core/tasks/tools/package-modules.mk
index 55a08f5..7c4266c 100644
--- a/core/tasks/tools/package-modules.mk
+++ b/core/tasks/tools/package-modules.mk
@@ -41,7 +41,7 @@
ifeq ($(ALLOW_MISSING_DEPENDENCIES),true)
# Ignore unknown installed files on partial builds
my_missing_files =
-else ifeq ($(my_modules_strict),true)
+else ifneq ($(my_modules_strict),false)
my_missing_files = $(shell $(call echo-error,$(my_makefile),$(my_package_name): Unknown installed file for module '$(1)'))$(eval my_missing_error := true)
endif
diff --git a/core/tasks/vendor_snapshot.mk b/core/tasks/vendor_snapshot.mk
new file mode 100644
index 0000000..8234e3f
--- /dev/null
+++ b/core/tasks/vendor_snapshot.mk
@@ -0,0 +1,34 @@
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+current_makefile := $(lastword $(MAKEFILE_LIST))
+
+# BOARD_VNDK_VERSION must be set to 'current' in order to generate a vendor snapshot.
+ifeq ($(BOARD_VNDK_VERSION),current)
+
+.PHONY: vendor-snapshot
+vendor-snapshot: $(SOONG_VENDOR_SNAPSHOT_ZIP)
+
+$(call dist-for-goals, vendor-snapshot, $(SOONG_VENDOR_SNAPSHOT_ZIP))
+
+else # BOARD_VNDK_VERSION is NOT set to 'current'
+
+.PHONY: vendor-snapshot
+vendor-snapshot: PRIVATE_MAKEFILE := $(current_makefile)
+vendor-snapshot:
+ $(call echo-error,$(PRIVATE_MAKEFILE),\
+ "CANNOT generate Vendor snapshot. BOARD_VNDK_VERSION must be set to 'current'.")
+ exit 1
+
+endif # BOARD_VNDK_VERSION
diff --git a/core/tasks/vndk.mk b/core/tasks/vndk.mk
index dccb5f6..a2973b4 100644
--- a/core/tasks/vndk.mk
+++ b/core/tasks/vndk.mk
@@ -43,8 +43,9 @@
ifneq (,$(error_msg))
.PHONY: vndk
+vndk: PRIVATE_MAKEFILE := $(current_makefile)
vndk:
- $(call echo-error,$(current_makefile),$(error_msg))
+ $(call echo-error,$(PRIVATE_MAKEFILE),$(error_msg))
exit 1
endif
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index ab7783f..ed88551 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -84,38 +84,17 @@
# generate the range of allowed SDK versions, so it must have an entry for every
# unreleased API level targetable by this branch, not just those that are valid
# lunch targets for this branch.
-PLATFORM_VERSION.RP1A := R
+
+# The last stable version name of the platform that was released. During
+# development, this stays at that previous version, while the codename indicates
+# further work based on the previous version.
+PLATFORM_VERSION_LAST_STABLE := 10
+.KATI_READONLY := PLATFORM_VERSION_LAST_STABLE
# These are the current development codenames, if the build is not a final
# release build. If this is a final release build, it is simply "REL".
PLATFORM_VERSION_CODENAME.RP1A := R
-ifndef PLATFORM_VERSION
- PLATFORM_VERSION := $(PLATFORM_VERSION.$(TARGET_PLATFORM_VERSION))
- ifndef PLATFORM_VERSION
- # PLATFORM_VERSION falls back to TARGET_PLATFORM_VERSION
- PLATFORM_VERSION := $(TARGET_PLATFORM_VERSION)
- endif
-endif
-.KATI_READONLY := PLATFORM_VERSION
-
-ifndef PLATFORM_SDK_VERSION
- # This is the canonical definition of the SDK version, which defines
- # the set of APIs and functionality available in the platform. It
- # is a single integer that increases monotonically as updates to
- # the SDK are released. It should only be incremented when the APIs for
- # the new release are frozen (so that developers don't write apps against
- # intermediate builds). During development, this number remains at the
- # SDK version the branch is based on and PLATFORM_VERSION_CODENAME holds
- # the code-name of the new development work.
-
- # When you increment the PLATFORM_SDK_VERSION please ensure you also
- # clear out the following text file of all older PLATFORM_VERSION's:
- # cts/tests/tests/os/assets/platform_versions.txt
- PLATFORM_SDK_VERSION := 29
-endif
-.KATI_READONLY := PLATFORM_SDK_VERSION
-
ifndef PLATFORM_VERSION_CODENAME
PLATFORM_VERSION_CODENAME := $(PLATFORM_VERSION_CODENAME.$(TARGET_PLATFORM_VERSION))
ifndef PLATFORM_VERSION_CODENAME
@@ -165,6 +144,32 @@
PLATFORM_VERSION_ALL_CODENAMES \
PLATFORM_VERSION_FUTURE_CODENAMES
+ifndef PLATFORM_VERSION
+ ifeq (REL,$(PLATFORM_VERSION_CODENAME))
+ PLATFORM_VERSION := $(PLATFORM_VERSION_LAST_STABLE)
+ else
+ PLATFORM_VERSION := $(PLATFORM_VERSION_CODENAME)
+ endif
+endif
+.KATI_READONLY := PLATFORM_VERSION
+
+ifndef PLATFORM_SDK_VERSION
+ # This is the canonical definition of the SDK version, which defines
+ # the set of APIs and functionality available in the platform. It
+ # is a single integer that increases monotonically as updates to
+ # the SDK are released. It should only be incremented when the APIs for
+ # the new release are frozen (so that developers don't write apps against
+ # intermediate builds). During development, this number remains at the
+ # SDK version the branch is based on and PLATFORM_VERSION_CODENAME holds
+ # the code-name of the new development work.
+
+ # When you increment the PLATFORM_SDK_VERSION please ensure you also
+ # clear out the following text file of all older PLATFORM_VERSION's:
+ # cts/tests/tests/os/assets/platform_versions.txt
+ PLATFORM_SDK_VERSION := 29
+endif
+.KATI_READONLY := PLATFORM_SDK_VERSION
+
ifeq (REL,$(PLATFORM_VERSION_CODENAME))
PLATFORM_PREVIEW_SDK_VERSION := 0
else
@@ -250,7 +255,7 @@
# It must be of the form "YYYY-MM-DD" on production devices.
# It must match one of the Android Security Patch Level strings of the Public Security Bulletins.
# If there is no $PLATFORM_SECURITY_PATCH set, keep it empty.
- PLATFORM_SECURITY_PATCH := 2020-03-05
+ PLATFORM_SECURITY_PATCH := 2020-04-05
endif
.KATI_READONLY := PLATFORM_SECURITY_PATCH
diff --git a/envsetup.sh b/envsetup.sh
index 389fbb7..793f4b6 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -254,6 +254,9 @@
local ANDROID_LLVM_BINUTILS=$(get_abs_build_var ANDROID_CLANG_PREBUILTS)/llvm-binutils-stable
ANDROID_BUILD_PATHS=$ANDROID_BUILD_PATHS:$ANDROID_LLVM_BINUTILS
+ # Set up ASAN_SYMBOLIZER_PATH for SANITIZE_HOST=address builds.
+ export ASAN_SYMBOLIZER_PATH=$ANDROID_LLVM_BINUTILS/llvm-symbolizer
+
# If prebuilts/android-emulator/<system>/ exists, prepend it to our PATH
# to ensure that the corresponding 'emulator' binaries are used.
case $(uname -s) in
diff --git a/target/board/BoardConfigMainlineCommon.mk b/target/board/BoardConfigMainlineCommon.mk
index 52ba814..c57968e 100644
--- a/target/board/BoardConfigMainlineCommon.mk
+++ b/target/board/BoardConfigMainlineCommon.mk
@@ -46,6 +46,3 @@
# Include stats logging code in LMKD
TARGET_LMKD_STATS_LOG := true
-
-# Generate an APEX image for experiment b/119800099.
-DEXPREOPT_GENERATE_APEX_IMAGE := true
diff --git a/target/board/generic_arm64_ab/BoardConfig.mk b/target/board/generic_arm64_ab/BoardConfig.mk
new file mode 100644
index 0000000..7c91607
--- /dev/null
+++ b/target/board/generic_arm64_ab/BoardConfig.mk
@@ -0,0 +1,39 @@
+#
+# Copyright (C) 2017 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include build/make/target/board/BoardConfigGsiCommon.mk
+
+TARGET_ARCH := arm64
+TARGET_ARCH_VARIANT := armv8-a
+TARGET_CPU_ABI := arm64-v8a
+TARGET_CPU_ABI2 :=
+TARGET_CPU_VARIANT := generic
+
+TARGET_2ND_ARCH := arm
+TARGET_2ND_ARCH_VARIANT := armv8-a
+TARGET_2ND_CPU_ABI := armeabi-v7a
+TARGET_2ND_CPU_ABI2 := armeabi
+TARGET_2ND_CPU_VARIANT := generic
+
+# TODO(jiyong) These might be SoC specific.
+BOARD_ROOT_EXTRA_FOLDERS += firmware firmware/radio persist
+BOARD_ROOT_EXTRA_SYMLINKS += /vendor/lib/dsp:/dsp
+BOARD_ROOT_EXTRA_SYMLINKS += /vendor/firmware_mnt/image:/firmware/image
+BOARD_ROOT_EXTRA_SYMLINKS += /vendor/firmware_mnt/verinfo:/firmware/verinfo
+
+# TODO(b/36764215): remove this setting when the generic system image
+# no longer has QCOM-specific directories under /.
+BOARD_SEPOLICY_DIRS += build/make/target/board/generic_arm64/sepolicy
diff --git a/target/board/generic_arm_ab/BoardConfig.mk b/target/board/generic_arm_ab/BoardConfig.mk
new file mode 100644
index 0000000..21b763c
--- /dev/null
+++ b/target/board/generic_arm_ab/BoardConfig.mk
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2017 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include build/make/target/board/BoardConfigGsiCommon.mk
+
+TARGET_ARCH := arm
+TARGET_ARCH_VARIANT := armv7-a-neon
+TARGET_CPU_ABI := armeabi-v7a
+TARGET_CPU_ABI2 := armeabi
+TARGET_CPU_VARIANT := generic
+
+# Legacy GSI keeps 32 bits binder for 32 bits CPU Arch
+TARGET_USES_64_BIT_BINDER := false
+
+# TODO(jiyong) These might be SoC specific.
+BOARD_ROOT_EXTRA_FOLDERS += firmware firmware/radio persist
+BOARD_ROOT_EXTRA_SYMLINKS += /vendor/lib/dsp:/dsp
+BOARD_ROOT_EXTRA_SYMLINKS += /vendor/firmware_mnt/image:/firmware/image
+BOARD_ROOT_EXTRA_SYMLINKS += /vendor/firmware_mnt/verinfo:/firmware/verinfo
+
+# TODO(b/36764215): remove this setting when the generic system image
+# no longer has QCOM-specific directories under /.
+BOARD_SEPOLICY_DIRS += build/make/target/board/generic_arm64/sepolicy
diff --git a/target/board/generic_x86_64_ab/BoardConfig.mk b/target/board/generic_x86_64_ab/BoardConfig.mk
new file mode 100644
index 0000000..1dd5e48
--- /dev/null
+++ b/target/board/generic_x86_64_ab/BoardConfig.mk
@@ -0,0 +1,25 @@
+#
+# Copyright (C) 2017 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include build/make/target/board/BoardConfigGsiCommon.mk
+
+TARGET_CPU_ABI := x86_64
+TARGET_ARCH := x86_64
+TARGET_ARCH_VARIANT := x86_64
+
+TARGET_2ND_CPU_ABI := x86
+TARGET_2ND_ARCH := x86
+TARGET_2ND_ARCH_VARIANT := x86_64
diff --git a/target/board/generic_x86_ab/BoardConfig.mk b/target/board/generic_x86_ab/BoardConfig.mk
new file mode 100644
index 0000000..53acffd
--- /dev/null
+++ b/target/board/generic_x86_ab/BoardConfig.mk
@@ -0,0 +1,24 @@
+#
+# Copyright (C) 2017 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include build/make/target/board/BoardConfigGsiCommon.mk
+
+TARGET_CPU_ABI := x86
+TARGET_ARCH := x86
+TARGET_ARCH_VARIANT := x86
+
+# Legacy GSI keeps 32 bits binder for 32 bits CPU Arch
+TARGET_USES_64_BIT_BINDER := false
diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk
index 5ecaf26..4121bc1 100644
--- a/target/product/AndroidProducts.mk
+++ b/target/product/AndroidProducts.mk
@@ -43,9 +43,13 @@
else
PRODUCT_MAKEFILES := \
+ $(LOCAL_DIR)/aosp_arm64_ab.mk \
$(LOCAL_DIR)/aosp_arm64.mk \
+ $(LOCAL_DIR)/aosp_arm_ab.mk \
$(LOCAL_DIR)/aosp_arm.mk \
+ $(LOCAL_DIR)/aosp_x86_64_ab.mk \
$(LOCAL_DIR)/aosp_x86_64.mk \
+ $(LOCAL_DIR)/aosp_x86_ab.mk \
$(LOCAL_DIR)/aosp_x86_arm.mk \
$(LOCAL_DIR)/aosp_x86.mk \
$(LOCAL_DIR)/full.mk \
diff --git a/target/product/aosp_arm64_ab.mk b/target/product/aosp_arm64_ab.mk
new file mode 100644
index 0000000..75b9cc4
--- /dev/null
+++ b/target/product/aosp_arm64_ab.mk
@@ -0,0 +1,58 @@
+#
+# Copyright (C) 2017 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
+# /vendor/[build|default].prop when build split is on. In order to have sysprops
+# on the generic system image, place them in build/make/target/board/
+# gsi_system.prop.
+
+# aosp_arm64_ab-userdebug is a Legacy GSI for the devices with:
+# - ARM 64 bits user space
+# - 64 bits binder interface
+# - system-as-root
+
+#
+# All components inherited here go to system image
+# (The system image of Legacy GSI is not CSI)
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk)
+
+# Enable mainline checking for excat this product name
+ifeq (aosp_arm64_ab,$(TARGET_PRODUCT))
+PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed
+endif
+
+#
+# All components inherited here go to system_ext image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system_ext.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system_ext.mk)
+
+#
+# All components inherited here go to product image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk)
+
+#
+# Special settings for GSI releasing
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_release.mk)
+
+PRODUCT_NAME := aosp_arm64_ab
+PRODUCT_DEVICE := generic_arm64_ab
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP on ARM64
diff --git a/target/product/aosp_arm_ab.mk b/target/product/aosp_arm_ab.mk
new file mode 100644
index 0000000..80ebdb1
--- /dev/null
+++ b/target/product/aosp_arm_ab.mk
@@ -0,0 +1,57 @@
+#
+# Copyright (C) 2017 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
+# /vendor/[build|default].prop when build split is on. In order to have sysprops
+# on the generic system image, place them in build/make/target/board/
+# gsi_system.prop.
+
+# aosp_arm_ab-userdebug is a Legacy GSI for the devices with:
+# - ARM 32 bits user space
+# - 32 bits binder interface
+# - system-as-root
+
+#
+# All components inherited here go to system image
+# (The system image of Legacy GSI is not CSI)
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk)
+
+# Enable mainline checking for excat this product name
+ifeq (aosp_arm_ab,$(TARGET_PRODUCT))
+PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed
+endif
+
+#
+# All components inherited here go to system_ext image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system_ext.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system_ext.mk)
+
+#
+# All components inherited here go to product image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk)
+
+#
+# Special settings for GSI releasing
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_release.mk)
+
+PRODUCT_NAME := aosp_arm_ab
+PRODUCT_DEVICE := generic_arm_ab
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP on ARM32
diff --git a/target/product/aosp_product.mk b/target/product/aosp_product.mk
index d36f493..e3819e6 100644
--- a/target/product/aosp_product.mk
+++ b/target/product/aosp_product.mk
@@ -32,7 +32,6 @@
messaging \
PhotoTable \
preinstalled-packages-platform-aosp-product.xml \
- WAPPushManager \
WallpaperPicker \
# Telephony:
diff --git a/target/product/aosp_x86_64_ab.mk b/target/product/aosp_x86_64_ab.mk
new file mode 100644
index 0000000..9d23fc7
--- /dev/null
+++ b/target/product/aosp_x86_64_ab.mk
@@ -0,0 +1,58 @@
+#
+# Copyright (C) 2017 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
+# /vendor/[build|default].prop when build split is on. In order to have sysprops
+# on the generic system image, place them in build/make/target/board/
+# gsi_system.prop.
+
+# aosp_x86_64_ab-userdebug is a Legacy GSI for the devices with:
+# - x86 64 bits user space
+# - 64 bits binder interface
+# - system-as-root
+
+#
+# All components inherited here go to system image
+# (The system image of Legacy GSI is not CSI)
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk)
+
+# Enable mainline checking for excat this product name
+ifeq (aosp_x86_64_ab,$(TARGET_PRODUCT))
+PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed
+endif
+
+#
+# All components inherited here go to system_ext image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system_ext.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system_ext.mk)
+
+#
+# All components inherited here go to product image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk)
+
+#
+# Special settings for GSI releasing
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_release.mk)
+
+PRODUCT_NAME := aosp_x86_64_ab
+PRODUCT_DEVICE := generic_x86_64_ab
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP on x86_64
diff --git a/target/product/aosp_x86_ab.mk b/target/product/aosp_x86_ab.mk
new file mode 100644
index 0000000..6b6a4c6
--- /dev/null
+++ b/target/product/aosp_x86_ab.mk
@@ -0,0 +1,58 @@
+#
+# Copyright (C) 2017 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
+# /vendor/[build|default].prop when build split is on. In order to have sysprops
+# on the generic system image, place them in build/make/target/board/
+# gsi_system.prop.
+
+# aosp_x86_ab-userdebug is a Legacy GSI for the devices with:
+# - x86 32 bits user space
+# - 32 bits binder interface
+# - system-as-root
+
+#
+# All components inherited here go to system image
+# (The system image of Legacy GSI is not CSI)
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk)
+
+# Enable mainline checking for excat this product name
+ifeq (aosp_x86_ab,$(TARGET_PRODUCT))
+PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed
+endif
+
+#
+# All components inherited here go to system_ext image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system_ext.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system_ext.mk)
+
+#
+# All components inherited here go to product image
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk)
+
+#
+# Special settings for GSI releasing
+#
+$(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_release.mk)
+
+PRODUCT_NAME := aosp_x86_ab
+PRODUCT_DEVICE := generic_x86_ab
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP on x86
diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index bb95996..04808ae 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -66,7 +66,6 @@
com.android.neuralnetworks \
com.android.os.statsd \
com.android.sdkext \
- com.android.telephony \
com.android.tethering \
com.android.tzdata \
com.android.wifi \
@@ -141,6 +140,7 @@
libdrmframework_jni \
libEGL \
libETC1 \
+ libfdtrack \
libFFTEm \
libfilterfw \
libgatekeeper \
@@ -323,21 +323,12 @@
# The order matters for runtime class lookup performance.
PRODUCT_BOOT_JARS := \
- $(TARGET_CORE_JARS) \
+ $(ART_APEX_JARS) \
framework-minus-apex \
ext \
telephony-common \
voip-common \
ims-common \
- framework-sdkextensions \
- framework-statsd \
- ike \
- updatable-media \
- framework-mediaprovider \
- framework-permission \
- framework-appsearch \
- framework-wifi \
- framework-tethering \
framework-telephony
PRODUCT_UPDATABLE_BOOT_JARS := \
diff --git a/target/product/base_vendor.mk b/target/product/base_vendor.mk
index a0c2dde..471340b 100644
--- a/target/product/base_vendor.mk
+++ b/target/product/base_vendor.mk
@@ -41,7 +41,6 @@
# Base modules and settings for the vendor partition.
PRODUCT_PACKAGES += \
android.hardware.cas@1.2-service \
- android.hardware.configstore@1.1-service \
android.hardware.media.omx@1.0-service \
boringssl_self_test_vendor \
dumpsys_vendor \
@@ -68,6 +67,10 @@
selinux_policy_nonsystem \
shell_and_utilities_vendor \
vndservice \
+
+# Base module when shipping api level is less than or equal to 29
+PRODUCT_PACKAGES_SHIPPING_API_LEVEL_29 += \
+ android.hardware.configstore@1.1-service \
vndservicemanager \
# VINTF data for vendor image
diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk
index 4f2027f..cf0d5c7 100644
--- a/target/product/gsi/Android.mk
+++ b/target/product/gsi/Android.mk
@@ -163,6 +163,7 @@
vndkcorevariant.libraries.txt \
$(addsuffix .vendor,$(VNDK_CORE_LIBRARIES)) \
$(addsuffix .vendor,$(VNDK_SAMEPROCESS_LIBRARIES)) \
+ $(VNDK_USING_CORE_VARIANT_LIBRARIES) \
com.android.vndk.current
endif
include $(BUILD_PHONY_PACKAGE)
@@ -175,18 +176,24 @@
_binder32 := _binder32
endif
endif
+_vndk_versions := $(PRODUCT_EXTRA_VNDK_VERSIONS)
+ifneq ($(BOARD_VNDK_VERSION),current)
+ _vndk_versions += $(BOARD_VNDK_VERSION)
+endif
# Phony targets are installed for **.libraries.txt files.
# TODO(b/141450808): remove following VNDK phony targets when **.libraries.txt files are provided by apexes.
LOCAL_REQUIRED_MODULES := \
- $(foreach vndk_ver,$(PRODUCT_EXTRA_VNDK_VERSIONS),vndk_v$(vndk_ver)_$(TARGET_ARCH)$(_binder32))
+ $(foreach vndk_ver,$(_vndk_versions),vndk_v$(vndk_ver)_$(TARGET_ARCH)$(_binder32))
_binder32 :=
include $(BUILD_PHONY_PACKAGE)
include $(CLEAR_VARS)
LOCAL_MODULE := vndk_apex_snapshot_package
-LOCAL_REQUIRED_MODULES := $(foreach vndk_ver,$(PRODUCT_EXTRA_VNDK_VERSIONS),com.android.vndk.v$(vndk_ver))
+LOCAL_REQUIRED_MODULES := $(foreach vndk_ver,$(_vndk_versions),com.android.vndk.v$(vndk_ver))
include $(BUILD_PHONY_PACKAGE)
+_vndk_versions :=
+
endif # BOARD_VNDK_VERSION is set
#####################################################################
diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt
index 30ed816..ad9239f 100644
--- a/target/product/gsi/current.txt
+++ b/target/product/gsi/current.txt
@@ -37,7 +37,6 @@
VNDK-SP: libbacktrace.so
VNDK-SP: libbase.so
VNDK-SP: libbcinfo.so
-VNDK-SP: libbinderthreadstate.so
VNDK-SP: libblas.so
VNDK-SP: libc++.so
VNDK-SP: libcompiler_rt.so
@@ -58,6 +57,7 @@
VNDK-core: android.frameworks.cameraservice.common@2.0.so
VNDK-core: android.frameworks.cameraservice.device@2.0.so
VNDK-core: android.frameworks.cameraservice.service@2.0.so
+VNDK-core: android.frameworks.cameraservice.service@2.1.so
VNDK-core: android.frameworks.displayservice@1.0.so
VNDK-core: android.frameworks.schedulerservice@1.0.so
VNDK-core: android.frameworks.sensorservice@1.0.so
@@ -120,6 +120,7 @@
VNDK-core: android.hardware.confirmationui-support-lib.so
VNDK-core: android.hardware.confirmationui@1.0.so
VNDK-core: android.hardware.contexthub@1.0.so
+VNDK-core: android.hardware.contexthub@1.1.so
VNDK-core: android.hardware.drm@1.0.so
VNDK-core: android.hardware.drm@1.1.so
VNDK-core: android.hardware.drm@1.2.so
@@ -247,6 +248,7 @@
VNDK-core: libaudioroute.so
VNDK-core: libaudioutils.so
VNDK-core: libbinder.so
+VNDK-core: libbufferqueueconverter.so
VNDK-core: libcamera_metadata.so
VNDK-core: libcap.so
VNDK-core: libcn-cbor.so
@@ -301,7 +303,6 @@
VNDK-core: libyuv.so
VNDK-core: libziparchive.so
VNDK-private: libbacktrace.so
-VNDK-private: libbinderthreadstate.so
VNDK-private: libblas.so
VNDK-private: libcompiler_rt.so
VNDK-private: libft2.so
diff --git a/target/product/handheld_product.mk b/target/product/handheld_product.mk
index cac2a55..2199c57 100644
--- a/target/product/handheld_product.mk
+++ b/target/product/handheld_product.mk
@@ -29,17 +29,11 @@
DeskClock \
Gallery2 \
LatinIME \
- Launcher3QuickStep \
Music \
OneTimeInitializer \
preinstalled-packages-platform-handheld-product.xml \
- Provision \
QuickSearchBox \
- Settings \
SettingsIntelligence \
- StorageManager \
- SystemUI \
- WallpaperCropper \
frameworks-base-overlays
PRODUCT_PACKAGES_DEBUG += \
diff --git a/target/product/handheld_system_ext.mk b/target/product/handheld_system_ext.mk
index bda4be6..d935fbf 100644
--- a/target/product/handheld_system_ext.mk
+++ b/target/product/handheld_system_ext.mk
@@ -22,3 +22,9 @@
# /system_ext packages
PRODUCT_PACKAGES += \
+ Launcher3QuickStep \
+ Provision \
+ Settings \
+ StorageManager \
+ SystemUI \
+ WallpaperCropper \
diff --git a/target/product/legacy_gsi_release.mk b/target/product/legacy_gsi_release.mk
new file mode 100644
index 0000000..f072481
--- /dev/null
+++ b/target/product/legacy_gsi_release.mk
@@ -0,0 +1,37 @@
+#
+# Copyright (C) 2020 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include $(SRC_TARGET_DIR)/product/gsi_release.mk
+
+PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \
+ system/etc/init/init.legacy-gsi.rc \
+ system/etc/init/gsi/init.vndk-27.rc \
+ system/etc/ld.config.vndk_lite.txt \
+
+# Legacy GSI support additional O-MR1 interface
+PRODUCT_EXTRA_VNDK_VERSIONS += 27
+
+# Support for the O-MR1 devices
+PRODUCT_COPY_FILES += \
+ build/make/target/product/gsi/init.legacy-gsi.rc:system/etc/init/init.legacy-gsi.rc \
+ build/make/target/product/gsi/init.vndk-27.rc:system/etc/init/gsi/init.vndk-27.rc
+
+# Namespace configuration file for non-enforcing VNDK
+PRODUCT_PACKAGES += \
+ ld.config.vndk_lite.txt
+
+# Legacy GSI relax the compatible property checking
+PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := false
diff --git a/target/product/mainline_system.mk b/target/product/mainline_system.mk
index b1fe40a..f8d85bf 100644
--- a/target/product/mainline_system.mk
+++ b/target/product/mainline_system.mk
@@ -24,9 +24,6 @@
# Enable updating of APEXes
$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
-# Mainline devices support userspace reboot
-$(call inherit-product, $(SRC_TARGET_DIR)/product/userspace_reboot.mk)
-
# Shared java libs
PRODUCT_PACKAGES += \
com.android.nfc_extras \
diff --git a/target/product/telephony_product.mk b/target/product/telephony_product.mk
index a4c7e31..3ec954f 100644
--- a/target/product/telephony_product.mk
+++ b/target/product/telephony_product.mk
@@ -19,6 +19,4 @@
# /product packages
PRODUCT_PACKAGES += \
- CarrierConfig \
Dialer \
- EmergencyInfo \
diff --git a/target/product/telephony_system_ext.mk b/target/product/telephony_system_ext.mk
index 1b9ee98..f81a607 100644
--- a/target/product/telephony_system_ext.mk
+++ b/target/product/telephony_system_ext.mk
@@ -19,3 +19,5 @@
# /system_ext packages
PRODUCT_PACKAGES += \
+ CarrierConfig \
+ EmergencyInfo \
diff --git a/target/product/virtual_ab_ota.mk b/target/product/virtual_ab_ota.mk
index 5c398b4..1774de4 100644
--- a/target/product/virtual_ab_ota.mk
+++ b/target/product/virtual_ab_ota.mk
@@ -16,6 +16,6 @@
PRODUCT_VIRTUAL_AB_OTA := true
-PRODUCT_PRODUCT_PROPERTIES += ro.virtual_ab.enabled=true
+PRODUCT_PROPERTY_OVERRIDES += ro.virtual_ab.enabled=true
PRODUCT_PACKAGES += e2fsck_ramdisk
diff --git a/target/product/virtual_ab_ota_retrofit.mk b/target/product/virtual_ab_ota_retrofit.mk
index b492fad..3e85741 100644
--- a/target/product/virtual_ab_ota_retrofit.mk
+++ b/target/product/virtual_ab_ota_retrofit.mk
@@ -18,4 +18,4 @@
PRODUCT_VIRTUAL_AB_OTA_RETROFIT := true
-PRODUCT_PRODUCT_PROPERTIES += ro.virtual_ab.retrofit=true
+PRODUCT_PROPERTY_OVERRIDES += ro.virtual_ab.retrofit=true
diff --git a/tools/buildinfo.sh b/tools/buildinfo.sh
index 09d8f70..9bee115 100755
--- a/tools/buildinfo.sh
+++ b/tools/buildinfo.sh
@@ -11,7 +11,8 @@
echo "ro.build.version.preview_sdk_fingerprint=$PLATFORM_PREVIEW_SDK_FINGERPRINT"
echo "ro.build.version.codename=$PLATFORM_VERSION_CODENAME"
echo "ro.build.version.all_codenames=$PLATFORM_VERSION_ALL_CODENAMES"
-echo "ro.build.version.release=$PLATFORM_VERSION"
+echo "ro.build.version.release=$PLATFORM_VERSION_LAST_STABLE"
+echo "ro.build.version.release_or_codename=$PLATFORM_VERSION"
echo "ro.build.version.security_patch=$PLATFORM_SECURITY_PATCH"
echo "ro.build.version.base_os=$PLATFORM_BASE_OS"
echo "ro.build.version.min_supported_target_sdk=$PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION"
diff --git a/tools/buildinfo_common.sh b/tools/buildinfo_common.sh
index 6041d79..673e06f 100755
--- a/tools/buildinfo_common.sh
+++ b/tools/buildinfo_common.sh
@@ -17,7 +17,8 @@
echo "ro.${partition}.build.tags=$BUILD_VERSION_TAGS"
echo "ro.${partition}.build.type=$TARGET_BUILD_TYPE"
echo "ro.${partition}.build.version.incremental=$BUILD_NUMBER"
-echo "ro.${partition}.build.version.release=$PLATFORM_VERSION"
+echo "ro.${partition}.build.version.release=$PLATFORM_VERSION_LAST_STABLE"
+echo "ro.${partition}.build.version.release_or_codename=$PLATFORM_VERSION"
echo "ro.${partition}.build.version.sdk=$PLATFORM_SDK_VERSION"
echo "ro.product.${partition}.brand=$PRODUCT_BRAND"
diff --git a/tools/fs_config/Android.bp b/tools/fs_config/Android.bp
index 8c69417..1dd5e4a 100644
--- a/tools/fs_config/Android.bp
+++ b/tools/fs_config/Android.bp
@@ -52,6 +52,7 @@
cc_library_headers {
name: "oemaids_headers",
+ vendor_available: true,
generated_headers: ["oemaids_header_gen"],
export_generated_headers: ["oemaids_header_gen"],
}
diff --git a/tools/releasetools/apex_utils.py b/tools/releasetools/apex_utils.py
index 113f78b..4fac6f3 100644
--- a/tools/releasetools/apex_utils.py
+++ b/tools/releasetools/apex_utils.py
@@ -50,7 +50,8 @@
self.key_passwords = key_passwords
self.codename_to_api_level_map = codename_to_api_level_map
- def ProcessApexFile(self, apk_keys, payload_key, payload_public_key):
+ def ProcessApexFile(self, apk_keys, payload_key, payload_public_key,
+ signing_args=None):
"""Scans and signs the apk files and repack the apex
Args:
@@ -88,7 +89,8 @@
logger.info('No apk file has been signed in %s', self.apex_path)
return self.apex_path
- return self.RepackApexPayload(payload_dir, payload_key, payload_public_key)
+ return self.RepackApexPayload(payload_dir, payload_key, payload_public_key,
+ signing_args)
def ExtractApexPayloadAndSignApks(self, apk_entries, apk_keys):
"""Extracts the payload image and signs the containing apk files."""
@@ -116,7 +118,8 @@
has_signed_apk = True
return payload_dir, has_signed_apk
- def RepackApexPayload(self, payload_dir, payload_key, payload_public_key):
+ def RepackApexPayload(self, payload_dir, payload_key, payload_public_key,
+ signing_args=None):
"""Rebuilds the apex file with the updated payload directory."""
apex_dir = common.MakeTempDir()
# Extract the apex file and reuse its meta files as repack parameters.
@@ -133,7 +136,6 @@
arguments_dict = {
'manifest': os.path.join(apex_dir, 'apex_manifest.pb'),
'build_info': os.path.join(apex_dir, 'apex_build_info.pb'),
- 'assets_dir': os.path.join(apex_dir, 'assets'),
'android_jar_path': android_jar_path,
'key': payload_key,
'pubkey': payload_public_key,
@@ -154,14 +156,21 @@
'--do_not_check_keyname', '--apexer_tool_path',
os.getenv('PATH')]
for key, val in arguments_dict.items():
- repack_cmd.append('--' + key)
- repack_cmd.append(val)
+ repack_cmd.extend(['--' + key, val])
+ # Add quote to the signing_args as we will pass
+ # --signing_args "--signing_helper_with_files=%path" to apexer
+ if signing_args:
+ repack_cmd.extend(['--signing_args', '"{}"'.format(signing_args)])
+ # optional arguments for apex repacking
manifest_json = os.path.join(apex_dir, 'apex_manifest.json')
if os.path.exists(manifest_json):
- repack_cmd.append('--manifest_json')
- repack_cmd.append(manifest_json)
- repack_cmd.append(payload_dir)
- repack_cmd.append(repacked_apex)
+ repack_cmd.extend(['--manifest_json', manifest_json])
+ assets_dir = os.path.join(apex_dir, 'assets')
+ if os.path.isdir(assets_dir):
+ repack_cmd.extend(['--assets_dir', assets_dir])
+ repack_cmd.extend([payload_dir, repacked_apex])
+ if OPTIONS.verbose:
+ repack_cmd.append('-v')
common.RunAndCheckOutput(repack_cmd)
return repacked_apex
@@ -311,7 +320,7 @@
apk_signer = ApexApkSigner(apex_file, container_pw,
codename_to_api_level_map)
apex_file = apk_signer.ProcessApexFile(apk_keys, payload_key,
- payload_public_key)
+ payload_public_key, signing_args)
# 2a. Extract and sign the APEX_PAYLOAD_IMAGE entry with the given
# payload_key.
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py
index e424b6f..ed9183e 100755
--- a/tools/releasetools/build_image.py
+++ b/tools/releasetools/build_image.py
@@ -287,7 +287,7 @@
build_command.extend(["-U", prop_dict["uuid"]])
if "hash_seed" in prop_dict:
build_command.extend(["-S", prop_dict["hash_seed"]])
- if "ext4_share_dup_blocks" in prop_dict:
+ if prop_dict.get("ext4_share_dup_blocks") == "true":
build_command.append("-c")
if (needs_projid):
build_command.extend(["--inode_size", "512"])
diff --git a/tools/releasetools/test_apex_utils.py b/tools/releasetools/test_apex_utils.py
index df61ac0..07284ad 100644
--- a/tools/releasetools/test_apex_utils.py
+++ b/tools/releasetools/test_apex_utils.py
@@ -16,6 +16,7 @@
import os
import os.path
+import zipfile
import apex_utils
import common
@@ -155,3 +156,40 @@
payload_pubkey = common.ExtractAvbPublicKey('avbtool',
self.payload_key)
signer.ProcessApexFile(apk_keys, self.payload_key, payload_pubkey)
+
+ @test_utils.SkipIfExternalToolsUnavailable()
+ def test_ApexApkSigner_noAssetDir(self):
+ apex_path = os.path.join(self.testdata_dir, 'has_apk.apex')
+ no_asset = common.MakeTempFile(suffix='.apex')
+ with zipfile.ZipFile(no_asset, 'w') as output_zip:
+ with zipfile.ZipFile(apex_path, 'r') as input_zip:
+ name_list = input_zip.namelist()
+ for name in name_list:
+ if not name.startswith('assets'):
+ output_zip.writestr(name, input_zip.read(name))
+
+ signer = apex_utils.ApexApkSigner(no_asset, None, None)
+ apk_keys = {'wifi-service-resources.apk': os.path.join(
+ self.testdata_dir, 'testkey')}
+
+ self.payload_key = os.path.join(self.testdata_dir, 'testkey_RSA4096.key')
+ payload_pubkey = common.ExtractAvbPublicKey('avbtool',
+ self.payload_key)
+ signer.ProcessApexFile(apk_keys, self.payload_key, payload_pubkey)
+
+ @test_utils.SkipIfExternalToolsUnavailable()
+ def test_ApexApkSigner_withSignerHelper(self):
+ apex_path = os.path.join(self.testdata_dir, 'has_apk.apex')
+ signer = apex_utils.ApexApkSigner(apex_path, None, None)
+ apk_keys = {'wifi-service-resources.apk': os.path.join(
+ self.testdata_dir, 'testkey')}
+
+ self.payload_key = os.path.join(self.testdata_dir, 'testkey_RSA4096.key')
+ payload_pubkey = common.ExtractAvbPublicKey('avbtool', self.payload_key)
+
+ signing_helper = os.path.join(self.testdata_dir, 'signing_helper.sh')
+ os.chmod(signing_helper, 0o700)
+ payload_signer_args = '--signing_helper_with_files={}'.format(
+ signing_helper)
+ signer.ProcessApexFile(apk_keys, self.payload_key, payload_pubkey,
+ payload_signer_args)
diff --git a/tools/releasetools/validate_target_files.py b/tools/releasetools/validate_target_files.py
index 9c2bc51..1b918cc 100755
--- a/tools/releasetools/validate_target_files.py
+++ b/tools/releasetools/validate_target_files.py
@@ -350,7 +350,7 @@
# vbmeta partitions (e.g. vbmeta_system).
image = os.path.join(input_tmp, 'IMAGES', 'vbmeta.img')
cmd = [info_dict['avb_avbtool'], 'verify_image', '--image', image,
- '--key', key, '--follow_chain_partitions']
+ '--follow_chain_partitions']
# Append the args for chained partitions if any.
for partition in common.AVB_PARTITIONS + common.AVB_VBMETA_PARTITIONS:
diff --git a/tools/warn/cpp_warn_patterns.py b/tools/warn/cpp_warn_patterns.py
index 0c458fb..65ce73a 100644
--- a/tools/warn/cpp_warn_patterns.py
+++ b/tools/warn/cpp_warn_patterns.py
@@ -435,6 +435,30 @@
[r".*: warning: template argument.+Wunnamed-type-template-args"]),
medium('Unannotated fall-through between switch labels',
[r".*: warning: unannotated fall-through between switch labels.+Wimplicit-fallthrough"]),
+ medium('Invalid partial specialization',
+ [r".*: warning: class template partial specialization.+Winvalid-partial-specialization"]),
+ medium('Overlapping compatisons',
+ [r".*: warning: overlapping comparisons.+Wtautological-overlap-compare"]),
+ medium('int in bool context',
+ [r".*: warning: converting.+to a boolean.+Wint-in-bool-context"]),
+ medium('bitwise conditional parentheses',
+ [r".*: warning: operator.+has lower precedence.+Wbitwise-conditional-parentheses"]),
+ medium('sizeof array div',
+ [r".*: warning: .+number of elements in.+array.+Wsizeof-array-div"]),
+ medium('bool operation',
+ [r".*: warning: .+boolean.+always.+Wbool-operation"]),
+ medium('Undefined bool conversion',
+ [r".*: warning: .+may be.+always.+true.+Wundefined-bool-conversion"]),
+ medium('Typedef requires a name',
+ [r".*: warning: typedef requires a name.+Wmissing-declaration"]),
+ medium('Unknown escape sequence',
+ [r".*: warning: unknown escape sequence.+Wunknown-escape-sequence"]),
+ medium('Unicode whitespace',
+ [r".*: warning: treating Unicode.+as whitespace.+Wunicode-whitespace"]),
+ medium('Unused local typedef',
+ [r".*: warning: unused typedef.+Wunused-local-typedef"]),
+ medium('varargs warnings',
+ [r".*: warning: .*argument to 'va_start'.+\[-Wvarargs\]"]),
harmless('Discarded qualifier from pointer target type',
[r".*: warning: .+ discards '.+' qualifier from pointer target type"]),
harmless('Use snprintf instead of sprintf',
diff --git a/tools/warn/java_warn_patterns.py b/tools/warn/java_warn_patterns.py
index 0a443d4..80e2e1d 100644
--- a/tools/warn/java_warn_patterns.py
+++ b/tools/warn/java_warn_patterns.py
@@ -38,8 +38,24 @@
return java_warn(Severity.MEDIUM, description, pattern_list)
-def java_low(description, pattern_list):
- return java_warn(Severity.LOW, description, pattern_list)
+def warn_with_name(name, severity, description=None):
+ if description is None:
+ description = name
+ return java_warn(severity, description,
+ [r'.*\.java:.*: warning: .+ \[' + name + r'\]$',
+ r'.*\.java:.*: warning: \[' + name + r'\] .+'])
+
+
+def high(name, description=None):
+ return warn_with_name(name, Severity.HIGH, description)
+
+
+def medium(name, description=None):
+ return warn_with_name(name, Severity.MEDIUM, description)
+
+
+def low(name, description=None):
+ return warn_with_name(name, Severity.LOW, description)
warn_patterns = [
@@ -48,8 +64,13 @@
java_medium('Use of deprecated',
[r'.*: warning: \[deprecation\] .+',
r'.*: warning: \[removal\] .+ has been deprecated and marked for removal$']),
- java_medium('Unchecked conversion',
- [r'.*: warning: \[unchecked\] .+']),
+ java_medium('Incompatible SDK implementation',
+ [r'.*\.java:.*: warning: @Implementation .+ has .+ not .+ as in the SDK ']),
+ medium('unchecked', 'Unchecked conversion'),
+ java_medium('No annotation method',
+ [r'.*\.class\): warning: Cannot find annotation method .+ in']),
+ java_medium('No class/method in SDK ...',
+ [r'.*\.java:.*: warning: No such (class|method) .* for SDK']),
# Warnings generated by Error Prone
java_medium('Non-ascii characters used, but ascii encoding specified',
[r".*: warning: unmappable character for encoding ascii"]),
@@ -65,682 +86,700 @@
[r".*: warning: .* stripped of .* superclass .* \[HiddenSuperclass\]"]),
java_high('Use of internal proprietary API',
[r".*: warning: .* is internal proprietary API and may be removed"]),
- java_low('Use parameter comments to document ambiguous literals',
- [r".*: warning: \[BooleanParameter\] .+"]),
- java_low('This class\'s name looks like a Type Parameter.',
- [r".*: warning: \[ClassNamedLikeTypeParameter\] .+"]),
- java_low('Field name is CONSTANT_CASE, but field is not static and final',
- [r".*: warning: \[ConstantField\] .+"]),
- java_low('@Multibinds is a more efficient and declarative mechanism for ensuring that a set multibinding is present in the graph.',
- [r".*: warning: \[EmptySetMultibindingContributions\] .+"]),
- java_low('Prefer assertThrows to ExpectedException',
- [r".*: warning: \[ExpectedExceptionRefactoring\] .+"]),
- java_low('This field is only assigned during initialization; consider making it final',
- [r".*: warning: \[FieldCanBeFinal\] .+"]),
- java_low('Fields that can be null should be annotated @Nullable',
- [r".*: warning: \[FieldMissingNullable\] .+"]),
- java_low('Refactors uses of the JSR 305 @Immutable to Error Prone\'s annotation',
- [r".*: warning: \[ImmutableRefactoring\] .+"]),
- java_low(u'Use Java\'s utility functional interfaces instead of Function\u003cA, B> for primitive types.',
- [r".*: warning: \[LambdaFunctionalInterface\] .+"]),
- java_low('A private method that does not reference the enclosing instance can be static',
- [r".*: warning: \[MethodCanBeStatic\] .+"]),
- java_low('C-style array declarations should not be used',
- [r".*: warning: \[MixedArrayDimensions\] .+"]),
- java_low('Variable declarations should declare only one variable',
- [r".*: warning: \[MultiVariableDeclaration\] .+"]),
- java_low('Source files should not contain multiple top-level class declarations',
- [r".*: warning: \[MultipleTopLevelClasses\] .+"]),
- java_low('Avoid having multiple unary operators acting on the same variable in a method call',
- [r".*: warning: \[MultipleUnaryOperatorsInMethodCall\] .+"]),
- java_low('OnNameExpected naming style',
- [r".*\.java:.*: warning: .+ \[OnNameExpected\]$"]),
- java_low('Package names should match the directory they are declared in',
- [r".*: warning: \[PackageLocation\] .+"]),
- java_low('Non-standard parameter comment; prefer `/* paramName= */ arg`',
- [r".*: warning: \[ParameterComment\] .+"]),
- java_low('Method parameters that aren\'t checked for null shouldn\'t be annotated @Nullable',
- [r".*: warning: \[ParameterNotNullable\] .+"]),
- java_low('Add a private constructor to modules that will not be instantiated by Dagger.',
- [r".*: warning: \[PrivateConstructorForNoninstantiableModule\] .+"]),
- java_low('Utility classes (only static members) are not designed to be instantiated and should be made noninstantiable with a default constructor.',
- [r".*: warning: \[PrivateConstructorForUtilityClass\] .+"]),
- java_low('Unused imports',
- [r".*: warning: \[RemoveUnusedImports\] .+"]),
- java_low('Methods that can return null should be annotated @Nullable',
- [r".*: warning: \[ReturnMissingNullable\] .+"]),
- java_low('Scopes on modules have no function and will soon be an error.',
- [r".*: warning: \[ScopeOnModule\] .+"]),
- java_low('The default case of a switch should appear at the end of the last statement group',
- [r".*: warning: \[SwitchDefault\] .+"]),
- java_low('Prefer assertThrows to @Test(expected=...)',
- [r".*: warning: \[TestExceptionRefactoring\] .+"]),
- java_low('Unchecked exceptions do not need to be declared in the method signature.',
- [r".*: warning: \[ThrowsUncheckedException\] .+"]),
- java_low('Prefer assertThrows to try/fail',
- [r".*: warning: \[TryFailRefactoring\] .+"]),
- java_low('Type parameters must be a single letter with an optional numeric suffix, or an UpperCamelCase name followed by the letter \'T\'.',
- [r".*: warning: \[TypeParameterNaming\] .+"]),
- java_low('Constructors and methods with the same name should appear sequentially with no other code in between. Please re-order or re-name methods.',
- [r".*: warning: \[UngroupedOverloads\] .+"]),
- java_low('Unnecessary call to NullPointerTester#setDefault',
- [r".*: warning: \[UnnecessarySetDefault\] .+"]),
- java_low('Using static imports for types is unnecessary',
- [r".*: warning: \[UnnecessaryStaticImport\] .+"]),
- java_low('@Binds is a more efficient and declarative mechanism for delegating a binding.',
- [r".*: warning: \[UseBinds\] .+"]),
- java_low('Wildcard imports, static or otherwise, should not be used',
- [r".*: warning: \[WildcardImport\] .+"]),
- java_medium('AcronymName',
- [r".*\.java:.*: warning: .+ \[AcronymName\]$"]),
- java_medium('Method reference is ambiguous',
- [r".*: warning: \[AmbiguousMethodReference\] .+"]),
- java_medium('This method passes a pair of parameters through to String.format, but the enclosing method wasn\'t annotated @FormatMethod. Doing so gives compile-time rather than run-time protection against malformed format strings.',
- [r".*: warning: \[AnnotateFormatMethod\] .+"]),
- java_medium('Annotations should be positioned after Javadocs, but before modifiers..',
- [r".*: warning: \[AnnotationPosition\] .+"]),
- java_medium('Arguments are in the wrong order or could be commented for clarity.',
- [r".*: warning: \[ArgumentSelectionDefectChecker\] .+"]),
- java_medium('Arrays do not override equals() or hashCode, so comparisons will be done on reference equality only. If neither deduplication nor lookup are needed, consider using a List instead. Otherwise, use IdentityHashMap/Set, a Map from a library that handles object arrays, or an Iterable/List of pairs.',
- [r".*: warning: \[ArrayAsKeyOfSetOrMap\] .+"]),
- java_medium('Arguments are swapped in assertEquals-like call',
- [r".*: warning: \[AssertEqualsArgumentOrderChecker\] .+"]),
- java_medium('Assertions may be disabled at runtime and do not guarantee that execution will halt here; consider throwing an exception instead',
- [r".*: warning: \[AssertFalse\] .+"]),
- java_medium('The lambda passed to assertThrows should contain exactly one statement',
- [r".*: warning: \[AssertThrowsMultipleStatements\] .+"]),
- java_medium('This assertion throws an AssertionError if it fails, which will be caught by an enclosing try block.',
- [r".*: warning: \[AssertionFailureIgnored\] .+"]),
- java_medium('@AssistedInject and @Inject should not be used on different constructors in the same class.',
- [r".*: warning: \[AssistedInjectAndInjectOnConstructors\] .+"]),
- java_medium('Make toString(), hashCode() and equals() final in AutoValue classes, so it is clear to readers that AutoValue is not overriding them',
- [r".*: warning: \[AutoValueFinalMethods\] .+"]),
- java_medium('Classes that implement Annotation must override equals and hashCode. Consider using AutoAnnotation instead of implementing Annotation by hand.',
- [r".*: warning: \[BadAnnotationImplementation\] .+"]),
- java_medium('Possible sign flip from narrowing conversion',
- [r".*: warning: \[BadComparable\] .+"]),
- java_medium('Importing nested classes/static methods/static fields with commonly-used names can make code harder to read, because it may not be clear from the context exactly which type is being referred to. Qualifying the name with that of the containing class can make the code clearer.',
- [r".*: warning: \[BadImport\] .+"]),
- java_medium('instanceof used in a way that is equivalent to a null check.',
- [r".*: warning: \[BadInstanceof\] .+"]),
- java_medium('BigDecimal#equals has surprising behavior: it also compares scale.',
- [r".*: warning: \[BigDecimalEquals\] .+"]),
- java_medium('new BigDecimal(double) loses precision in this case.',
- [r".*: warning: \[BigDecimalLiteralDouble\] .+"]),
- java_medium('A call to Binder.clearCallingIdentity() should be followed by Binder.restoreCallingIdentity() in a finally block. Otherwise the wrong Binder identity may be used by subsequent code.',
- [r".*: warning: \[BinderIdentityRestoredDangerously\] .+"]),
- java_medium('This code declares a binding for a common value type without a Qualifier annotation.',
- [r".*: warning: \[BindingToUnqualifiedCommonType\] .+"]),
- java_medium('valueOf or autoboxing provides better time and space performance',
- [r".*: warning: \[BoxedPrimitiveConstructor\] .+"]),
- java_medium('ByteBuffer.array() shouldn\'t be called unless ByteBuffer.arrayOffset() is used or if the ByteBuffer was initialized using ByteBuffer.wrap() or ByteBuffer.allocate().',
- [r".*: warning: \[ByteBufferBackingArray\] .+"]),
- java_medium('Mockito cannot mock final classes',
- [r".*: warning: \[CannotMockFinalClass\] .+"]),
- java_medium('Duration can be expressed more clearly with different units',
- [r".*: warning: \[CanonicalDuration\] .+"]),
- java_medium('Logging or rethrowing exceptions should usually be preferred to catching and calling printStackTrace',
- [r".*: warning: \[CatchAndPrintStackTrace\] .+"]),
- java_medium('Ignoring exceptions and calling fail() is unnecessary, and makes test output less useful',
- [r".*: warning: \[CatchFail\] .+"]),
- java_medium('Inner class is non-static but does not reference enclosing class',
- [r".*: warning: \[ClassCanBeStatic\] .+"]),
- java_medium('Class.newInstance() bypasses exception checking; prefer getDeclaredConstructor().newInstance()',
- [r".*: warning: \[ClassNewInstance\] .+"]),
- java_medium('Providing Closeable resources makes their lifecycle unclear',
- [r".*: warning: \[CloseableProvides\] .+"]),
- java_medium('The type of the array parameter of Collection.toArray needs to be compatible with the array type',
- [r".*: warning: \[CollectionToArraySafeParameter\] .+"]),
- java_medium('Collector.of() should not use state',
- [r".*: warning: \[CollectorShouldNotUseState\] .+"]),
- java_medium('Class should not implement both `Comparable` and `Comparator`',
- [r".*: warning: \[ComparableAndComparator\] .+"]),
- java_medium('Constructors should not invoke overridable methods.',
- [r".*: warning: \[ConstructorInvokesOverridable\] .+"]),
- java_medium('Constructors should not pass the \'this\' reference out in method invocations, since the object may not be fully constructed.',
- [r".*: warning: \[ConstructorLeaksThis\] .+"]),
- java_medium('DateFormat is not thread-safe, and should not be used as a constant field.',
- [r".*: warning: \[DateFormatConstant\] .+"]),
- java_medium('Implicit use of the platform default charset, which can result in differing behaviour between JVM executions or incorrect behavior if the encoding of the data source doesn\'t match expectations.',
- [r".*: warning: \[DefaultCharset\] .+"]),
- java_medium('Avoid deprecated Thread methods; read the method\'s javadoc for details.',
- [r".*: warning: \[DeprecatedThreadMethods\] .+"]),
- java_medium('Prefer collection factory methods or builders to the double-brace initialization pattern.',
- [r".*: warning: \[DoubleBraceInitialization\] .+"]),
- java_medium('Double-checked locking on non-volatile fields is unsafe',
- [r".*: warning: \[DoubleCheckedLocking\] .+"]),
- java_medium('Empty top-level type declaration',
- [r".*: warning: \[EmptyTopLevelDeclaration\] .+"]),
- java_medium('equals() implementation may throw NullPointerException when given null',
- [r".*: warning: \[EqualsBrokenForNull\] .+"]),
- java_medium('Overriding Object#equals in a non-final class by using getClass rather than instanceof breaks substitutability of subclasses.',
- [r".*: warning: \[EqualsGetClass\] .+"]),
- java_medium('Classes that override equals should also override hashCode.',
- [r".*: warning: \[EqualsHashCode\] .+"]),
- java_medium('An equality test between objects with incompatible types always returns false',
- [r".*: warning: \[EqualsIncompatibleType\] .+"]),
- java_medium('The contract of #equals states that it should return false for incompatible types, while this implementation may throw ClassCastException.',
- [r".*: warning: \[EqualsUnsafeCast\] .+"]),
- java_medium('Implementing #equals by just comparing hashCodes is fragile. Hashes collide frequently, and this will lead to false positives in #equals.',
- [r".*: warning: \[EqualsUsingHashCode\] .+"]),
- java_medium('Calls to ExpectedException#expect should always be followed by exactly one statement.',
- [r".*: warning: \[ExpectedExceptionChecker\] .+"]),
- java_medium('When only using JUnit Assert\'s static methods, you should import statically instead of extending.',
- [r".*: warning: \[ExtendingJUnitAssert\] .+"]),
- java_medium('Switch case may fall through',
- [r".*: warning: \[FallThrough\] .+"]),
- java_medium('If you return or throw from a finally, then values returned or thrown from the try-catch block will be ignored. Consider using try-with-resources instead.',
- [r".*: warning: \[Finally\] .+"]),
- java_medium('Use parentheses to make the precedence explicit',
- [r".*: warning: \[FloatCast\] .+"]),
- java_medium('This fuzzy equality check is using a tolerance less than the gap to the next number. You may want a less restrictive tolerance, or to assert equality.',
- [r".*: warning: \[FloatingPointAssertionWithinEpsilon\] .+"]),
- java_medium('Floating point literal loses precision',
- [r".*: warning: \[FloatingPointLiteralPrecision\] .+"]),
- java_medium('Classes extending PreferenceActivity must implement isValidFragment such that it does not unconditionally return true to prevent vulnerability to fragment injection attacks.',
- [r".*: warning: \[FragmentInjection\] .+"]),
- java_medium('Subclasses of Fragment must be instantiable via Class#newInstance(): the class must be public, static and have a public nullary constructor',
- [r".*: warning: \[FragmentNotInstantiable\] .+"]),
- java_medium('Overloads will be ambiguous when passing lambda arguments',
- [r".*: warning: \[FunctionalInterfaceClash\] .+"]),
- java_medium('Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.',
- [r".*: warning: \[FutureReturnValueIgnored\] .+"]),
- java_medium('Calling getClass() on an enum may return a subclass of the enum type',
- [r".*: warning: \[GetClassOnEnum\] .+"]),
- java_medium('Hardcoded reference to /sdcard',
- [r".*: warning: \[HardCodedSdCardPath\] .+"]),
- java_medium('Hiding fields of superclasses may cause confusion and errors',
- [r".*: warning: \[HidingField\] .+"]),
- java_medium('Annotations should always be immutable',
- [r".*: warning: \[ImmutableAnnotationChecker\] .+"]),
- java_medium('Enums should always be immutable',
- [r".*: warning: \[ImmutableEnumChecker\] .+"]),
- java_medium('This annotation has incompatible modifiers as specified by its @IncompatibleModifiers annotation',
- [r".*: warning: \[IncompatibleModifiers\] .+"]),
- java_medium('It is confusing to have a field and a parameter under the same scope that differ only in capitalization.',
- [r".*: warning: \[InconsistentCapitalization\] .+"]),
- java_medium('Including fields in hashCode which are not compared in equals violates the contract of hashCode.',
- [r".*: warning: \[InconsistentHashCode\] .+"]),
- java_medium('The ordering of parameters in overloaded methods should be as consistent as possible (when viewed from left to right)',
- [r".*: warning: \[InconsistentOverloads\] .+"]),
- java_medium('This for loop increments the same variable in the header and in the body',
- [r".*: warning: \[IncrementInForLoopAndHeader\] .+"]),
- java_medium('Constructors on abstract classes are never directly @Injected, only the constructors of their subclasses can be @Inject\'ed.',
- [r".*: warning: \[InjectOnConstructorOfAbstractClass\] .+"]),
- java_medium('Please also override int read(byte[], int, int), otherwise multi-byte reads from this input stream are likely to be slow.',
- [r".*: warning: \[InputStreamSlowMultibyteRead\] .+"]),
- java_medium('Casting inside an if block should be plausibly consistent with the instanceof type',
- [r".*: warning: \[InstanceOfAndCastMatchWrongType\] .+"]),
- java_medium('Expression of type int may overflow before being assigned to a long',
- [r".*: warning: \[IntLongMath\] .+"]),
- java_medium('IntentBuilderName',
- [r".*\.java:.*: warning: .+ \[IntentBuilderName\]$"]),
- java_medium('This @param tag doesn\'t refer to a parameter of the method.',
- [r".*: warning: \[InvalidParam\] .+"]),
- java_medium('This tag is invalid.',
- [r".*: warning: \[InvalidTag\] .+"]),
- java_medium('The documented method doesn\'t actually throw this checked exception.',
- [r".*: warning: \[InvalidThrows\] .+"]),
- java_medium('Class should not implement both `Iterable` and `Iterator`',
- [r".*: warning: \[IterableAndIterator\] .+"]),
- java_medium('Floating-point comparison without error tolerance',
- [r".*: warning: \[JUnit3FloatingPointComparisonWithoutDelta\] .+"]),
- java_medium('Some JUnit4 construct cannot be used in a JUnit3 context. Convert your class to JUnit4 style to use them.',
- [r".*: warning: \[JUnit4ClassUsedInJUnit3\] .+"]),
- java_medium('Test class inherits from JUnit 3\'s TestCase but has JUnit 4 @Test annotations.',
- [r".*: warning: \[JUnitAmbiguousTestClass\] .+"]),
- java_medium('Never reuse class names from java.lang',
- [r".*: warning: \[JavaLangClash\] .+"]),
- java_medium('Suggests alternatives to obsolete JDK classes.',
- [r".*: warning: \[JdkObsolete\] .+"]),
- java_medium('Calls to Lock#lock should be immediately followed by a try block which releases the lock.',
- [r".*: warning: \[LockNotBeforeTry\] .+"]),
- java_medium('Assignment where a boolean expression was expected; use == if this assignment wasn\'t expected or add parentheses for clarity.',
- [r".*: warning: \[LogicalAssignment\] .+"]),
- java_medium('Math.abs does not always give a positive result. Please consider other methods for positive random numbers.',
- [r".*: warning: \[MathAbsoluteRandom\] .+"]),
- java_medium('Switches on enum types should either handle all values, or have a default case.',
- [r".*: warning: \[MissingCasesInEnumSwitch\] .+"]),
- java_medium('The Google Java Style Guide requires that each switch statement includes a default statement group, even if it contains no code. (This requirement is lifted for any switch statement that covers all values of an enum.)',
- [r".*: warning: \[MissingDefault\] .+"]),
- java_medium('Not calling fail() when expecting an exception masks bugs',
- [r".*: warning: \[MissingFail\] .+"]),
- java_medium('method overrides method in supertype; expected @Override',
- [r".*: warning: \[MissingOverride\] .+"]),
- java_medium('A collection or proto builder was created, but its values were never accessed.',
- [r".*: warning: \[ModifiedButNotUsed\] .+"]),
- java_medium('Modifying a collection while iterating over it in a loop may cause a ConcurrentModificationException to be thrown.',
- [r".*: warning: \[ModifyCollectionInEnhancedForLoop\] .+"]),
- java_medium('Multiple calls to either parallel or sequential are unnecessary and cause confusion.',
- [r".*: warning: \[MultipleParallelOrSequentialCalls\] .+"]),
- java_medium('Constant field declarations should use the immutable type (such as ImmutableList) instead of the general collection interface type (such as List)',
- [r".*: warning: \[MutableConstantField\] .+"]),
- java_medium('Method return type should use the immutable type (such as ImmutableList) instead of the general collection interface type (such as List)',
- [r".*: warning: \[MutableMethodReturnType\] .+"]),
- java_medium('Compound assignments may hide dangerous casts',
- [r".*: warning: \[NarrowingCompoundAssignment\] .+"]),
- java_medium('Nested instanceOf conditions of disjoint types create blocks of code that never execute',
- [r".*: warning: \[NestedInstanceOfConditions\] .+"]),
- java_medium('Instead of returning a functional type, return the actual type that the returned function would return and use lambdas at use site.',
- [r".*: warning: \[NoFunctionalReturnType\] .+"]),
- java_medium('This update of a volatile variable is non-atomic',
- [r".*: warning: \[NonAtomicVolatileUpdate\] .+"]),
- java_medium('Static import of member uses non-canonical name',
- [r".*: warning: \[NonCanonicalStaticMemberImport\] .+"]),
- java_medium('equals method doesn\'t override Object.equals',
- [r".*: warning: \[NonOverridingEquals\] .+"]),
- java_medium('Not closeable',
- [r".*\.java:.*: warning: .+ \[NotCloseable\]$"]),
- java_medium('Constructors should not be annotated with @Nullable since they cannot return null',
- [r".*: warning: \[NullableConstructor\] .+"]),
- java_medium('Dereference of possibly-null value',
- [r".*: warning: \[NullableDereference\] .+"]),
- java_medium('@Nullable should not be used for primitive types since they cannot be null',
- [r".*: warning: \[NullablePrimitive\] .+"]),
- java_medium('void-returning methods should not be annotated with @Nullable, since they cannot return null',
- [r".*: warning: \[NullableVoid\] .+"]),
- java_medium('Calling toString on Objects that don\'t override toString() doesn\'t provide useful information',
- [r".*: warning: \[ObjectToString\] .+"]),
- java_medium('Objects.hashCode(Object o) should not be passed a primitive value',
- [r".*: warning: \[ObjectsHashCodePrimitive\] .+"]),
- java_medium('Use grouping parenthesis to make the operator precedence explicit',
- [r".*: warning: \[OperatorPrecedence\] .+"]),
- java_medium('One should not call optional.get() inside an if statement that checks !optional.isPresent',
- [r".*: warning: \[OptionalNotPresent\] .+"]),
- java_medium('String literal contains format specifiers, but is not passed to a format method',
- [r".*: warning: \[OrphanedFormatString\] .+"]),
- java_medium('To return a custom message with a Throwable class, one should override getMessage() instead of toString() for Throwable.',
- [r".*: warning: \[OverrideThrowableToString\] .+"]),
- java_medium('Varargs doesn\'t agree for overridden method',
- [r".*: warning: \[Overrides\] .+"]),
- java_medium('This method is not annotated with @Inject, but it overrides a method that is annotated with @com.google.inject.Inject. Guice will inject this method, and it is recommended to annotate it explicitly.',
- [r".*: warning: \[OverridesGuiceInjectableMethod\] .+"]),
- java_medium('Detects `/* name= */`-style comments on actual parameters where the name doesn\'t match the formal parameter',
- [r".*: warning: \[ParameterName\] .+"]),
- java_medium('Preconditions only accepts the %s placeholder in error message strings',
- [r".*: warning: \[PreconditionsInvalidPlaceholder\] .+"]),
- java_medium('Passing a primitive array to a varargs method is usually wrong',
- [r".*: warning: \[PrimitiveArrayPassedToVarargsMethod\] .+"]),
- java_medium('A field on a protocol buffer was set twice in the same chained expression.',
- [r".*: warning: \[ProtoRedundantSet\] .+"]),
- java_medium('Protos should not be used as a key to a map, in a set, or in a contains method on a descendant of a collection. Protos have non deterministic ordering and proto equality is deep, which is a performance issue.',
- [r".*: warning: \[ProtosAsKeyOfSetOrMap\] .+"]),
- java_medium('BugChecker has incorrect ProvidesFix tag, please update',
- [r".*: warning: \[ProvidesFix\] .+"]),
- java_medium('Qualifiers/Scope annotations on @Inject methods don\'t have any effect. Move the qualifier annotation to the binding location.',
- [r".*: warning: \[QualifierOrScopeOnInjectMethod\] .+"]),
- java_medium('Injection frameworks currently don\'t understand Qualifiers in TYPE_PARAMETER or TYPE_USE contexts.',
- [r".*: warning: \[QualifierWithTypeUse\] .+"]),
- java_medium('reachabilityFence should always be called inside a finally block',
- [r".*: warning: \[ReachabilityFenceUsage\] .+"]),
- java_medium('Thrown exception is a subtype of another',
- [r".*: warning: \[RedundantThrows\] .+"]),
- java_medium('Comparison using reference equality instead of value equality',
- [r".*: warning: \[ReferenceEquality\] .+"]),
- java_medium('This annotation is missing required modifiers as specified by its @RequiredModifiers annotation',
- [r".*: warning: \[RequiredModifiers\] .+"]),
- java_medium('Void methods should not have a @return tag.',
- [r".*: warning: \[ReturnFromVoid\] .+"]),
- java_medium('SAM-compatible parameters should be last',
- [r".*\.java:.*: warning: .+ \[SamShouldBeLast\]$"]),
- java_medium(u'Prefer the short-circuiting boolean operators \u0026\u0026 and || to \u0026 and |.',
- [r".*: warning: \[ShortCircuitBoolean\] .+"]),
- java_medium('Writes to static fields should not be guarded by instance locks',
- [r".*: warning: \[StaticGuardedByInstance\] .+"]),
- java_medium('A static variable or method should be qualified with a class name, not expression',
- [r".*: warning: \[StaticQualifiedUsingExpression\] .+"]),
- java_medium('Streams that encapsulate a closeable resource should be closed using try-with-resources',
- [r".*: warning: \[StreamResourceLeak\] .+"]),
- java_medium('String comparison using reference equality instead of value equality',
- [r".*: warning: \[StringEquality\] .+"]),
- java_medium('String.split(String) has surprising behavior',
- [r".*: warning: \[StringSplitter\] .+"]),
- java_medium('SWIG generated code that can\'t call a C++ destructor will leak memory',
- [r".*: warning: \[SwigMemoryLeak\] .+"]),
- java_medium('Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.',
- [r".*: warning: \[SynchronizeOnNonFinalField\] .+"]),
- java_medium('Code that contains System.exit() is untestable.',
- [r".*: warning: \[SystemExitOutsideMain\] .+"]),
- java_medium('Using @Test(expected=...) is discouraged, since the test will pass if *any* statement in the test method throws the expected exception',
- [r".*: warning: \[TestExceptionChecker\] .+"]),
- java_medium('Thread.join needs to be surrounded by a loop until it succeeds, as in Uninterruptibles.joinUninterruptibly.',
- [r".*: warning: \[ThreadJoinLoop\] .+"]),
- java_medium('ThreadLocals should be stored in static fields',
- [r".*: warning: \[ThreadLocalUsage\] .+"]),
- java_medium('Relying on the thread scheduler is discouraged; see Effective Java Item 72 (2nd edition) / 84 (3rd edition).',
- [r".*: warning: \[ThreadPriorityCheck\] .+"]),
- java_medium('Three-letter time zone identifiers are deprecated, may be ambiguous, and might not do what you intend; the full IANA time zone ID should be used instead.',
- [r".*: warning: \[ThreeLetterTimeZoneID\] .+"]),
- java_medium('An implementation of Object.toString() should never return null.',
- [r".*: warning: \[ToStringReturnsNull\] .+"]),
- java_medium('The actual and expected values appear to be swapped, which results in poor assertion failure messages. The actual value should come first.',
- [r".*: warning: \[TruthAssertExpected\] .+"]),
- java_medium('Truth Library assert is called on a constant.',
- [r".*: warning: \[TruthConstantAsserts\] .+"]),
- java_medium('Argument is not compatible with the subject\'s type.',
- [r".*: warning: \[TruthIncompatibleType\] .+"]),
- java_medium('Type parameter declaration shadows another named type',
- [r".*: warning: \[TypeNameShadowing\] .+"]),
- java_medium('Type parameter declaration overrides another type parameter already declared',
- [r".*: warning: \[TypeParameterShadowing\] .+"]),
- java_medium('Declaring a type parameter that is only used in the return type is a misuse of generics: operations on the type parameter are unchecked, it hides unsafe casts at invocations of the method, and it interacts badly with method overload resolution.',
- [r".*: warning: \[TypeParameterUnusedInFormals\] .+"]),
- java_medium('Avoid hash-based containers of java.net.URL--the containers rely on equals() and hashCode(), which cause java.net.URL to make blocking internet connections.',
- [r".*: warning: \[URLEqualsHashCode\] .+"]),
- java_medium('Collection, Iterable, Multimap, and Queue do not have well-defined equals behavior',
- [r".*: warning: \[UndefinedEquals\] .+"]),
- java_medium('Switch handles all enum values: an explicit default case is unnecessary and defeats error checking for non-exhaustive switches.',
- [r".*: warning: \[UnnecessaryDefaultInEnumSwitch\] .+"]),
- java_medium('Unnecessary use of grouping parentheses',
- [r".*: warning: \[UnnecessaryParentheses\] .+"]),
- java_medium('Finalizer may run before native code finishes execution',
- [r".*: warning: \[UnsafeFinalization\] .+"]),
- java_medium('Prefer `asSubclass` instead of casting the result of `newInstance`, to detect classes of incorrect type before invoking their constructors.This way, if the class is of the incorrect type,it will throw an exception before invoking its constructor.',
- [r".*: warning: \[UnsafeReflectiveConstructionCast\] .+"]),
- java_medium('Unsynchronized method overrides a synchronized method.',
- [r".*: warning: \[UnsynchronizedOverridesSynchronized\] .+"]),
- java_medium('Unused.',
- [r".*: warning: \[Unused\] .+"]),
- java_medium('This catch block catches an exception and re-throws another, but swallows the caught exception rather than setting it as a cause. This can make debugging harder.',
- [r".*: warning: \[UnusedException\] .+"]),
- java_medium('Java assert is used in test. For testing purposes Assert.* matchers should be used.',
- [r".*: warning: \[UseCorrectAssertInTests\] .+"]),
- java_medium('UserHandle',
- [r".*\.java:.*: warning: .+ \[UserHandle\]$"]),
- java_medium('UserHandleName',
- [r".*\.java:.*: warning: .+ \[UserHandleName\]$"]),
- java_medium('Non-constant variable missing @Var annotation',
- [r".*: warning: \[Var\] .+"]),
- java_medium('variableName and type with the same name would refer to the static field instead of the class',
- [r".*: warning: \[VariableNameSameAsType\] .+"]),
- java_medium('Because of spurious wakeups, Object.wait() and Condition.await() must always be called in a loop',
- [r".*: warning: \[WaitNotInLoop\] .+"]),
- java_medium('A wakelock acquired with a timeout may be released by the system before calling `release`, even after checking `isHeld()`. If so, it will throw a RuntimeException. Please wrap in a try/catch block.',
- [r".*: warning: \[WakelockReleasedDangerously\] .+"]),
- java_high('AndroidInjection.inject() should always be invoked before calling super.lifecycleMethod()',
- [r".*: warning: \[AndroidInjectionBeforeSuper\] .+"]),
- java_high('Use of class, field, or method that is not compatible with legacy Android devices',
- [r".*: warning: \[AndroidJdkLibsChecker\] .+"]),
- java_high('Reference equality used to compare arrays',
- [r".*: warning: \[ArrayEquals\] .+"]),
- java_high('Arrays.fill(Object[], Object) called with incompatible types.',
- [r".*: warning: \[ArrayFillIncompatibleType\] .+"]),
- java_high('hashcode method on array does not hash array contents',
- [r".*: warning: \[ArrayHashCode\] .+"]),
- java_high('ArrayReturn',
- [r".*\.java:.*: warning: .+ \[ArrayReturn\]$"]),
- java_high('Calling toString on an array does not provide useful information',
- [r".*: warning: \[ArrayToString\] .+"]),
- java_high('Arrays.asList does not autobox primitive arrays, as one might expect.',
- [r".*: warning: \[ArraysAsListPrimitiveArray\] .+"]),
- java_high('@AssistedInject and @Inject cannot be used on the same constructor.',
- [r".*: warning: \[AssistedInjectAndInjectOnSameConstructor\] .+"]),
- java_high('AsyncCallable should not return a null Future, only a Future whose result is null.',
- [r".*: warning: \[AsyncCallableReturnsNull\] .+"]),
- java_high('AsyncFunction should not return a null Future, only a Future whose result is null.',
- [r".*: warning: \[AsyncFunctionReturnsNull\] .+"]),
- java_high('@AutoFactory and @Inject should not be used in the same type.',
- [r".*: warning: \[AutoFactoryAtInject\] .+"]),
- java_high('Arguments to AutoValue constructor are in the wrong order',
- [r".*: warning: \[AutoValueConstructorOrderChecker\] .+"]),
- java_high('Shift by an amount that is out of range',
- [r".*: warning: \[BadShiftAmount\] .+"]),
- java_high('Object serialized in Bundle may have been flattened to base type.',
- [r".*: warning: \[BundleDeserializationCast\] .+"]),
- java_high('The called constructor accepts a parameter with the same name and type as one of its caller\'s parameters, but its caller doesn\'t pass that parameter to it. It\'s likely that it was intended to.',
- [r".*: warning: \[ChainingConstructorIgnoresParameter\] .+"]),
- java_high('Ignored return value of method that is annotated with @CheckReturnValue',
- [r".*: warning: \[CheckReturnValue\] .+"]),
- java_high('The source file name should match the name of the top-level class it contains',
- [r".*: warning: \[ClassName\] .+"]),
- java_high('Incompatible type as argument to Object-accepting Java collections method',
- [r".*: warning: \[CollectionIncompatibleType\] .+"]),
- java_high(u'Implementing \'Comparable\u003cT>\' where T is not compatible with the implementing class.',
- [r".*: warning: \[ComparableType\] .+"]),
- java_high('this == null is always false, this != null is always true',
- [r".*: warning: \[ComparingThisWithNull\] .+"]),
- java_high('This comparison method violates the contract',
- [r".*: warning: \[ComparisonContractViolated\] .+"]),
- java_high('Comparison to value that is out of range for the compared type',
- [r".*: warning: \[ComparisonOutOfRange\] .+"]),
- java_high('@CompatibleWith\'s value is not a type argument.',
- [r".*: warning: \[CompatibleWithAnnotationMisuse\] .+"]),
- java_high('Non-compile-time constant expression passed to parameter with @CompileTimeConstant type annotation.',
- [r".*: warning: \[CompileTimeConstant\] .+"]),
- java_high('Non-trivial compile time constant boolean expressions shouldn\'t be used.',
- [r".*: warning: \[ComplexBooleanConstant\] .+"]),
- java_high('A conditional expression with numeric operands of differing types will perform binary numeric promotion of the operands; when these operands are of reference types, the expression\'s result may not be of the expected type.',
- [r".*: warning: \[ConditionalExpressionNumericPromotion\] .+"]),
- java_high('Compile-time constant expression overflows',
- [r".*: warning: \[ConstantOverflow\] .+"]),
- java_high('Dagger @Provides methods may not return null unless annotated with @Nullable',
- [r".*: warning: \[DaggerProvidesNull\] .+"]),
- java_high('Exception created but not thrown',
- [r".*: warning: \[DeadException\] .+"]),
- java_high('Thread created but not started',
- [r".*: warning: \[DeadThread\] .+"]),
+ low('BooleanParameter',
+ 'Use parameter comments to document ambiguous literals'),
+ low('ClassNamedLikeTypeParameter',
+ 'This class\'s name looks like a Type Parameter.'),
+ low('ConstantField',
+ 'Field name is CONSTANT_CASE, but field is not static and final'),
+ low('EmptySetMultibindingContributions',
+ '@Multibinds is a more efficient and declarative mechanism for ensuring that a set multibinding is present in the graph.'),
+ low('ExpectedExceptionRefactoring',
+ 'Prefer assertThrows to ExpectedException'),
+ low('FieldCanBeFinal',
+ 'This field is only assigned during initialization; consider making it final'),
+ low('FieldMissingNullable',
+ 'Fields that can be null should be annotated @Nullable'),
+ low('ImmutableRefactoring',
+ 'Refactors uses of the JSR 305 @Immutable to Error Prone\'s annotation'),
+ low('LambdaFunctionalInterface',
+ u'Use Java\'s utility functional interfaces instead of Function\u003cA, B> for primitive types.'),
+ low('MethodCanBeStatic',
+ 'A private method that does not reference the enclosing instance can be static'),
+ low('MixedArrayDimensions',
+ 'C-style array declarations should not be used'),
+ low('MultiVariableDeclaration',
+ 'Variable declarations should declare only one variable'),
+ low('MultipleTopLevelClasses',
+ 'Source files should not contain multiple top-level class declarations'),
+ low('MultipleUnaryOperatorsInMethodCall',
+ 'Avoid having multiple unary operators acting on the same variable in a method call'),
+ low('OnNameExpected',
+ 'OnNameExpected naming style'),
+ low('PackageLocation',
+ 'Package names should match the directory they are declared in'),
+ low('ParameterComment',
+ 'Non-standard parameter comment; prefer `/* paramName= */ arg`'),
+ low('ParameterNotNullable',
+ 'Method parameters that aren\'t checked for null shouldn\'t be annotated @Nullable'),
+ low('PrivateConstructorForNoninstantiableModule',
+ 'Add a private constructor to modules that will not be instantiated by Dagger.'),
+ low('PrivateConstructorForUtilityClass',
+ 'Utility classes (only static members) are not designed to be instantiated and should be made noninstantiable with a default constructor.'),
+ low('RemoveUnusedImports',
+ 'Unused imports'),
+ low('ReturnMissingNullable',
+ 'Methods that can return null should be annotated @Nullable'),
+ low('ScopeOnModule',
+ 'Scopes on modules have no function and will soon be an error.'),
+ low('SwitchDefault',
+ 'The default case of a switch should appear at the end of the last statement group'),
+ low('TestExceptionRefactoring',
+ 'Prefer assertThrows to @Test(expected=...)'),
+ low('ThrowsUncheckedException',
+ 'Unchecked exceptions do not need to be declared in the method signature.'),
+ low('TryFailRefactoring',
+ 'Prefer assertThrows to try/fail'),
+ low('TypeParameterNaming',
+ 'Type parameters must be a single letter with an optional numeric suffix, or an UpperCamelCase name followed by the letter \'T\'.'),
+ low('UngroupedOverloads',
+ 'Constructors and methods with the same name should appear sequentially with no other code in between. Please re-order or re-name methods.'),
+ low('UnnecessarySetDefault',
+ 'Unnecessary call to NullPointerTester#setDefault'),
+ low('UnnecessaryStaticImport',
+ 'Using static imports for types is unnecessary'),
+ low('UseBinds',
+ '@Binds is a more efficient and declarative mechanism for delegating a binding.'),
+ low('WildcardImport',
+ 'Wildcard imports, static or otherwise, should not be used'),
+ medium('AcronymName',
+ 'AcronymName'),
+ medium('AmbiguousMethodReference',
+ 'Method reference is ambiguous'),
+ medium('AnnotateFormatMethod',
+ 'This method passes a pair of parameters through to String.format, but the enclosing method wasn\'t annotated @FormatMethod. Doing so gives compile-time rather than run-time protection against malformed format strings.'),
+ medium('AnnotationPosition',
+ 'Annotations should be positioned after Javadocs, but before modifiers..'),
+ medium('ArgumentSelectionDefectChecker',
+ 'Arguments are in the wrong order or could be commented for clarity.'),
+ medium('ArrayAsKeyOfSetOrMap',
+ 'Arrays do not override equals() or hashCode, so comparisons will be done on reference equality only. If neither deduplication nor lookup are needed, consider using a List instead. Otherwise, use IdentityHashMap/Set, a Map from a library that handles object arrays, or an Iterable/List of pairs.'),
+ medium('AssertEqualsArgumentOrderChecker',
+ 'Arguments are swapped in assertEquals-like call'),
+ medium('AssertFalse',
+ 'Assertions may be disabled at runtime and do not guarantee that execution will halt here; consider throwing an exception instead'),
+ medium('AssertThrowsMultipleStatements',
+ 'The lambda passed to assertThrows should contain exactly one statement'),
+ medium('AssertionFailureIgnored',
+ 'This assertion throws an AssertionError if it fails, which will be caught by an enclosing try block.'),
+ medium('AssistedInjectAndInjectOnConstructors',
+ '@AssistedInject and @Inject should not be used on different constructors in the same class.'),
+ medium('AutoValueFinalMethods',
+ 'Make toString(), hashCode() and equals() final in AutoValue classes, so it is clear to readers that AutoValue is not overriding them'),
+ medium('BadAnnotationImplementation',
+ 'Classes that implement Annotation must override equals and hashCode. Consider using AutoAnnotation instead of implementing Annotation by hand.'),
+ medium('BadComparable',
+ 'Possible sign flip from narrowing conversion'),
+ medium('BadImport',
+ 'Importing nested classes/static methods/static fields with commonly-used names can make code harder to read, because it may not be clear from the context exactly which type is being referred to. Qualifying the name with that of the containing class can make the code clearer.'),
+ medium('BadInstanceof',
+ 'instanceof used in a way that is equivalent to a null check.'),
+ medium('BigDecimalEquals',
+ 'BigDecimal#equals has surprising behavior: it also compares scale.'),
+ medium('BigDecimalLiteralDouble',
+ 'new BigDecimal(double) loses precision in this case.'),
+ medium('BinderIdentityRestoredDangerously',
+ 'A call to Binder.clearCallingIdentity() should be followed by Binder.restoreCallingIdentity() in a finally block. Otherwise the wrong Binder identity may be used by subsequent code.'),
+ medium('BindingToUnqualifiedCommonType',
+ 'This code declares a binding for a common value type without a Qualifier annotation.'),
+ medium('BoxedPrimitiveConstructor',
+ 'valueOf or autoboxing provides better time and space performance'),
+ medium('ByteBufferBackingArray',
+ 'ByteBuffer.array() shouldn\'t be called unless ByteBuffer.arrayOffset() is used or if the ByteBuffer was initialized using ByteBuffer.wrap() or ByteBuffer.allocate().'),
+ medium('CannotMockFinalClass',
+ 'Mockito cannot mock final classes'),
+ medium('CanonicalDuration',
+ 'Duration can be expressed more clearly with different units'),
+ medium('CatchAndPrintStackTrace',
+ 'Logging or rethrowing exceptions should usually be preferred to catching and calling printStackTrace'),
+ medium('CatchFail',
+ 'Ignoring exceptions and calling fail() is unnecessary, and makes test output less useful'),
+ medium('ClassCanBeStatic',
+ 'Inner class is non-static but does not reference enclosing class'),
+ medium('ClassNewInstance',
+ 'Class.newInstance() bypasses exception checking; prefer getDeclaredConstructor().newInstance()'),
+ medium('CloseableProvides',
+ 'Providing Closeable resources makes their lifecycle unclear'),
+ medium('CollectionToArraySafeParameter',
+ 'The type of the array parameter of Collection.toArray needs to be compatible with the array type'),
+ medium('CollectorShouldNotUseState',
+ 'Collector.of() should not use state'),
+ medium('ComparableAndComparator',
+ 'Class should not implement both `Comparable` and `Comparator`'),
+ medium('ConstructorInvokesOverridable',
+ 'Constructors should not invoke overridable methods.'),
+ medium('ConstructorLeaksThis',
+ 'Constructors should not pass the \'this\' reference out in method invocations, since the object may not be fully constructed.'),
+ medium('DateFormatConstant',
+ 'DateFormat is not thread-safe, and should not be used as a constant field.'),
+ medium('DefaultCharset',
+ 'Implicit use of the platform default charset, which can result in differing behaviour between JVM executions or incorrect behavior if the encoding of the data source doesn\'t match expectations.'),
+ medium('DeprecatedThreadMethods',
+ 'Avoid deprecated Thread methods; read the method\'s javadoc for details.'),
+ medium('DoubleBraceInitialization',
+ 'Prefer collection factory methods or builders to the double-brace initialization pattern.'),
+ medium('DoubleCheckedLocking',
+ 'Double-checked locking on non-volatile fields is unsafe'),
+ medium('EmptyTopLevelDeclaration',
+ 'Empty top-level type declaration'),
+ medium('EqualsBrokenForNull',
+ 'equals() implementation may throw NullPointerException when given null'),
+ medium('EqualsGetClass',
+ 'Overriding Object#equals in a non-final class by using getClass rather than instanceof breaks substitutability of subclasses.'),
+ medium('EqualsHashCode',
+ 'Classes that override equals should also override hashCode.'),
+ medium('EqualsIncompatibleType',
+ 'An equality test between objects with incompatible types always returns false'),
+ medium('EqualsUnsafeCast',
+ 'The contract of #equals states that it should return false for incompatible types, while this implementation may throw ClassCastException.'),
+ medium('EqualsUsingHashCode',
+ 'Implementing #equals by just comparing hashCodes is fragile. Hashes collide frequently, and this will lead to false positives in #equals.'),
+ medium('ExpectedExceptionChecker',
+ 'Calls to ExpectedException#expect should always be followed by exactly one statement.'),
+ medium('ExtendingJUnitAssert',
+ 'When only using JUnit Assert\'s static methods, you should import statically instead of extending.'),
+ medium('FallThrough',
+ 'Switch case may fall through'),
+ medium('Finally',
+ 'If you return or throw from a finally, then values returned or thrown from the try-catch block will be ignored. Consider using try-with-resources instead.'),
+ medium('FloatCast',
+ 'Use parentheses to make the precedence explicit'),
+ medium('FloatingPointAssertionWithinEpsilon',
+ 'This fuzzy equality check is using a tolerance less than the gap to the next number. You may want a less restrictive tolerance, or to assert equality.'),
+ medium('FloatingPointLiteralPrecision',
+ 'Floating point literal loses precision'),
+ medium('FragmentInjection',
+ 'Classes extending PreferenceActivity must implement isValidFragment such that it does not unconditionally return true to prevent vulnerability to fragment injection attacks.'),
+ medium('FragmentNotInstantiable',
+ 'Subclasses of Fragment must be instantiable via Class#newInstance(): the class must be public, static and have a public nullary constructor'),
+ medium('FunctionalInterfaceClash',
+ 'Overloads will be ambiguous when passing lambda arguments'),
+ medium('FutureReturnValueIgnored',
+ 'Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.'),
+ medium('GetClassOnEnum',
+ 'Calling getClass() on an enum may return a subclass of the enum type'),
+ medium('HardCodedSdCardPath',
+ 'Hardcoded reference to /sdcard'),
+ medium('HidingField',
+ 'Hiding fields of superclasses may cause confusion and errors'),
+ medium('ImmutableAnnotationChecker',
+ 'Annotations should always be immutable'),
+ medium('ImmutableEnumChecker',
+ 'Enums should always be immutable'),
+ medium('IncompatibleModifiers',
+ 'This annotation has incompatible modifiers as specified by its @IncompatibleModifiers annotation'),
+ medium('InconsistentCapitalization',
+ 'It is confusing to have a field and a parameter under the same scope that differ only in capitalization.'),
+ medium('InconsistentHashCode',
+ 'Including fields in hashCode which are not compared in equals violates the contract of hashCode.'),
+ medium('InconsistentOverloads',
+ 'The ordering of parameters in overloaded methods should be as consistent as possible (when viewed from left to right)'),
+ medium('IncrementInForLoopAndHeader',
+ 'This for loop increments the same variable in the header and in the body'),
+ medium('InjectOnConstructorOfAbstractClass',
+ 'Constructors on abstract classes are never directly @Injected, only the constructors of their subclasses can be @Inject\'ed.'),
+ medium('InputStreamSlowMultibyteRead',
+ 'Please also override int read(byte[], int, int), otherwise multi-byte reads from this input stream are likely to be slow.'),
+ medium('InstanceOfAndCastMatchWrongType',
+ 'Casting inside an if block should be plausibly consistent with the instanceof type'),
+ medium('IntLongMath',
+ 'Expression of type int may overflow before being assigned to a long'),
+ medium('IntentBuilderName',
+ 'IntentBuilderName'),
+ medium('InvalidParam',
+ 'This @param tag doesn\'t refer to a parameter of the method.'),
+ medium('InvalidTag',
+ 'This tag is invalid.'),
+ medium('InvalidThrows',
+ 'The documented method doesn\'t actually throw this checked exception.'),
+ medium('IterableAndIterator',
+ 'Class should not implement both `Iterable` and `Iterator`'),
+ medium('JUnit3FloatingPointComparisonWithoutDelta',
+ 'Floating-point comparison without error tolerance'),
+ medium('JUnit4ClassUsedInJUnit3',
+ 'Some JUnit4 construct cannot be used in a JUnit3 context. Convert your class to JUnit4 style to use them.'),
+ medium('JUnitAmbiguousTestClass',
+ 'Test class inherits from JUnit 3\'s TestCase but has JUnit 4 @Test annotations.'),
+ medium('JavaLangClash',
+ 'Never reuse class names from java.lang'),
+ medium('JdkObsolete',
+ 'Suggests alternatives to obsolete JDK classes.'),
+ medium('LockNotBeforeTry',
+ 'Calls to Lock#lock should be immediately followed by a try block which releases the lock.'),
+ medium('LogicalAssignment',
+ 'Assignment where a boolean expression was expected; use == if this assignment wasn\'t expected or add parentheses for clarity.'),
+ medium('MathAbsoluteRandom',
+ 'Math.abs does not always give a positive result. Please consider other methods for positive random numbers.'),
+ medium('MissingCasesInEnumSwitch',
+ 'Switches on enum types should either handle all values, or have a default case.'),
+ medium('MissingDefault',
+ 'The Google Java Style Guide requires that each switch statement includes a default statement group, even if it contains no code. (This requirement is lifted for any switch statement that covers all values of an enum.)'),
+ medium('MissingFail',
+ 'Not calling fail() when expecting an exception masks bugs'),
+ medium('MissingOverride',
+ 'method overrides method in supertype; expected @Override'),
+ medium('ModifiedButNotUsed',
+ 'A collection or proto builder was created, but its values were never accessed.'),
+ medium('ModifyCollectionInEnhancedForLoop',
+ 'Modifying a collection while iterating over it in a loop may cause a ConcurrentModificationException to be thrown.'),
+ medium('MultipleParallelOrSequentialCalls',
+ 'Multiple calls to either parallel or sequential are unnecessary and cause confusion.'),
+ medium('MutableConstantField',
+ 'Constant field declarations should use the immutable type (such as ImmutableList) instead of the general collection interface type (such as List)'),
+ medium('MutableMethodReturnType',
+ 'Method return type should use the immutable type (such as ImmutableList) instead of the general collection interface type (such as List)'),
+ medium('NarrowingCompoundAssignment',
+ 'Compound assignments may hide dangerous casts'),
+ medium('NestedInstanceOfConditions',
+ 'Nested instanceOf conditions of disjoint types create blocks of code that never execute'),
+ medium('NoFunctionalReturnType',
+ 'Instead of returning a functional type, return the actual type that the returned function would return and use lambdas at use site.'),
+ medium('NonAtomicVolatileUpdate',
+ 'This update of a volatile variable is non-atomic'),
+ medium('NonCanonicalStaticMemberImport',
+ 'Static import of member uses non-canonical name'),
+ medium('NonOverridingEquals',
+ 'equals method doesn\'t override Object.equals'),
+ medium('NotCloseable',
+ 'Not closeable'),
+ medium('NullableConstructor',
+ 'Constructors should not be annotated with @Nullable since they cannot return null'),
+ medium('NullableDereference',
+ 'Dereference of possibly-null value'),
+ medium('NullablePrimitive',
+ '@Nullable should not be used for primitive types since they cannot be null'),
+ medium('NullableVoid',
+ 'void-returning methods should not be annotated with @Nullable, since they cannot return null'),
+ medium('ObjectToString',
+ 'Calling toString on Objects that don\'t override toString() doesn\'t provide useful information'),
+ medium('ObjectsHashCodePrimitive',
+ 'Objects.hashCode(Object o) should not be passed a primitive value'),
+ medium('OperatorPrecedence',
+ 'Use grouping parenthesis to make the operator precedence explicit'),
+ medium('OptionalNotPresent',
+ 'One should not call optional.get() inside an if statement that checks !optional.isPresent'),
+ medium('OrphanedFormatString',
+ 'String literal contains format specifiers, but is not passed to a format method'),
+ medium('OverrideThrowableToString',
+ 'To return a custom message with a Throwable class, one should override getMessage() instead of toString() for Throwable.'),
+ medium('Overrides',
+ 'Varargs doesn\'t agree for overridden method'),
+ medium('OverridesGuiceInjectableMethod',
+ 'This method is not annotated with @Inject, but it overrides a method that is annotated with @com.google.inject.Inject. Guice will inject this method, and it is recommended to annotate it explicitly.'),
+ medium('ParameterName',
+ 'Detects `/* name= */`-style comments on actual parameters where the name doesn\'t match the formal parameter'),
+ medium('PreconditionsInvalidPlaceholder',
+ 'Preconditions only accepts the %s placeholder in error message strings'),
+ medium('PrimitiveArrayPassedToVarargsMethod',
+ 'Passing a primitive array to a varargs method is usually wrong'),
+ medium('ProtoRedundantSet',
+ 'A field on a protocol buffer was set twice in the same chained expression.'),
+ medium('ProtosAsKeyOfSetOrMap',
+ 'Protos should not be used as a key to a map, in a set, or in a contains method on a descendant of a collection. Protos have non deterministic ordering and proto equality is deep, which is a performance issue.'),
+ medium('ProvidesFix',
+ 'BugChecker has incorrect ProvidesFix tag, please update'),
+ medium('QualifierOrScopeOnInjectMethod',
+ 'Qualifiers/Scope annotations on @Inject methods don\'t have any effect. Move the qualifier annotation to the binding location.'),
+ medium('QualifierWithTypeUse',
+ 'Injection frameworks currently don\'t understand Qualifiers in TYPE_PARAMETER or TYPE_USE contexts.'),
+ medium('ReachabilityFenceUsage',
+ 'reachabilityFence should always be called inside a finally block'),
+ medium('RedundantThrows',
+ 'Thrown exception is a subtype of another'),
+ medium('ReferenceEquality',
+ 'Comparison using reference equality instead of value equality'),
+ medium('RequiredModifiers',
+ 'This annotation is missing required modifiers as specified by its @RequiredModifiers annotation'),
+ medium('ReturnFromVoid',
+ 'Void methods should not have a @return tag.'),
+ medium('SamShouldBeLast',
+ 'SAM-compatible parameters should be last'),
+ medium('ShortCircuitBoolean',
+ u'Prefer the short-circuiting boolean operators \u0026\u0026 and || to \u0026 and |.'),
+ medium('StaticGuardedByInstance',
+ 'Writes to static fields should not be guarded by instance locks'),
+ medium('StaticQualifiedUsingExpression',
+ 'A static variable or method should be qualified with a class name, not expression'),
+ medium('StreamResourceLeak',
+ 'Streams that encapsulate a closeable resource should be closed using try-with-resources'),
+ medium('StringEquality',
+ 'String comparison using reference equality instead of value equality'),
+ medium('StringSplitter',
+ 'String.split(String) has surprising behavior'),
+ medium('SwigMemoryLeak',
+ 'SWIG generated code that can\'t call a C++ destructor will leak memory'),
+ medium('SynchronizeOnNonFinalField',
+ 'Synchronizing on non-final fields is not safe: if the field is ever updated, different threads may end up locking on different objects.'),
+ medium('SystemExitOutsideMain',
+ 'Code that contains System.exit() is untestable.'),
+ medium('TestExceptionChecker',
+ 'Using @Test(expected=...) is discouraged, since the test will pass if *any* statement in the test method throws the expected exception'),
+ medium('ThreadJoinLoop',
+ 'Thread.join needs to be surrounded by a loop until it succeeds, as in Uninterruptibles.joinUninterruptibly.'),
+ medium('ThreadLocalUsage',
+ 'ThreadLocals should be stored in static fields'),
+ medium('ThreadPriorityCheck',
+ 'Relying on the thread scheduler is discouraged; see Effective Java Item 72 (2nd edition) / 84 (3rd edition).'),
+ medium('ThreeLetterTimeZoneID',
+ 'Three-letter time zone identifiers are deprecated, may be ambiguous, and might not do what you intend; the full IANA time zone ID should be used instead.'),
+ medium('ToStringReturnsNull',
+ 'An implementation of Object.toString() should never return null.'),
+ medium('TruthAssertExpected',
+ 'The actual and expected values appear to be swapped, which results in poor assertion failure messages. The actual value should come first.'),
+ medium('TruthConstantAsserts',
+ 'Truth Library assert is called on a constant.'),
+ medium('TruthIncompatibleType',
+ 'Argument is not compatible with the subject\'s type.'),
+ medium('TypeNameShadowing',
+ 'Type parameter declaration shadows another named type'),
+ medium('TypeParameterShadowing',
+ 'Type parameter declaration overrides another type parameter already declared'),
+ medium('TypeParameterUnusedInFormals',
+ 'Declaring a type parameter that is only used in the return type is a misuse of generics: operations on the type parameter are unchecked, it hides unsafe casts at invocations of the method, and it interacts badly with method overload resolution.'),
+ medium('URLEqualsHashCode',
+ 'Avoid hash-based containers of java.net.URL--the containers rely on equals() and hashCode(), which cause java.net.URL to make blocking internet connections.'),
+ medium('UndefinedEquals',
+ 'Collection, Iterable, Multimap, and Queue do not have well-defined equals behavior'),
+ medium('UnnecessaryDefaultInEnumSwitch',
+ 'Switch handles all enum values: an explicit default case is unnecessary and defeats error checking for non-exhaustive switches.'),
+ medium('UnnecessaryParentheses',
+ 'Unnecessary use of grouping parentheses'),
+ medium('UnsafeFinalization',
+ 'Finalizer may run before native code finishes execution'),
+ medium('UnsafeReflectiveConstructionCast',
+ 'Prefer `asSubclass` instead of casting the result of `newInstance`, to detect classes of incorrect type before invoking their constructors.This way, if the class is of the incorrect type,it will throw an exception before invoking its constructor.'),
+ medium('UnsynchronizedOverridesSynchronized',
+ 'Unsynchronized method overrides a synchronized method.'),
+ medium('Unused',
+ 'Unused.'),
+ medium('UnusedException',
+ 'This catch block catches an exception and re-throws another, but swallows the caught exception rather than setting it as a cause. This can make debugging harder.'),
+ medium('UseCorrectAssertInTests',
+ 'Java assert is used in test. For testing purposes Assert.* matchers should be used.'),
+ medium('UserHandle',
+ 'UserHandle'),
+ medium('UserHandleName',
+ 'UserHandleName'),
+ medium('Var',
+ 'Non-constant variable missing @Var annotation'),
+ medium('VariableNameSameAsType',
+ 'variableName and type with the same name would refer to the static field instead of the class'),
+ medium('WaitNotInLoop',
+ 'Because of spurious wakeups, Object.wait() and Condition.await() must always be called in a loop'),
+ medium('WakelockReleasedDangerously',
+ 'A wakelock acquired with a timeout may be released by the system before calling `release`, even after checking `isHeld()`. If so, it will throw a RuntimeException. Please wrap in a try/catch block.'),
+ java_medium('Found raw type',
+ [r'.*\.java:.*: warning: \[rawtypes\] found raw type']),
+ java_medium('Redundant cast',
+ [r'.*\.java:.*: warning: \[cast\] redundant cast to']),
+ java_medium('Static method should be qualified',
+ [r'.*\.java:.*: warning: \[static\] static method should be qualified']),
+ medium('AbstractInner'),
+ medium('CallbackName'),
+ medium('ExecutorRegistration'),
+ medium('JavaApiUsedByMainlineModule'),
+ medium('ListenerLast'),
+ medium('MissingBuildMethod'),
+ medium('NoByteOrShort'),
+ medium('OverlappingConstants'),
+ medium('SetterReturnsThis'),
+ medium('Typo'),
+ medium('UseIcu'),
+ high('AndroidInjectionBeforeSuper',
+ 'AndroidInjection.inject() should always be invoked before calling super.lifecycleMethod()'),
+ high('AndroidJdkLibsChecker',
+ 'Use of class, field, or method that is not compatible with legacy Android devices'),
+ high('ArrayEquals',
+ 'Reference equality used to compare arrays'),
+ high('ArrayFillIncompatibleType',
+ 'Arrays.fill(Object[], Object) called with incompatible types.'),
+ high('ArrayHashCode',
+ 'hashcode method on array does not hash array contents'),
+ high('ArrayReturn',
+ 'ArrayReturn'),
+ high('ArrayToString',
+ 'Calling toString on an array does not provide useful information'),
+ high('ArraysAsListPrimitiveArray',
+ 'Arrays.asList does not autobox primitive arrays, as one might expect.'),
+ high('AssistedInjectAndInjectOnSameConstructor',
+ '@AssistedInject and @Inject cannot be used on the same constructor.'),
+ high('AsyncCallableReturnsNull',
+ 'AsyncCallable should not return a null Future, only a Future whose result is null.'),
+ high('AsyncFunctionReturnsNull',
+ 'AsyncFunction should not return a null Future, only a Future whose result is null.'),
+ high('AutoFactoryAtInject',
+ '@AutoFactory and @Inject should not be used in the same type.'),
+ high('AutoValueConstructorOrderChecker',
+ 'Arguments to AutoValue constructor are in the wrong order'),
+ high('BadShiftAmount',
+ 'Shift by an amount that is out of range'),
+ high('BundleDeserializationCast',
+ 'Object serialized in Bundle may have been flattened to base type.'),
+ high('ChainingConstructorIgnoresParameter',
+ 'The called constructor accepts a parameter with the same name and type as one of its caller\'s parameters, but its caller doesn\'t pass that parameter to it. It\'s likely that it was intended to.'),
+ high('CheckReturnValue',
+ 'Ignored return value of method that is annotated with @CheckReturnValue'),
+ high('ClassName',
+ 'The source file name should match the name of the top-level class it contains'),
+ high('CollectionIncompatibleType',
+ 'Incompatible type as argument to Object-accepting Java collections method'),
+ high('ComparableType',
+ u'Implementing \'Comparable\u003cT>\' where T is not compatible with the implementing class.'),
+ high('ComparingThisWithNull',
+ 'this == null is always false, this != null is always true'),
+ high('ComparisonContractViolated',
+ 'This comparison method violates the contract'),
+ high('ComparisonOutOfRange',
+ 'Comparison to value that is out of range for the compared type'),
+ high('CompatibleWithAnnotationMisuse',
+ '@CompatibleWith\'s value is not a type argument.'),
+ high('CompileTimeConstant',
+ 'Non-compile-time constant expression passed to parameter with @CompileTimeConstant type annotation.'),
+ high('ComplexBooleanConstant',
+ 'Non-trivial compile time constant boolean expressions shouldn\'t be used.'),
+ high('ConditionalExpressionNumericPromotion',
+ 'A conditional expression with numeric operands of differing types will perform binary numeric promotion of the operands; when these operands are of reference types, the expression\'s result may not be of the expected type.'),
+ high('ConstantOverflow',
+ 'Compile-time constant expression overflows'),
+ high('DaggerProvidesNull',
+ 'Dagger @Provides methods may not return null unless annotated with @Nullable'),
+ high('DeadException',
+ 'Exception created but not thrown'),
+ high('DeadThread',
+ 'Thread created but not started'),
java_high('Deprecated item is not annotated with @Deprecated',
[r".*\.java:.*: warning: \[.*\] .+ is not annotated with @Deprecated$"]),
- java_high('Division by integer literal zero',
- [r".*: warning: \[DivZero\] .+"]),
- java_high('This method should not be called.',
- [r".*: warning: \[DoNotCall\] .+"]),
- java_high('Empty statement after if',
- [r".*: warning: \[EmptyIf\] .+"]),
- java_high('== NaN always returns false; use the isNaN methods instead',
- [r".*: warning: \[EqualsNaN\] .+"]),
- java_high('== must be used in equals method to check equality to itself or an infinite loop will occur.',
- [r".*: warning: \[EqualsReference\] .+"]),
- java_high('Comparing different pairs of fields/getters in an equals implementation is probably a mistake.',
- [r".*: warning: \[EqualsWrongThing\] .+"]),
- java_high('Method annotated @ForOverride must be protected or package-private and only invoked from declaring class, or from an override of the method',
- [r".*: warning: \[ForOverride\] .+"]),
- java_high('Invalid printf-style format string',
- [r".*: warning: \[FormatString\] .+"]),
- java_high('Invalid format string passed to formatting method.',
- [r".*: warning: \[FormatStringAnnotation\] .+"]),
- java_high('Casting a lambda to this @FunctionalInterface can cause a behavior change from casting to a functional superinterface, which is surprising to users. Prefer decorator methods to this surprising behavior.',
- [r".*: warning: \[FunctionalInterfaceMethodChanged\] .+"]),
- java_high('Futures.getChecked requires a checked exception type with a standard constructor.',
- [r".*: warning: \[FuturesGetCheckedIllegalExceptionType\] .+"]),
- java_high('DoubleMath.fuzzyEquals should never be used in an Object.equals() method',
- [r".*: warning: \[FuzzyEqualsShouldNotBeUsedInEqualsMethod\] .+"]),
- java_high('Calling getClass() on an annotation may return a proxy class',
- [r".*: warning: \[GetClassOnAnnotation\] .+"]),
- java_high('Calling getClass() on an object of type Class returns the Class object for java.lang.Class; you probably meant to operate on the object directly',
- [r".*: warning: \[GetClassOnClass\] .+"]),
- java_high('Checks for unguarded accesses to fields and methods with @GuardedBy annotations',
- [r".*: warning: \[GuardedBy\] .+"]),
- java_high('Scope annotation on implementation class of AssistedInject factory is not allowed',
- [r".*: warning: \[GuiceAssistedInjectScoping\] .+"]),
- java_high('A constructor cannot have two @Assisted parameters of the same type unless they are disambiguated with named @Assisted annotations.',
- [r".*: warning: \[GuiceAssistedParameters\] .+"]),
- java_high('Although Guice allows injecting final fields, doing so is disallowed because the injected value may not be visible to other threads.',
- [r".*: warning: \[GuiceInjectOnFinalField\] .+"]),
- java_high('contains() is a legacy method that is equivalent to containsValue()',
- [r".*: warning: \[HashtableContains\] .+"]),
- java_high('A binary expression where both operands are the same is usually incorrect.',
- [r".*: warning: \[IdentityBinaryExpression\] .+"]),
- java_high('Type declaration annotated with @Immutable is not immutable',
- [r".*: warning: \[Immutable\] .+"]),
- java_high('Modifying an immutable collection is guaranteed to throw an exception and leave the collection unmodified',
- [r".*: warning: \[ImmutableModification\] .+"]),
- java_high('Passing argument to a generic method with an incompatible type.',
- [r".*: warning: \[IncompatibleArgumentType\] .+"]),
- java_high('The first argument to indexOf is a Unicode code point, and the second is the index to start the search from',
- [r".*: warning: \[IndexOfChar\] .+"]),
- java_high('Conditional expression in varargs call contains array and non-array arguments',
- [r".*: warning: \[InexactVarargsConditional\] .+"]),
- java_high('This method always recurses, and will cause a StackOverflowError',
- [r".*: warning: \[InfiniteRecursion\] .+"]),
- java_high('A scoping annotation\'s Target should include TYPE and METHOD.',
- [r".*: warning: \[InjectInvalidTargetingOnScopingAnnotation\] .+"]),
- java_high('Using more than one qualifier annotation on the same element is not allowed.',
- [r".*: warning: \[InjectMoreThanOneQualifier\] .+"]),
- java_high('A class can be annotated with at most one scope annotation.',
- [r".*: warning: \[InjectMoreThanOneScopeAnnotationOnClass\] .+"]),
- java_high('Members shouldn\'t be annotated with @Inject if constructor is already annotated @Inject',
- [r".*: warning: \[InjectOnMemberAndConstructor\] .+"]),
- java_high('Scope annotation on an interface or abstact class is not allowed',
- [r".*: warning: \[InjectScopeAnnotationOnInterfaceOrAbstractClass\] .+"]),
- java_high('Scoping and qualifier annotations must have runtime retention.',
- [r".*: warning: \[InjectScopeOrQualifierAnnotationRetention\] .+"]),
- java_high('Injected constructors cannot be optional nor have binding annotations',
- [r".*: warning: \[InjectedConstructorAnnotations\] .+"]),
- java_high('A standard cryptographic operation is used in a mode that is prone to vulnerabilities',
- [r".*: warning: \[InsecureCryptoUsage\] .+"]),
- java_high('Invalid syntax used for a regular expression',
- [r".*: warning: \[InvalidPatternSyntax\] .+"]),
- java_high('Invalid time zone identifier. TimeZone.getTimeZone(String) will silently return GMT instead of the time zone you intended.',
- [r".*: warning: \[InvalidTimeZoneID\] .+"]),
- java_high('The argument to Class#isInstance(Object) should not be a Class',
- [r".*: warning: \[IsInstanceOfClass\] .+"]),
- java_high('Log tag too long, cannot exceed 23 characters.',
- [r".*: warning: \[IsLoggableTagLength\] .+"]),
- java_high(u'Path implements Iterable\u003cPath>; prefer Collection\u003cPath> for clarity',
- [r".*: warning: \[IterablePathParameter\] .+"]),
- java_high('jMock tests must have a @RunWith(JMock.class) annotation, or the Mockery field must have a @Rule JUnit annotation',
- [r".*: warning: \[JMockTestWithoutRunWithOrRuleAnnotation\] .+"]),
- java_high('Test method will not be run; please correct method signature (Should be public, non-static, and method name should begin with "test").',
- [r".*: warning: \[JUnit3TestNotRun\] .+"]),
- java_high('This method should be static',
- [r".*: warning: \[JUnit4ClassAnnotationNonStatic\] .+"]),
- java_high('setUp() method will not be run; please add JUnit\'s @Before annotation',
- [r".*: warning: \[JUnit4SetUpNotRun\] .+"]),
- java_high('tearDown() method will not be run; please add JUnit\'s @After annotation',
- [r".*: warning: \[JUnit4TearDownNotRun\] .+"]),
- java_high('This looks like a test method but is not run; please add @Test and @Ignore, or, if this is a helper method, reduce its visibility.',
- [r".*: warning: \[JUnit4TestNotRun\] .+"]),
- java_high('An object is tested for reference equality to itself using JUnit library.',
- [r".*: warning: \[JUnitAssertSameCheck\] .+"]),
- java_high('Use of class, field, or method that is not compatible with JDK 7',
- [r".*: warning: \[Java7ApiChecker\] .+"]),
- java_high('Abstract and default methods are not injectable with javax.inject.Inject',
- [r".*: warning: \[JavaxInjectOnAbstractMethod\] .+"]),
- java_high('@javax.inject.Inject cannot be put on a final field.',
- [r".*: warning: \[JavaxInjectOnFinalField\] .+"]),
- java_high('This pattern will silently corrupt certain byte sequences from the serialized protocol message. Use ByteString or byte[] directly',
- [r".*: warning: \[LiteByteStringUtf8\] .+"]),
- java_high('This method does not acquire the locks specified by its @LockMethod annotation',
- [r".*: warning: \[LockMethodChecker\] .+"]),
- java_high('Prefer \'L\' to \'l\' for the suffix to long literals',
- [r".*: warning: \[LongLiteralLowerCaseSuffix\] .+"]),
- java_high('Loop condition is never modified in loop body.',
- [r".*: warning: \[LoopConditionChecker\] .+"]),
- java_high('Math.round(Integer) results in truncation',
- [r".*: warning: \[MathRoundIntLong\] .+"]),
- java_high('Certain resources in `android.R.string` have names that do not match their content',
- [r".*: warning: \[MislabeledAndroidString\] .+"]),
- java_high('Overriding method is missing a call to overridden super method',
- [r".*: warning: \[MissingSuperCall\] .+"]),
- java_high('A terminating method call is required for a test helper to have any effect.',
- [r".*: warning: \[MissingTestCall\] .+"]),
- java_high('Use of "YYYY" (week year) in a date pattern without "ww" (week in year). You probably meant to use "yyyy" (year) instead.',
- [r".*: warning: \[MisusedWeekYear\] .+"]),
- java_high('A bug in Mockito will cause this test to fail at runtime with a ClassCastException',
- [r".*: warning: \[MockitoCast\] .+"]),
- java_high('Missing method call for verify(mock) here',
- [r".*: warning: \[MockitoUsage\] .+"]),
- java_high('Using a collection function with itself as the argument.',
- [r".*: warning: \[ModifyingCollectionWithItself\] .+"]),
- java_high('This class has more than one @Inject-annotated constructor. Please remove the @Inject annotation from all but one of them.',
- [r".*: warning: \[MoreThanOneInjectableConstructor\] .+"]),
- java_high('The result of this method must be closed.',
- [r".*: warning: \[MustBeClosedChecker\] .+"]),
- java_high('The first argument to nCopies is the number of copies, and the second is the item to copy',
- [r".*: warning: \[NCopiesOfChar\] .+"]),
- java_high('@NoAllocation was specified on this method, but something was found that would trigger an allocation',
- [r".*: warning: \[NoAllocation\] .+"]),
- java_high('Static import of type uses non-canonical name',
- [r".*: warning: \[NonCanonicalStaticImport\] .+"]),
- java_high('@CompileTimeConstant parameters should be final or effectively final',
- [r".*: warning: \[NonFinalCompileTimeConstant\] .+"]),
- java_high('Calling getAnnotation on an annotation that is not retained at runtime.',
- [r".*: warning: \[NonRuntimeAnnotation\] .+"]),
- java_high('This conditional expression may evaluate to null, which will result in an NPE when the result is unboxed.',
- [r".*: warning: \[NullTernary\] .+"]),
- java_high('Numeric comparison using reference equality instead of value equality',
- [r".*: warning: \[NumericEquality\] .+"]),
- java_high('Comparison using reference equality instead of value equality',
- [r".*: warning: \[OptionalEquality\] .+"]),
- java_high('Annotations cannot be both Scope annotations and Qualifier annotations: this causes confusion when trying to use them.',
- [r".*: warning: \[OverlappingQualifierAndScopeAnnotation\] .+"]),
- java_high('This method is not annotated with @Inject, but it overrides a method that is annotated with @javax.inject.Inject. The method will not be Injected.',
- [r".*: warning: \[OverridesJavaxInjectableMethod\] .+"]),
- java_high('Declaring types inside package-info.java files is very bad form',
- [r".*: warning: \[PackageInfo\] .+"]),
- java_high('Method parameter has wrong package',
- [r".*: warning: \[ParameterPackage\] .+"]),
- java_high('Detects classes which implement Parcelable but don\'t have CREATOR',
- [r".*: warning: \[ParcelableCreator\] .+"]),
- java_high('Literal passed as first argument to Preconditions.checkNotNull() can never be null',
- [r".*: warning: \[PreconditionsCheckNotNull\] .+"]),
- java_high('First argument to `Preconditions.checkNotNull()` is a primitive rather than an object reference',
- [r".*: warning: \[PreconditionsCheckNotNullPrimitive\] .+"]),
- java_high('Using ::equals or ::isInstance as an incompatible Predicate; the predicate will always return false',
- [r".*: warning: \[PredicateIncompatibleType\] .+"]),
- java_high('Access to a private protocol buffer field is forbidden. This protocol buffer carries a security contract, and can only be created using an approved library. Direct access to the fields is forbidden.',
- [r".*: warning: \[PrivateSecurityContractProtoAccess\] .+"]),
- java_high('Protobuf fields cannot be null.',
- [r".*: warning: \[ProtoFieldNullComparison\] .+"]),
- java_high('Comparing protobuf fields of type String using reference equality',
- [r".*: warning: \[ProtoStringFieldReferenceEquality\] .+"]),
- java_high('To get the tag number of a protocol buffer enum, use getNumber() instead.',
- [r".*: warning: \[ProtocolBufferOrdinal\] .+"]),
- java_high('@Provides methods need to be declared in a Module to have any effect.',
- [r".*: warning: \[ProvidesMethodOutsideOfModule\] .+"]),
- java_high('Casting a random number in the range [0.0, 1.0) to an integer or long always results in 0.',
- [r".*: warning: \[RandomCast\] .+"]),
- java_high('Use Random.nextInt(int). Random.nextInt() % n can have negative results',
- [r".*: warning: \[RandomModInteger\] .+"]),
- java_high('Return value of android.graphics.Rect.intersect() must be checked',
- [r".*: warning: \[RectIntersectReturnValueIgnored\] .+"]),
- java_high('Use of method or class annotated with @RestrictTo',
- [r".*: warning: \[RestrictTo\] .+"]),
- java_high(' Check for non-whitelisted callers to RestrictedApiChecker.',
- [r".*: warning: \[RestrictedApiChecker\] .+"]),
- java_high('Return value of this method must be used',
- [r".*: warning: \[ReturnValueIgnored\] .+"]),
- java_high('Variable assigned to itself',
- [r".*: warning: \[SelfAssignment\] .+"]),
- java_high('An object is compared to itself',
- [r".*: warning: \[SelfComparison\] .+"]),
- java_high('Testing an object for equality with itself will always be true.',
- [r".*: warning: \[SelfEquals\] .+"]),
- java_high('This method must be called with an even number of arguments.',
- [r".*: warning: \[ShouldHaveEvenArgs\] .+"]),
- java_high('Comparison of a size >= 0 is always true, did you intend to check for non-emptiness?',
- [r".*: warning: \[SizeGreaterThanOrEqualsZero\] .+"]),
- java_high('Static and default interface methods are not natively supported on older Android devices. ',
- [r".*: warning: \[StaticOrDefaultInterfaceMethod\] .+"]),
- java_high('Calling toString on a Stream does not provide useful information',
- [r".*: warning: \[StreamToString\] .+"]),
- java_high('StringBuilder does not have a char constructor; this invokes the int constructor.',
- [r".*: warning: \[StringBuilderInitWithChar\] .+"]),
- java_high('String.substring(0) returns the original String',
- [r".*: warning: \[SubstringOfZero\] .+"]),
- java_high('Suppressing "deprecated" is probably a typo for "deprecation"',
- [r".*: warning: \[SuppressWarningsDeprecated\] .+"]),
- java_high('throwIfUnchecked(knownCheckedException) is a no-op.',
- [r".*: warning: \[ThrowIfUncheckedKnownChecked\] .+"]),
- java_high('Throwing \'null\' always results in a NullPointerException being thrown.',
- [r".*: warning: \[ThrowNull\] .+"]),
- java_high('isEqualTo should not be used to test an object for equality with itself; the assertion will never fail.',
- [r".*: warning: \[TruthSelfEquals\] .+"]),
- java_high('Catching Throwable/Error masks failures from fail() or assert*() in the try block',
- [r".*: warning: \[TryFailThrowable\] .+"]),
- java_high('Type parameter used as type qualifier',
- [r".*: warning: \[TypeParameterQualifier\] .+"]),
- java_high('This method does not acquire the locks specified by its @UnlockMethod annotation',
- [r".*: warning: \[UnlockMethod\] .+"]),
- java_high('Non-generic methods should not be invoked with type arguments',
- [r".*: warning: \[UnnecessaryTypeArgument\] .+"]),
- java_high('Instance created but never used',
- [r".*: warning: \[UnusedAnonymousClass\] .+"]),
- java_high('Collection is modified in place, but the result is not used',
- [r".*: warning: \[UnusedCollectionModifiedInPlace\] .+"]),
- java_high('`var` should not be used as a type name.',
- [r".*: warning: \[VarTypeName\] .+"]),
+ high('DivZero',
+ 'Division by integer literal zero'),
+ high('DoNotCall',
+ 'This method should not be called.'),
+ high('EmptyIf',
+ 'Empty statement after if'),
+ high('EqualsNaN',
+ '== NaN always returns false; use the isNaN methods instead'),
+ high('EqualsReference',
+ '== must be used in equals method to check equality to itself or an infinite loop will occur.'),
+ high('EqualsWrongThing',
+ 'Comparing different pairs of fields/getters in an equals implementation is probably a mistake.'),
+ high('ForOverride',
+ 'Method annotated @ForOverride must be protected or package-private and only invoked from declaring class, or from an override of the method'),
+ high('FormatString',
+ 'Invalid printf-style format string'),
+ high('FormatStringAnnotation',
+ 'Invalid format string passed to formatting method.'),
+ high('FunctionalInterfaceMethodChanged',
+ 'Casting a lambda to this @FunctionalInterface can cause a behavior change from casting to a functional superinterface, which is surprising to users. Prefer decorator methods to this surprising behavior.'),
+ high('FuturesGetCheckedIllegalExceptionType',
+ 'Futures.getChecked requires a checked exception type with a standard constructor.'),
+ high('FuzzyEqualsShouldNotBeUsedInEqualsMethod',
+ 'DoubleMath.fuzzyEquals should never be used in an Object.equals() method'),
+ high('GetClassOnAnnotation',
+ 'Calling getClass() on an annotation may return a proxy class'),
+ high('GetClassOnClass',
+ 'Calling getClass() on an object of type Class returns the Class object for java.lang.Class; you probably meant to operate on the object directly'),
+ high('GuardedBy',
+ 'Checks for unguarded accesses to fields and methods with @GuardedBy annotations'),
+ high('GuiceAssistedInjectScoping',
+ 'Scope annotation on implementation class of AssistedInject factory is not allowed'),
+ high('GuiceAssistedParameters',
+ 'A constructor cannot have two @Assisted parameters of the same type unless they are disambiguated with named @Assisted annotations.'),
+ high('GuiceInjectOnFinalField',
+ 'Although Guice allows injecting final fields, doing so is disallowed because the injected value may not be visible to other threads.'),
+ high('HashtableContains',
+ 'contains() is a legacy method that is equivalent to containsValue()'),
+ high('IdentityBinaryExpression',
+ 'A binary expression where both operands are the same is usually incorrect.'),
+ high('Immutable',
+ 'Type declaration annotated with @Immutable is not immutable'),
+ high('ImmutableModification',
+ 'Modifying an immutable collection is guaranteed to throw an exception and leave the collection unmodified'),
+ high('IncompatibleArgumentType',
+ 'Passing argument to a generic method with an incompatible type.'),
+ high('IndexOfChar',
+ 'The first argument to indexOf is a Unicode code point, and the second is the index to start the search from'),
+ high('InexactVarargsConditional',
+ 'Conditional expression in varargs call contains array and non-array arguments'),
+ high('InfiniteRecursion',
+ 'This method always recurses, and will cause a StackOverflowError'),
+ high('InjectInvalidTargetingOnScopingAnnotation',
+ 'A scoping annotation\'s Target should include TYPE and METHOD.'),
+ high('InjectMoreThanOneQualifier',
+ 'Using more than one qualifier annotation on the same element is not allowed.'),
+ high('InjectMoreThanOneScopeAnnotationOnClass',
+ 'A class can be annotated with at most one scope annotation.'),
+ high('InjectOnMemberAndConstructor',
+ 'Members shouldn\'t be annotated with @Inject if constructor is already annotated @Inject'),
+ high('InjectScopeAnnotationOnInterfaceOrAbstractClass',
+ 'Scope annotation on an interface or abstact class is not allowed'),
+ high('InjectScopeOrQualifierAnnotationRetention',
+ 'Scoping and qualifier annotations must have runtime retention.'),
+ high('InjectedConstructorAnnotations',
+ 'Injected constructors cannot be optional nor have binding annotations'),
+ high('InsecureCryptoUsage',
+ 'A standard cryptographic operation is used in a mode that is prone to vulnerabilities'),
+ high('InvalidPatternSyntax',
+ 'Invalid syntax used for a regular expression'),
+ high('InvalidTimeZoneID',
+ 'Invalid time zone identifier. TimeZone.getTimeZone(String) will silently return GMT instead of the time zone you intended.'),
+ high('IsInstanceOfClass',
+ 'The argument to Class#isInstance(Object) should not be a Class'),
+ high('IsLoggableTagLength',
+ 'Log tag too long, cannot exceed 23 characters.'),
+ high('IterablePathParameter',
+ u'Path implements Iterable\u003cPath>; prefer Collection\u003cPath> for clarity'),
+ high('JMockTestWithoutRunWithOrRuleAnnotation',
+ 'jMock tests must have a @RunWith(JMock.class) annotation, or the Mockery field must have a @Rule JUnit annotation'),
+ high('JUnit3TestNotRun',
+ 'Test method will not be run; please correct method signature (Should be public, non-static, and method name should begin with "test").'),
+ high('JUnit4ClassAnnotationNonStatic',
+ 'This method should be static'),
+ high('JUnit4SetUpNotRun',
+ 'setUp() method will not be run; please add JUnit\'s @Before annotation'),
+ high('JUnit4TearDownNotRun',
+ 'tearDown() method will not be run; please add JUnit\'s @After annotation'),
+ high('JUnit4TestNotRun',
+ 'This looks like a test method but is not run; please add @Test and @Ignore, or, if this is a helper method, reduce its visibility.'),
+ high('JUnitAssertSameCheck',
+ 'An object is tested for reference equality to itself using JUnit library.'),
+ high('Java7ApiChecker',
+ 'Use of class, field, or method that is not compatible with JDK 7'),
+ high('JavaxInjectOnAbstractMethod',
+ 'Abstract and default methods are not injectable with javax.inject.Inject'),
+ high('JavaxInjectOnFinalField',
+ '@javax.inject.Inject cannot be put on a final field.'),
+ high('LiteByteStringUtf8',
+ 'This pattern will silently corrupt certain byte sequences from the serialized protocol message. Use ByteString or byte[] directly'),
+ high('LockMethodChecker',
+ 'This method does not acquire the locks specified by its @LockMethod annotation'),
+ high('LongLiteralLowerCaseSuffix',
+ 'Prefer \'L\' to \'l\' for the suffix to long literals'),
+ high('LoopConditionChecker',
+ 'Loop condition is never modified in loop body.'),
+ high('MathRoundIntLong',
+ 'Math.round(Integer) results in truncation'),
+ high('MislabeledAndroidString',
+ 'Certain resources in `android.R.string` have names that do not match their content'),
+ high('MissingSuperCall',
+ 'Overriding method is missing a call to overridden super method'),
+ high('MissingTestCall',
+ 'A terminating method call is required for a test helper to have any effect.'),
+ high('MisusedWeekYear',
+ 'Use of "YYYY" (week year) in a date pattern without "ww" (week in year). You probably meant to use "yyyy" (year) instead.'),
+ high('MockitoCast',
+ 'A bug in Mockito will cause this test to fail at runtime with a ClassCastException'),
+ high('MockitoUsage',
+ 'Missing method call for verify(mock) here'),
+ high('ModifyingCollectionWithItself',
+ 'Using a collection function with itself as the argument.'),
+ high('MoreThanOneInjectableConstructor',
+ 'This class has more than one @Inject-annotated constructor. Please remove the @Inject annotation from all but one of them.'),
+ high('MustBeClosedChecker',
+ 'The result of this method must be closed.'),
+ high('NCopiesOfChar',
+ 'The first argument to nCopies is the number of copies, and the second is the item to copy'),
+ high('NoAllocation',
+ '@NoAllocation was specified on this method, but something was found that would trigger an allocation'),
+ high('NonCanonicalStaticImport',
+ 'Static import of type uses non-canonical name'),
+ high('NonFinalCompileTimeConstant',
+ '@CompileTimeConstant parameters should be final or effectively final'),
+ high('NonRuntimeAnnotation',
+ 'Calling getAnnotation on an annotation that is not retained at runtime.'),
+ high('NullTernary',
+ 'This conditional expression may evaluate to null, which will result in an NPE when the result is unboxed.'),
+ high('NumericEquality',
+ 'Numeric comparison using reference equality instead of value equality'),
+ high('OptionalEquality',
+ 'Comparison using reference equality instead of value equality'),
+ high('OverlappingQualifierAndScopeAnnotation',
+ 'Annotations cannot be both Scope annotations and Qualifier annotations: this causes confusion when trying to use them.'),
+ high('OverridesJavaxInjectableMethod',
+ 'This method is not annotated with @Inject, but it overrides a method that is annotated with @javax.inject.Inject. The method will not be Injected.'),
+ high('PackageInfo',
+ 'Declaring types inside package-info.java files is very bad form'),
+ high('ParameterPackage',
+ 'Method parameter has wrong package'),
+ high('ParcelableCreator',
+ 'Detects classes which implement Parcelable but don\'t have CREATOR'),
+ high('PreconditionsCheckNotNull',
+ 'Literal passed as first argument to Preconditions.checkNotNull() can never be null'),
+ high('PreconditionsCheckNotNullPrimitive',
+ 'First argument to `Preconditions.checkNotNull()` is a primitive rather than an object reference'),
+ high('PredicateIncompatibleType',
+ 'Using ::equals or ::isInstance as an incompatible Predicate; the predicate will always return false'),
+ high('PrivateSecurityContractProtoAccess',
+ 'Access to a private protocol buffer field is forbidden. This protocol buffer carries a security contract, and can only be created using an approved library. Direct access to the fields is forbidden.'),
+ high('ProtoFieldNullComparison',
+ 'Protobuf fields cannot be null.'),
+ high('ProtoStringFieldReferenceEquality',
+ 'Comparing protobuf fields of type String using reference equality'),
+ high('ProtocolBufferOrdinal',
+ 'To get the tag number of a protocol buffer enum, use getNumber() instead.'),
+ high('ProvidesMethodOutsideOfModule',
+ '@Provides methods need to be declared in a Module to have any effect.'),
+ high('RandomCast',
+ 'Casting a random number in the range [0.0, 1.0) to an integer or long always results in 0.'),
+ high('RandomModInteger',
+ 'Use Random.nextInt(int). Random.nextInt() % n can have negative results'),
+ high('RectIntersectReturnValueIgnored',
+ 'Return value of android.graphics.Rect.intersect() must be checked'),
+ high('RestrictTo',
+ 'Use of method or class annotated with @RestrictTo'),
+ high('RestrictedApiChecker',
+ ' Check for non-whitelisted callers to RestrictedApiChecker.'),
+ high('ReturnValueIgnored',
+ 'Return value of this method must be used'),
+ high('SelfAssignment',
+ 'Variable assigned to itself'),
+ high('SelfComparison',
+ 'An object is compared to itself'),
+ high('SelfEquals',
+ 'Testing an object for equality with itself will always be true.'),
+ high('ShouldHaveEvenArgs',
+ 'This method must be called with an even number of arguments.'),
+ high('SizeGreaterThanOrEqualsZero',
+ 'Comparison of a size >= 0 is always true, did you intend to check for non-emptiness?'),
+ high('StaticOrDefaultInterfaceMethod',
+ 'Static and default interface methods are not natively supported on older Android devices. '),
+ high('StreamToString',
+ 'Calling toString on a Stream does not provide useful information'),
+ high('StringBuilderInitWithChar',
+ 'StringBuilder does not have a char constructor; this invokes the int constructor.'),
+ high('SubstringOfZero',
+ 'String.substring(0) returns the original String'),
+ high('SuppressWarningsDeprecated',
+ 'Suppressing "deprecated" is probably a typo for "deprecation"'),
+ high('ThrowIfUncheckedKnownChecked',
+ 'throwIfUnchecked(knownCheckedException) is a no-op.'),
+ high('ThrowNull',
+ 'Throwing \'null\' always results in a NullPointerException being thrown.'),
+ high('TruthSelfEquals',
+ 'isEqualTo should not be used to test an object for equality with itself; the assertion will never fail.'),
+ high('TryFailThrowable',
+ 'Catching Throwable/Error masks failures from fail() or assert*() in the try block'),
+ high('TypeParameterQualifier',
+ 'Type parameter used as type qualifier'),
+ high('UnlockMethod',
+ 'This method does not acquire the locks specified by its @UnlockMethod annotation'),
+ high('UnnecessaryTypeArgument',
+ 'Non-generic methods should not be invoked with type arguments'),
+ high('UnusedAnonymousClass',
+ 'Instance created but never used'),
+ high('UnusedCollectionModifiedInPlace',
+ 'Collection is modified in place, but the result is not used'),
+ high('VarTypeName',
+ '`var` should not be used as a type name.'),
+
# Other javac tool warnings
java_medium('addNdkApiCoverage failed to getPackage',
[r".*: warning: addNdkApiCoverage failed to getPackage"]),
diff --git a/tools/warn/make_warn_patterns.py b/tools/warn/make_warn_patterns.py
index 327fce4..dd6a1b0 100644
--- a/tools/warn/make_warn_patterns.py
+++ b/tools/warn/make_warn_patterns.py
@@ -53,6 +53,9 @@
{'category': 'make', 'severity': Severity.MEDIUM,
'description': 'make: please convert to soong',
'patterns': [r".*: warning: .* has been deprecated. Please convert to Soong."]},
+ {'category': 'make', 'severity': Severity.MEDIUM,
+ 'description': 'make: deprecated macros',
+ 'patterns': [r".*\.mk:.* warning:.* [A-Z_]+ (is|has been) deprecated."]},
]
diff --git a/tools/warn/other_warn_patterns.py b/tools/warn/other_warn_patterns.py
index 19a4e38..1350936 100644
--- a/tools/warn/other_warn_patterns.py
+++ b/tools/warn/other_warn_patterns.py
@@ -112,10 +112,20 @@
kotlin('never used parameter or variable',
[r".*\.kt:.*: warning: (parameter|variable) '.*' is never used$",
r".*\.kt:.*: warning: (parameter|variable) '.*' is never used, could be renamed to _$"]),
+ kotlin('initializer is redundant',
+ [r".*\.kt:.*: warning: .* initializer is redundant$"]),
+ kotlin('elvis operator always returns ...',
+ [r".*\.kt:.*: warning: elvis operator \(\?:\) always returns .+"]),
+ kotlin('shadowed name',
+ [r".*\.kt:.*: warning: name shadowed: .+"]),
kotlin('unchecked cast',
[r".*\.kt:.*: warning: unchecked cast: .* to .*$"]),
+ kotlin('unnecessary safe call on a non-null receiver',
+ [r".*\.kt:.*: warning: unnecessary safe call on a non-null receiver"]),
kotlin('Deprecated in Java',
[r".*\.kt:.*: warning: '.*' is deprecated. Deprecated in Java"]),
+ kotlin('Replacing Handler for Executor',
+ [r".*\.kt:.*: warning: .+ Replacing Handler for Executor in "]),
kotlin('library has Kotlin runtime',
[r".*: warning: library has Kotlin runtime bundled into it",
r".*: warning: some JAR files .* have the Kotlin Runtime library"]),