Refactor conditional to use DEVICE_IS_64BIT_ONLY

Bug: 218458605
Bug: 223622655
Signed-off-by: Gina Ko <yichunko@google.com>
Change-Id: Ia74ef39ab8433d036925a30217f49da8f6fd863b
diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk
index 5038d37..1141a23 100644
--- a/BoardConfig-common.mk
+++ b/BoardConfig-common.mk
@@ -32,7 +32,9 @@
 TARGET_CPU_VARIANT := cortex-a55
 TARGET_CPU_VARIANT_RUNTIME := cortex-a55
 
-ifeq (,$(filter %tangor tangor% %_64,$(TARGET_PRODUCT)))
+DEVICE_IS_64BIT_ONLY ?= $(if $(filter %_64,$(TARGET_PRODUCT)), true, false)
+
+ifneq ($(DEVICE_IS_64BIT_ONLY),true)
 TARGET_2ND_ARCH := arm
 TARGET_2ND_ARCH_VARIANT := armv8-a
 TARGET_2ND_CPU_ABI := armeabi-v7a
diff --git a/aosp_common.mk b/aosp_common.mk
index 57d6722..8788251 100644
--- a/aosp_common.mk
+++ b/aosp_common.mk
@@ -17,10 +17,12 @@
 #
 # All components inherited here go to system image
 #
-ifeq (,$(filter %tangor tangor% %_64,$(TARGET_PRODUCT)))
-$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-else
+DEVICE_IS_64BIT_ONLY ?= $(if $(filter %_64,$(TARGET_PRODUCT)), true, false)
+
+ifeq ($(DEVICE_IS_64BIT_ONLY),true)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
+else
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
 endif
 
 $(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk)
diff --git a/device.mk b/device.mk
index 9c121a9..701b265 100644
--- a/device.mk
+++ b/device.mk
@@ -17,8 +17,9 @@
 include device/google/gs-common/device.mk
 
 TARGET_BOARD_PLATFORM := gs101
+DEVICE_IS_64BIT_ONLY ?= $(if $(filter %_64,$(TARGET_PRODUCT)), true, false)
 
-ifneq (,$(filter %tangor tangor% %_64,$(TARGET_PRODUCT)))
+ifeq ($(DEVICE_IS_64BIT_ONLY),true)
 LOCAL_64ONLY := _64
 endif
 
@@ -903,10 +904,10 @@
 $(call inherit-product-if-exists, vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY)/common/device-vendor.mk)
 endif
 
-ifeq (,$(filter %tangor tangor% %_64,$(TARGET_PRODUCT)))
-$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-else
+ifeq ($(DEVICE_IS_64BIT_ONLY),true)
 $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
+else
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
 endif
 #$(call inherit-product, hardware/google_devices/exynos5/exynos5.mk)
 #$(call inherit-product-if-exists, hardware/google_devices/gs101/gs101.mk)