From 5d3daa165d4e5165ee544c3126782b68edca2018 Mon Sep 17 00:00:00 2001 From: basamaryan Date: Sun, 29 Dec 2024 14:58:36 +0400 Subject: [PATCH] sm6150-common: livedisplay: Migrate to select() Change-Id: I2d1741cec6ce78d81e04b282c6a8dddf16832737 Signed-off-by: therealmharc --- livedisplay/Android.bp | 54 +++++++++++++----------------------------- 1 file changed, 17 insertions(+), 37 deletions(-) diff --git a/livedisplay/Android.bp b/livedisplay/Android.bp index 1d28c4d..00be07d 100644 --- a/livedisplay/Android.bp +++ b/livedisplay/Android.bp @@ -1,5 +1,5 @@ // -// Copyright (C) 2019-2020 The LineageOS Project +// Copyright (C) 2019-2024 The LineageOS Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,45 +13,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -soong_config_module_type { - name: "livedisplay_supported_interfaces", - module_type: "cc_defaults", - config_namespace: "xiaomiSm6150Vars", - bool_variables: [ - "livedisplay_support_anti_flicker", - "livedisplay_support_sunlight_enhancement", - ], - properties: [ - "cflags", - "vintf_fragments", - ], -} - -livedisplay_supported_interfaces { - name: "livedisplay_supported_interfaces_defaults", - soong_config_variables: { - livedisplay_support_anti_flicker: { - cflags: ["-DSUPPORT_ANTI_FLICKER"], - vintf_fragments: [ - "vendor.lineage.livedisplay@2.1_IAntiFlicker.xml", - ], - }, - livedisplay_support_sunlight_enhancement: { - cflags: ["-DSUPPORT_SUNLIGHT_ENHANCEMENT"], - vintf_fragments: [ - "vendor.lineage.livedisplay@2.1_ISunlightEnhancement.xml", - ], - }, - }, -} - cc_binary { name: "vendor.lineage.livedisplay@2.1-service.xiaomi_sm6150", - defaults: [ - "hidl_defaults", - "livedisplay_supported_interfaces_defaults", + defaults: ["hidl_defaults"], + vintf_fragments: select(soong_config_variable("xiaomiSm6150Vars", "livedisplay_support_anti_flicker"), { + "true": ["vendor.lineage.livedisplay@2.1_IAntiFlicker.xml"], + default: [], + }) + select(soong_config_variable("xiaomiSm6150Vars", "livedisplay_support_sunlight_enhancement"), { + "true": ["vendor.lineage.livedisplay@2.1_ISunlightEnhancement.xml"], + default: [], + }) + [ + "vendor.lineage.livedisplay@2.1-service.xiaomi_sm6150.xml", ], - vintf_fragments: ["vendor.lineage.livedisplay@2.1-service.xiaomi_sm6150.xml"], init_rc: ["vendor.lineage.livedisplay@2.1-service.xiaomi_sm6150.rc"], relative_install_path: "hw", srcs: [ @@ -73,4 +46,11 @@ cc_binary { header_libs: [ "vendor.lineage.livedisplay@2.0-sdm-headers", ], + cflags: select(soong_config_variable("xiaomiSm6150Vars", "livedisplay_support_anti_flicker"), { + "true": ["-DSUPPORT_ANTI_FLICKER"], + default: [], + }) + select(soong_config_variable("xiaomiSm6150Vars", "livedisplay_support_sunlight_enhancement"), { + "true": ["-DSUPPORT_SUNLIGHT_ENHANCEMENT"], + default: [], + }), }