Merge "rename libvixl to libvixl.com.android.art.debug"
diff --git a/core/base_rules.mk b/core/base_rules.mk
index 9576a80..f5e8e35 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -197,6 +197,7 @@
 endif
 my_module_path := $(patsubst %/,%,$(my_module_path))
 my_module_relative_path := $(strip $(LOCAL_MODULE_RELATIVE_PATH))
+
 ifdef LOCAL_IS_HOST_MODULE
   partition_tag :=
   actual_partition_tag :=
@@ -345,16 +346,16 @@
 ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
   # Apk and its attachments reside in its own subdir.
   ifeq ($(LOCAL_MODULE_CLASS),APPS)
-  # framework-res.apk doesn't like the additional layer.
-  ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
-  # Neither do Runtime Resource Overlay apks, which contain just the overlaid resources.
-  else ifeq ($(LOCAL_IS_RUNTIME_RESOURCE_OVERLAY),true)
-  else
-    ifneq ($(use_testcase_folder),true)
-      my_module_path := $(my_module_path)/$(LOCAL_MODULE)
+    # framework-res.apk doesn't like the additional layer.
+    ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
+      # Neither do Runtime Resource Overlay apks, which contain just the overlaid resources.
+    else ifeq ($(LOCAL_IS_RUNTIME_RESOURCE_OVERLAY),true)
+    else
+      ifneq ($(use_testcase_folder),true)
+        my_module_path := $(my_module_path)/$(LOCAL_MODULE)
+      endif
     endif
   endif
-  endif
   LOCAL_INSTALLED_MODULE := $(my_module_path)/$(my_installed_module_stem)
 endif
 
@@ -805,6 +806,16 @@
 ALL_MODULES.$(my_register_name).PICKUP_FILES := \
     $(ALL_MODULES.$(my_register_name).PICKUP_FILES) $(LOCAL_PICKUP_FILES)
 endif
+# Record the platform availability of this module. Note that the availability is not
+# meaningful for non-installable modules (e.g., static libs) or host modules.
+# We only care about modules that are installable to the device.
+ifeq (true,$(LOCAL_NOT_AVAILABLE_FOR_PLATFORM))
+  ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
+    ifndef LOCAL_IS_HOST_MODULE
+      ALL_MODULES.$(my_register_name).NOT_AVAILABLE_FOR_PLATFORM := true
+    endif
+  endif
+endif
 
 my_required_modules := $(LOCAL_REQUIRED_MODULES) \
     $(LOCAL_REQUIRED_MODULES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH))
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index e2bdb37..5af0570 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -192,6 +192,7 @@
 LOCAL_NOSANITIZE:=
 LOCAL_NO_STANDARD_LIBRARIES:=
 LOCAL_NO_STATIC_ANALYZER:=
+LOCAL_NOT_AVAILABLE_FOR_PLATFORM:=
 LOCAL_NOTICE_FILE:=
 LOCAL_ODM_MODULE:=
 LOCAL_OEM_MODULE:=
diff --git a/core/tasks/platform_availability_check.mk b/core/tasks/platform_availability_check.mk
new file mode 100644
index 0000000..043d130
--- /dev/null
+++ b/core/tasks/platform_availability_check.mk
@@ -0,0 +1,36 @@
+#
+# 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.
+#
+
+# Check whether there is any module that isn't available for platform
+# is installed to the platform.
+
+# Filter FAKE and NON_INSTALLABLE modules out and then collect those are not
+# available for platform
+_modules_not_available_for_platform := \
+$(strip $(foreach m,$(product_MODULES),\
+  $(if $(filter-out FAKE,$(ALL_MODULES.$(m).CLASS)),\
+    $(if $(ALL_MODULES.$(m).INSTALLED),\
+      $(if $(filter true,$(ALL_MODULES.$(m).NOT_AVAILABLE_FOR_PLATFORM)),\
+        $(m))))))
+
+_violators_with_path := $(foreach m,$(sort $(_modules_not_available_for_platform)),\
+    $(m):$(word 1,$(ALL_MODULES.$(m).PATH))\
+)
+
+$(call maybe-print-list-and-error,$(_violators_with_path),\
+Following modules are requested to be installed. But are not available \
+for platform because they do not have "//apex_available:platform" or \
+they depend on other modules that are not available for platform)
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 39956b6..f16b7a7 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -237,7 +237,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-04-05
+      PLATFORM_SECURITY_PATCH := 2020-05-05
 endif
 .KATI_READONLY := PLATFORM_SECURITY_PATCH