Merge "Remove root folder bt_firmware in GSI" into oc-mr1-dev
diff --git a/core/Makefile b/core/Makefile
index 4a4760f..7f0e1cd 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -2271,6 +2271,7 @@
 		$(INSTALLED_USERDATAIMAGE_TARGET) \
 		$(INSTALLED_CACHEIMAGE_TARGET) \
 		$(INSTALLED_VENDORIMAGE_TARGET) \
+		$(INSTALLED_VBMETAIMAGE_TARGET) \
 		$(INSTALLED_DTBOIMAGE_TARGET) \
 		$(INTERNAL_SYSTEMOTHERIMAGE_FILES) \
 		$(INSTALLED_ANDROID_INFO_TXT_TARGET) \
@@ -2491,6 +2492,14 @@
 	@# If breakpad symbols have been generated, add them to the zip.
 	$(hide) $(ACP) -r $(TARGET_OUT_BREAKPAD) $(zip_root)/BREAKPAD
 endif
+# BOARD_BUILD_DISABLED_VBMETAIMAGE is used to build a special vbmeta.img
+# that disables AVB verification. The content is fixed and we can just copy
+# it to $(zip_root)/IMAGES without passing some info into misc_info.txt for
+# regeneration.
+ifeq (true,$(BOARD_BUILD_DISABLED_VBMETAIMAGE))
+	$(hide) mkdir -p $(zip_root)/IMAGES
+	$(hide) cp $(INSTALLED_VBMETAIMAGE_TARGET) $(zip_root)/IMAGES/
+endif
 ifdef BOARD_PREBUILT_VENDORIMAGE
 	$(hide) mkdir -p $(zip_root)/IMAGES
 	$(hide) cp $(INSTALLED_VENDORIMAGE_TARGET) $(zip_root)/IMAGES/
diff --git a/core/config.mk b/core/config.mk
index 232f116..94277de 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -762,8 +762,14 @@
 
 ifeq ($(strip $(PRODUCT_COMPATIBILITY_MATRIX_LEVEL)),legacy)
   FRAMEWORK_COMPATIBILITY_MATRIX_FILE := hardware/interfaces/compatibility_matrix.legacy.xml
-else ifeq ($(call math_gt_or_eq,$(PRODUCT_COMPATIBILITY_MATRIX_LEVEL),27),)
+else ifeq ($(call math_gt_or_eq,$(PRODUCT_COMPATIBILITY_MATRIX_LEVEL),26),)
+  # All PRODUCT_FULL_TREBLE devices with shipping API levels < 26 get the level 26 manifest
+  # as that is the first.
   FRAMEWORK_COMPATIBILITY_MATRIX_FILE := hardware/interfaces/compatibility_matrix.26.xml
+else ifeq ($(call math_gt_or_eq,$(PRODUCT_COMPATIBILITY_MATRIX_LEVEL),28),)
+  # All shipping API levels with released compatibility matrices get the corresponding matrix.
+  FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \
+      hardware/interfaces/compatibility_matrix.$(PRODUCT_COMPATIBILITY_MATRIX_LEVEL).xml
 else
   FRAMEWORK_COMPATIBILITY_MATRIX_FILE := hardware/interfaces/compatibility_matrix.current.xml
 endif
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 1e2611a..8a3eef8 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -78,7 +78,7 @@
 
 # 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.OPM1 := OMR1
+PLATFORM_VERSION_CODENAME.OPM1 := REL
 
 ifndef PLATFORM_VERSION
   PLATFORM_VERSION := $(PLATFORM_VERSION.$(TARGET_PLATFORM_VERSION))
@@ -158,7 +158,7 @@
     # assuming the device can only support APIs as of the previous official
     # public release.
     # This value will always be 0 for release builds.
-    PLATFORM_PREVIEW_SDK_VERSION := 1
+    PLATFORM_PREVIEW_SDK_VERSION := 0
   endif
 endif
 
diff --git a/target/board/treble_system.prop b/target/board/treble_system.prop
index bedf10c..4b54aaf 100644
--- a/target/board/treble_system.prop
+++ b/target/board/treble_system.prop
@@ -1,2 +1,5 @@
 # GSI always generate dex pre-opt in system image
 ro.cp_system_other_odex=0
+
+# GSI always disables adb authentication
+ro.adb.secure=0
diff --git a/target/product/aosp_arm64_a.mk b/target/product/aosp_arm64_a.mk
index 84d4b4f..3c7af33 100644
--- a/target/product/aosp_arm64_a.mk
+++ b/target/product/aosp_arm64_a.mk
@@ -21,8 +21,6 @@
 
 include build/make/target/product/treble_common_64.mk
 
-$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
-
 PRODUCT_NAME := aosp_arm64_a
 PRODUCT_DEVICE := generic_arm64_a
 PRODUCT_BRAND := Android
diff --git a/target/product/aosp_arm64_ab.mk b/target/product/aosp_arm64_ab.mk
index 75ded35..c96cb91 100644
--- a/target/product/aosp_arm64_ab.mk
+++ b/target/product/aosp_arm64_ab.mk
@@ -27,8 +27,6 @@
     update_engine \
     update_verifier
 
-$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
-
 PRODUCT_NAME := aosp_arm64_ab
 PRODUCT_DEVICE := generic_arm64_ab
 PRODUCT_BRAND := Android
diff --git a/target/product/aosp_arm_a.mk b/target/product/aosp_arm_a.mk
index 845d091..3060fa9 100644
--- a/target/product/aosp_arm_a.mk
+++ b/target/product/aosp_arm_a.mk
@@ -21,8 +21,6 @@
 
 include build/make/target/product/treble_common_32.mk
 
-$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
-
 PRODUCT_NAME := aosp_arm_a
 PRODUCT_DEVICE := generic_arm_a
 PRODUCT_BRAND := Android
diff --git a/target/product/aosp_arm_ab.mk b/target/product/aosp_arm_ab.mk
index 3a862eb..98b2f99 100644
--- a/target/product/aosp_arm_ab.mk
+++ b/target/product/aosp_arm_ab.mk
@@ -27,8 +27,6 @@
     update_engine \
     update_verifier
 
-$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
-
 PRODUCT_NAME := aosp_arm_ab
 PRODUCT_DEVICE := generic_arm_ab
 PRODUCT_BRAND := Android
diff --git a/target/product/aosp_x86_64_a.mk b/target/product/aosp_x86_64_a.mk
index 53f8252..a7fb740 100644
--- a/target/product/aosp_x86_64_a.mk
+++ b/target/product/aosp_x86_64_a.mk
@@ -21,8 +21,6 @@
 
 include build/make/target/product/treble_common_64.mk
 
-$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
-
 PRODUCT_NAME := aosp_x86_64_a
 PRODUCT_DEVICE := generic_x86_64_a
 PRODUCT_BRAND := Android
diff --git a/target/product/aosp_x86_64_ab.mk b/target/product/aosp_x86_64_ab.mk
index 6080695..4590dc5 100644
--- a/target/product/aosp_x86_64_ab.mk
+++ b/target/product/aosp_x86_64_ab.mk
@@ -27,8 +27,6 @@
     update_engine \
     update_verifier
 
-$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
-
 PRODUCT_NAME := aosp_x86_64_ab
 PRODUCT_DEVICE := generic_x86_64_ab
 PRODUCT_BRAND := Android
diff --git a/target/product/aosp_x86_a.mk b/target/product/aosp_x86_a.mk
index 72d6e1a..9ed2995 100644
--- a/target/product/aosp_x86_a.mk
+++ b/target/product/aosp_x86_a.mk
@@ -21,8 +21,6 @@
 
 include build/make/target/product/treble_common_32.mk
 
-$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
-
 PRODUCT_NAME := aosp_x86_a
 PRODUCT_DEVICE := generic_x86_a
 PRODUCT_BRAND := Android
diff --git a/target/product/aosp_x86_ab.mk b/target/product/aosp_x86_ab.mk
index f3aef95..404a4da 100644
--- a/target/product/aosp_x86_ab.mk
+++ b/target/product/aosp_x86_ab.mk
@@ -27,8 +27,6 @@
     update_engine \
     update_verifier
 
-$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
-
 PRODUCT_NAME := aosp_x86_ab
 PRODUCT_DEVICE := generic_x86_ab
 PRODUCT_BRAND := Android
diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk
index 070486d..1c38b02 100644
--- a/target/product/treble_common.mk
+++ b/target/product/treble_common.mk
@@ -19,6 +19,10 @@
 # on the generic system image, place them in build/make/target/board/
 # treble_system.prop.
 
+# Generic system image inherits from AOSP with telephony
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony.mk)
+
 # Split selinux policy
 PRODUCT_FULL_TREBLE_OVERRIDE := true