diff options
17 files changed, 317 insertions, 94 deletions
diff --git a/MergeConfig.mk b/MergeConfig.mk index a1a4814..9c0ba0a 100644 --- a/MergeConfig.mk +++ b/MergeConfig.mk @@ -2,15 +2,9 @@ ifeq ($(ENABLE_AB), true) # Handle Case for QSSI-Dynamic Partition ifeq ($(BOARD_DYNAMIC_PARTITION_ENABLE), true) - ifeq ($(SYSTEMEXT_SEPARATE_PARTITION_ENABLE), true) $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/dynamic_partition/ab/merge_config_system_misc_info_keys) $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/dynamic_partition/ab/merge_config_other_item_list) $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/dynamic_partition/ab/merge_config_system_item_list) - else - $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/dynamic_partition/ab_noSysext/merge_config_system_misc_info_keys) - $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/dynamic_partition/ab_noSysext/merge_config_other_item_list) - $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/dynamic_partition/ab_noSysext/merge_config_system_item_list) - endif else $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/without_dynamic_partition/ab/merge_config_system_misc_info_keys) $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/without_dynamic_partition/ab/merge_config_other_item_list) @@ -19,15 +13,9 @@ ifeq ($(ENABLE_AB), true) else # Handle Case for QSSI-Dynamic Partition ifeq ($(BOARD_DYNAMIC_PARTITION_ENABLE), true) - ifeq ($(SYSTEMEXT_SEPARATE_PARTITION_ENABLE), true) $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/dynamic_partition/non_ab/merge_config_system_item_list) $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/dynamic_partition/non_ab/merge_config_other_item_list) $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/dynamic_partition/non_ab/merge_config_system_misc_info_keys) - else - $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/dynamic_partition/non_ab_noSysext/merge_config_system_item_list) - $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/dynamic_partition/non_ab_noSysext/merge_config_other_item_list) - $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/dynamic_partition/non_ab_noSysext/merge_config_system_misc_info_keys) - endif else $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/without_dynamic_partition/non_ab/merge_config_system_item_list) $(call dist-for-goals,droidcore,device/qcom/vendor-common/ota_merge_configs/without_dynamic_partition/non_ab/merge_config_other_item_list) @@ -309,6 +309,8 @@ INIT += enable_swap.sh INIT += init.mdm.sh INIT += fstab.qcom INIT += fstab.qti +INIT += fstab.default +INIT += fstab.emmc INIT += init.qcom.sensors.sh INIT += init.qcom.crashdata.sh INIT += init.qcom.vendor.rc @@ -819,6 +821,17 @@ else DELAUN := Launcher3 endif +#servicetracker HAL +PRODUCT_PACKAGES += \ + vendor.qti.hardware.servicetracker@1.2-impl \ + vendor.qti.hardware.servicetracker@1.2-service + +#debugApp FDA +PRODUCT_PACKAGES += FDA +PRODUCT_PACKAGES += debug.script.rc +PRODUCT_PACKAGES += init.debug.script.sh +PRODUCT_PACKAGES += init.myam.sh + PRODUCT_PACKAGES += $(ALSA_HARDWARE) PRODUCT_PACKAGES += $(ALSA_UCM) PRODUCT_PACKAGES += $(ANGLE) @@ -1066,11 +1079,14 @@ PRODUCT_PACKAGES_DEBUG += \ init.qti.debug-kona.sh \ init.qti.debug-lito.sh \ init.qti.debug-atoll.sh \ - init.qti.debug-trinket.sh + init.qti.debug-trinket.sh \ + init.qti.debug-bengal.sh PRODUCT_PACKAGES += liboemaids_system PRODUCT_PACKAGES += liboemaids_vendor -PRODUCT_PACKAGES += android.hardware.health@2.0-service +PRODUCT_PACKAGES += android.hardware.health@2.1-service +PRODUCT_PACKAGES += android.hardware.health@2.1-impl +PRODUCT_PACKAGES += android.hardware.health@2.1-impl.recovery # framework detect libs PRODUCT_PACKAGES += libvndfwk_detect_jni.qti PRODUCT_PACKAGES += libqti_vndfwk_detect diff --git a/common.mk b/common.mk new file mode 100755 index 0000000..ecc0f55 --- /dev/null +++ b/common.mk @@ -0,0 +1,69 @@ +$(call inherit-product, device/qcom/vendor-common/base.mk) + +# For PRODUCT_COPY_FILES, the first instance takes precedence. +# Since we want use QC specific files, we should inherit +# device-vendor.mk first to make sure QC specific files gets installed. +$(call inherit-product-if-exists, $(QCPATH)/common/config/device-vendor-qssi.mk) + +ifeq ($(TARGET_HAS_LOW_RAM),true) + PRODUCT_PROPERTY_OVERRIDES += \ + keyguard.no_require_sim=true \ + ro.com.android.dataroaming=true + + $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system.mk) + $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_vendor.mk) + $(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk) + $(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk) +else + $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) +endif + +PRODUCT_BRAND := qcom +PRODUCT_AAPT_CONFIG += hdpi mdpi + +PRODUCT_MANUFACTURER := QUALCOMM + +PRODUCT_PROPERTY_OVERRIDES += \ + ro.vendor.extension_library=libqti-perfd-client.so \ + persist.vendor.radio.apm_sim_not_pwdn=1 \ + persist.vendor.radio.custom_ecc=1 \ + persist.vendor.radio.sib16_support=1 \ + persist.vendor.radio.rat_on=combine \ + persist.backup.ntpServer=0.pool.ntp.org \ + sys.vendor.shutdown.waittime=500 \ + persist.vendor.radio.procedure_bytes=SKIP + +ifneq ($(BOARD_FRP_PARTITION_NAME),) + PRODUCT_PROPERTY_OVERRIDES += ro.frp.pst=/dev/block/bootdevice/by-name/$(BOARD_FRP_PARTITION_NAME) +else + PRODUCT_PROPERTY_OVERRIDES += ro.frp.pst=/dev/block/bootdevice/by-name/config +endif + +# whitelisted app +PRODUCT_COPY_FILES += \ + device/qcom/common/qti_whitelist.xml:system/etc/sysconfig/qti_whitelist.xml + +PRODUCT_COPY_FILES += \ + device/qcom/common/privapp-permissions-qti.xml:system/etc/permissions/privapp-permissions-qti.xml + +# Ipsec_tunnels feature +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.software.ipsec_tunnels.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.ipsec_tunnels.xml + +#copy telephony app's permissions +PRODUCT_COPY_FILES += $(QCPATH)/commonsys-intf/telephony/build/telephony_product_privapp-permissions-qti.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/telephony_product_privapp-permissions-qti.xml + +# Permission for Wi-Fi passpoint support +PRODUCT_COPY_FILES += frameworks/native/data/etc/android.hardware.wifi.passpoint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.passpoint.xml + +PRODUCT_PRIVATE_KEY := device/qcom/common/qcom.key +PRODUCT_PACKAGES += qcril.db + +ifneq ($(TARGET_DEFINES_DALVIK_HEAP), true) +ifneq ($(TARGET_HAS_LOW_RAM), true) +$(call inherit-product, frameworks/native/build/phone-xhdpi-1024-dalvik-heap.mk) +endif +endif + +#$(call inherit-product, frameworks/base/data/fonts/fonts.mk) +#$(call inherit-product, frameworks/base/data/keyboards/keyboards.mk) diff --git a/lights/Android.bp b/lights/Android.bp new file mode 100644 index 0000000..cd4c44e --- /dev/null +++ b/lights/Android.bp @@ -0,0 +1,18 @@ +cc_binary { + name: "android.hardware.lights-service.qti", + relative_install_path: "hw", + init_rc: ["android.hardware.lights-qti.rc"], + vintf_fragments: ["android.hardware.lights-qti.xml"], + vendor: true, + shared_libs: [ + "libbase", + "liblog", + "libhardware", + "libbinder_ndk", + "android.hardware.light-ndk_platform", + ], + srcs: [ + "Lights.cpp", + "main.cpp", + ], +} diff --git a/lights/Lights.cpp b/lights/Lights.cpp new file mode 100644 index 0000000..aa288b0 --- /dev/null +++ b/lights/Lights.cpp @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2019 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 "Lights.h" +#include <log/log.h> +#include <android-base/logging.h> + +namespace aidl { +namespace android { +namespace hardware { +namespace light { + +const static std::map<LightType, const char*> kLogicalLights = { + {LightType::BACKLIGHT, LIGHT_ID_BACKLIGHT}, + {LightType::KEYBOARD, LIGHT_ID_KEYBOARD}, + {LightType::BUTTONS, LIGHT_ID_BUTTONS}, + {LightType::BATTERY, LIGHT_ID_BATTERY}, + {LightType::NOTIFICATIONS, LIGHT_ID_NOTIFICATIONS}, + {LightType::ATTENTION, LIGHT_ID_ATTENTION}, + {LightType::BLUETOOTH, LIGHT_ID_BLUETOOTH}, + {LightType::WIFI, LIGHT_ID_WIFI} +}; + +light_device_t* getLightDevice(const char* name) { + light_device_t* lightDevice; + const hw_module_t* hwModule = NULL; + int ret = hw_get_module (LIGHTS_HARDWARE_MODULE_ID, &hwModule); + if (ret == 0) { + ret = hwModule->methods->open(hwModule, name, + reinterpret_cast<hw_device_t**>(&lightDevice)); + if (ret != 0) { + ALOGE("light_open %s %s failed: %d", LIGHTS_HARDWARE_MODULE_ID, name, ret); + } + } else { + ALOGE("hw_get_module %s %s failed: %d", LIGHTS_HARDWARE_MODULE_ID, name, ret); + } + if (ret == 0) { + return lightDevice; + } else { + ALOGE("Light passthrough failed to load legacy HAL."); + return nullptr; + } +} + +Lights::Lights() { + std::map<LightType, light_device_t*> lights; + std::vector<HwLight> availableLights; + for(auto const &pair : kLogicalLights) { + LightType type = pair.first; + const char* name = pair.second; + light_device_t* lightDevice = getLightDevice(name); + if (lightDevice != nullptr) { + lights[type] = lightDevice; + } + HwLight hwLight{}; + hwLight.id = availableLights.size(); + hwLight.type = type; + hwLight.ordinal = 0; + availableLights.emplace_back(hwLight); + } + mAvailableLights = availableLights; + mLights = lights; +} + +ndk::ScopedAStatus Lights::setLightState(int id, const HwLightState& state) { + if (id >= mAvailableLights.size()) { + ALOGE("Invalid Light id : %d", id); + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } + HwLight const& light = mAvailableLights[id]; + auto it = mLights.find(light.type); + if (it == mLights.end()) { + ALOGE("Light not supported"); + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); + } + light_device_t* hwLight = it->second; + light_state_t legacyState { + .color = static_cast<unsigned int>(state.color), + .flashMode = static_cast<int>(state.flashMode), + .flashOnMS = state.flashOnMs, + .flashOffMS = state.flashOffMs, + .brightnessMode = static_cast<int>(state.brightnessMode), + }; + int ret = hwLight->set_light(hwLight, &legacyState); + switch (ret) { + case -ENOSYS: + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); + case 0: + return ndk::ScopedAStatus::ok(); + default: + return ndk::ScopedAStatus::fromServiceSpecificError(ret); + } +} + +ndk::ScopedAStatus Lights::getLights(std::vector<HwLight>* lights) { + for (auto i = mAvailableLights.begin(); i != mAvailableLights.end(); i++) { + lights->push_back(*i); + } + return ndk::ScopedAStatus::ok(); +} + +} // namespace light +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/lights/Lights.h b/lights/Lights.h new file mode 100644 index 0000000..879ea55 --- /dev/null +++ b/lights/Lights.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#pragma once + +#include <aidl/android/hardware/light/BnLights.h> +#include <hardware/hardware.h> +#include <hardware/lights.h> +#include <map> + +namespace aidl { +namespace android { +namespace hardware { +namespace light { + +class Lights : public BnLights { + public: + Lights(); + ndk::ScopedAStatus setLightState(int id, const HwLightState& state) override; + ndk::ScopedAStatus getLights(std::vector<HwLight>* types) override; + + private: + std::map<LightType, light_device_t*> mLights; + std::vector<HwLight> mAvailableLights; +}; + +} // namespace light +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/lights/android.hardware.lights-qti.rc b/lights/android.hardware.lights-qti.rc new file mode 100644 index 0000000..beb1c8d --- /dev/null +++ b/lights/android.hardware.lights-qti.rc @@ -0,0 +1,5 @@ +service vendor.light-qti /vendor/bin/hw/android.hardware.lights-service.qti + class hal + user system + group system + shutdown critical diff --git a/lights/android.hardware.lights-qti.xml b/lights/android.hardware.lights-qti.xml new file mode 100644 index 0000000..db604d6 --- /dev/null +++ b/lights/android.hardware.lights-qti.xml @@ -0,0 +1,6 @@ +<manifest version="1.0" type="device"> + <hal format="aidl"> + <name>android.hardware.light</name> + <fqname>ILights/default</fqname> + </hal> +</manifest> diff --git a/lights/main.cpp b/lights/main.cpp new file mode 100644 index 0000000..5bab50d --- /dev/null +++ b/lights/main.cpp @@ -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. + */ + +#include "Lights.h" +#include <android-base/logging.h> +#include <android/binder_manager.h> +#include <android/binder_process.h> + +using ::aidl::android::hardware::light::Lights; + +int main() { + ABinderProcess_setThreadPoolMaxThreadCount(0); + std::shared_ptr<Lights> lights = ndk::SharedRefBase::make<Lights>(); + + const std::string instance = std::string() + Lights::descriptor + "/default"; + binder_status_t status = AServiceManager_addService(lights->asBinder().get(), instance.c_str()); + CHECK(status == STATUS_OK); + + ABinderProcess_joinThreadPool(); + return EXIT_FAILURE; // should not reached +} diff --git a/ota_merge_configs/dynamic_partition/ab/merge_config_other_item_list b/ota_merge_configs/dynamic_partition/ab/merge_config_other_item_list index 8343388..7a7f9ca 100644 --- a/ota_merge_configs/dynamic_partition/ab/merge_config_other_item_list +++ b/ota_merge_configs/dynamic_partition/ab/merge_config_other_item_list @@ -1,3 +1,5 @@ +IMAGES/odm.img +IMAGES/vendor.img META/boot_filesystem_config.txt META/file_contexts.bin META/otakeys.txt diff --git a/ota_merge_configs/dynamic_partition/ab/merge_config_system_item_list b/ota_merge_configs/dynamic_partition/ab/merge_config_system_item_list index 4f26b6a..1441e89 100644 --- a/ota_merge_configs/dynamic_partition/ab/merge_config_system_item_list +++ b/ota_merge_configs/dynamic_partition/ab/merge_config_system_item_list @@ -1,3 +1,7 @@ +IMAGES/product.img +IMAGES/system.img +IMAGES/system_ext.img +IMAGES/vbmeta_system.img META/apexkeys.txt META/apkcerts.txt META/filesystem_config.txt diff --git a/ota_merge_configs/dynamic_partition/ab_noSysext/merge_config_other_item_list b/ota_merge_configs/dynamic_partition/ab_noSysext/merge_config_other_item_list deleted file mode 100644 index 8343388..0000000 --- a/ota_merge_configs/dynamic_partition/ab_noSysext/merge_config_other_item_list +++ /dev/null @@ -1,16 +0,0 @@ -META/boot_filesystem_config.txt -META/file_contexts.bin -META/otakeys.txt -META/releasetools.py -META/vendor_filesystem_config.txt -META/vendor_manifest.xml -META/vendor_matrix.xml -BOOT/* -DATA/* -ODM/* -OTA/android-info.txt -PREBUILT_IMAGES/* -RADIO/* -RECOVERY/* -VENDOR/* -VENDOR_BOOT/* diff --git a/ota_merge_configs/dynamic_partition/ab_noSysext/merge_config_system_item_list b/ota_merge_configs/dynamic_partition/ab_noSysext/merge_config_system_item_list deleted file mode 100644 index 203b2e8..0000000 --- a/ota_merge_configs/dynamic_partition/ab_noSysext/merge_config_system_item_list +++ /dev/null @@ -1,10 +0,0 @@ -META/apexkeys.txt -META/apkcerts.txt -META/filesystem_config.txt -META/root_filesystem_config.txt -META/system_manifest.xml -META/system_matrix.xml -META/update_engine_config.txt -PRODUCT/* -ROOT/* -SYSTEM/* diff --git a/ota_merge_configs/dynamic_partition/ab_noSysext/merge_config_system_misc_info_keys b/ota_merge_configs/dynamic_partition/ab_noSysext/merge_config_system_misc_info_keys deleted file mode 100644 index b0b4d84..0000000 --- a/ota_merge_configs/dynamic_partition/ab_noSysext/merge_config_system_misc_info_keys +++ /dev/null @@ -1,14 +0,0 @@ -avb_system_hashtree_enable -avb_system_add_hashtree_footer_args -avb_system_ext_hashtree_enable -avb_system_ext_add_hashtree_footer_args -avb_vbmeta_system -avb_vbmeta_system_key_path -avb_vbmeta_system_algorithm -avb_vbmeta_system_rollback_index_location -avb_product_hashtree_enable -avb_product_add_hashtree_footer_args -root_dir -ab_update -default_system_dev_certificate -product_fs_type diff --git a/ota_merge_configs/dynamic_partition/non_ab_noSysext/merge_config_other_item_list b/ota_merge_configs/dynamic_partition/non_ab_noSysext/merge_config_other_item_list deleted file mode 100644 index 2cf96ce..0000000 --- a/ota_merge_configs/dynamic_partition/non_ab_noSysext/merge_config_other_item_list +++ /dev/null @@ -1,17 +0,0 @@ -META/boot_filesystem_config.txt -META/file_contexts.bin -META/otakeys.txt -META/recovery_filesystem_config.txt -META/releasetools.py -META/vendor_filesystem_config.txt -META/vendor_manifest.xml -META/vendor_matrix.xml -BOOT/* -DATA/* -ODM/* -OTA/android-info.txt -OTA/bin/updater -PREBUILT_IMAGES/* -RADIO/* -RECOVERY/* -VENDOR/* diff --git a/ota_merge_configs/dynamic_partition/non_ab_noSysext/merge_config_system_item_list b/ota_merge_configs/dynamic_partition/non_ab_noSysext/merge_config_system_item_list deleted file mode 100644 index 203b2e8..0000000 --- a/ota_merge_configs/dynamic_partition/non_ab_noSysext/merge_config_system_item_list +++ /dev/null @@ -1,10 +0,0 @@ -META/apexkeys.txt -META/apkcerts.txt -META/filesystem_config.txt -META/root_filesystem_config.txt -META/system_manifest.xml -META/system_matrix.xml -META/update_engine_config.txt -PRODUCT/* -ROOT/* -SYSTEM/* diff --git a/ota_merge_configs/dynamic_partition/non_ab_noSysext/merge_config_system_misc_info_keys b/ota_merge_configs/dynamic_partition/non_ab_noSysext/merge_config_system_misc_info_keys deleted file mode 100644 index 64e1e2e..0000000 --- a/ota_merge_configs/dynamic_partition/non_ab_noSysext/merge_config_system_misc_info_keys +++ /dev/null @@ -1,13 +0,0 @@ -avb_system_hashtree_enable -avb_system_add_hashtree_footer_args -avb_system_ext_hashtree_enable -avb_system_ext_add_hashtree_footer_args -avb_vbmeta_system -avb_vbmeta_system_key_path -avb_vbmeta_system_algorithm -avb_vbmeta_system_rollback_index_location -avb_product_hashtree_enable -avb_product_add_hashtree_footer_args -root_dir -default_system_dev_certificate -product_fs_type |